CN114816686A - Processing method of computing task, electronic device and storage medium - Google Patents

Processing method of computing task, electronic device and storage medium Download PDF

Info

Publication number
CN114816686A
CN114816686A CN202110089838.2A CN202110089838A CN114816686A CN 114816686 A CN114816686 A CN 114816686A CN 202110089838 A CN202110089838 A CN 202110089838A CN 114816686 A CN114816686 A CN 114816686A
Authority
CN
China
Prior art keywords
computing
task
computing device
video
rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110089838.2A
Other languages
Chinese (zh)
Inventor
贾灿
蒋宇波
马佳俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202110089838.2A priority Critical patent/CN114816686A/en
Publication of CN114816686A publication Critical patent/CN114816686A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application provides a processing method of a computing task, an electronic device and a computer readable storage medium. The processing method of the computing task distributes the computing task to be executed to N computing devices in a distributed computing system where the electronic device is located to execute, wherein N is a positive integer more than 2; the method comprises the following steps: receiving task data of a computing task to be executed; dividing a computing task to be executed into N subtasks based on task execution rate information of each of N computing devices, wherein the computing task is divided such that an objective function f ═ max { T } 1 ,T 2 ,…,T i ,…,T N Has a minimum value, T i The time length required by the ith computing device for completing the ith subtask is set, wherein i is a positive integer between 1 and N; and distributing the task data of the N subtasks to the N computing devices so that each computing device executes the subtasks received by the computing device. The application canProviding efficiency in the execution of distributed computing tasks.

Description

Processing method of computing task, electronic device and storage medium
Technical Field
The present application relates to the field of distributed computing technologies, and in particular, to a method for processing a computing task, an electronic device, and a computer-readable storage medium.
Background
At present, various electronic devices provide increasingly rich functions for people. To support these rich functions, the electronic device sometimes needs to perform more complex operations, such as various codec operations, AI operations, graphics operations, and so on. However, for some electronic devices, their own hardware resources are limited, and it is difficult to support complex computing tasks, which may degrade the user experience.
For short video applications (e.g. tremble audio) TM ) For example. Through the platform provided by the short video application, the user can release the video works shot by the user on the platform. In some cases, the video shot by the user is a high definition video (e.g., a 4K video), and the user needs to compress the shot video before distribution. In the prior art, when an electronic device compresses a video, a long compression time is needed, and some electronic devices do not even open a video compression function, which brings inconvenience to users.
Disclosure of Invention
Some embodiments of the present application provide a processing method of a computing task, an electronic device, and a computer-readable storage medium, which are described below in various aspects, and embodiments and advantages of the following aspects may be mutually referenced.
In a first aspect, a method for processing a computing task in an embodiment of the present application is used for an electronic device, and the method distributes a computing task to be executed to N computing devices in a distributed computing system where the electronic device is located, where N is a positive integer greater than 2; the method comprises the following steps: receiving task data of a computing task to be executed; dividing a computing task to be executed into N subtasks based on task execution rate information of each computing device in the N computing devices, wherein the task execution rate information of the computing device is the rate of the computing device for completing a predetermined amount of computing tasks; and distributing the task data of the N subtasks to the N computing devices so that each computing device executes the subtasks received by the computing device.
According to the embodiment of the application, the subtasks are distributed according to the task execution rate information of the computing equipment, so that the subtasks with larger task amount can be distributed for the equipment with high task execution rate; for equipment with slow task execution rate, subtasks with smaller task amount can be distributed, so that the overall execution efficiency of the computing task can be improved.
In some implementations, the task execution rate information of the computing device includes computing power of the computing device and/or network communication rate of the computing device.
In some embodiments, the computational task is partitioned such that the objective function f ═ max { T ═ m 1 ,T 2 ,…,T i ,…,T N Has a minimum value, where T i And the time length required by the ith computing equipment for completing the ith subtask is obtained according to the task execution rate information of the ith computing equipment and the task data volume of the ith subtask, wherein i is a positive integer between 1 and N.
According to the implementation mode of the application, the distributed computing tasks are distributed based on the principle of the shortest longest time consumption, the execution time of the computing tasks and the user waiting time can be obviously reduced, and the user experience is improved.
In some embodiments of the present invention, the substrate is,
Figure BDA0002912310880000011
wherein Q is i Amount of task data for ith subtask, c i Computing power, v, for the i-th computing device i The network communication rate of the ith computing device is s, the ratio of the result data volume of the computing task to the task data volume of the computing task is s, and the ratio of the operation volume of the computing task to the task data volume of the computing task is k.
According to the implementation mode of the application, the optimization problem corresponding to the task distribution has an accurate solution, iteration is not needed in the solving process, the solving process can be simplified, and the solving efficiency is improved.
In some embodiments, the network communication rate of the computing device is an average of the data uplink rate and the data downlink rate of the computing device during network communication.
In some implementations, the network communication rate of the computing device is determined from network communication rate information of the computing device during historical communications.
In some embodiments, the computing power of the computing device is a theoretical available computing power of the computing device determined according to the CPU model information and the CPU utilization rate of the computing device.
In some embodiments, the computing device's computing power information is the computing device's actual available computing power; the method for determining the actual available computing power of the computing device comprises the following steps: determining a peak computing force of the computing device; determining utilization rate information of computing resources of the computing device, wherein the utilization rate information comprises current utilization rates or current idle rates of various computing resources in one or more computing resources of the computing device, and the utilization rate information further comprises expected utilization rates or expected idle rates of various computing resources in the one or more computing resources of the computing device; the peak calculation power and the current utilization rate information are used as input, a preset first calculation power calculation model is operated, and the available calculation power of the calculation equipment is obtained; the first computing power calculation model is a machine learning model obtained by training according to peak computing power of a plurality of sample computing devices and utilization rate information of the sample computing devices.
The meaning of "the current usage or current idle rate of each of the computing resources (for convenience of expression, the" one or more computing resources "are referred to as" computing resource group G1 ") is: the current utilization rate of each calculation resource in the calculation resource group G1; or, the current idle rate of each computing resource in the computing resource group G1; alternatively, the current usage of a portion of the computing resources and the current idle rate of another portion of the computing resources in the computing resource group G1.
The meaning of "the expected usage or expected idle rate of each computing resource in one or more computing resources (for convenience of expression, the" one or more computing resources "are referred to as" computing resource group G2 ") is: the expected utilization rate of each computing resource in the computing resource group G2; or, the expected idle rate of each computing resource in the computing resource group G2; alternatively, the expected usage of a portion of the computing resources and the expected idle rate of another portion of the computing resources in the computing resource group G2.
The embodiment of the application can provide a general calculation method for calculating the available calculation power of electronic equipment with different forms. When the calculation task is distributed according to the actual available calculation power provided by the embodiment of the application, the influence on the normal use of the electronic equipment can be reduced.
In some embodiments, the expected usage of the computing resource is determined based on the usage of the computing resource over M historical usage cycles, where M is a positive integer.
In some embodiments, the computational task is partitioned such that k · Q i ≤E i Wherein E is i The remaining memory capacity of the i-th computing device.
In some implementations, the electronic device is one of N computing devices.
In some embodiments, the electronic device is one of the N computing devices, and the duration of time the electronic device is configured to complete its corresponding subtask
Figure BDA0002912310880000021
Wherein Q is B Amount of task data for subtasks corresponding to the electronic device, c B Is the computing power of the electronic equipment.
In some embodiments, the computational task to be performed is a video compression task.
In a second aspect, an embodiment of the present application provides an electronic device, including: a memory to store instructions for execution by one or more processors of an electronic device; the processor, when executing the instructions in the memory, may cause the electronic device to perform the processing method for the computing task provided in any embodiment of the first aspect of the present application. The beneficial effects that can be achieved by the second aspect can refer to the beneficial effects of any implementation manner of the first aspect of the present application, and are not described herein again.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the instructions may cause the computer to perform a processing method for a computing task provided in any of the embodiments of the first aspect of the present application. The beneficial effects that can be achieved by the third aspect can refer to the beneficial effects of any one of the embodiments of the first aspect of the present application, and are not described herein again.
Drawings
Fig. 1 is a schematic view of a user interface of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating an execution manner of a distributed computing task according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a distributed computing system according to an embodiment of the present disclosure;
fig. 4 is an application scenario diagram of a processing method for a computing task according to an embodiment of the present application;
FIG. 5 is a diagram illustrating a distributed computing task execution process according to an embodiment of the present application;
fig. 6a is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
FIG. 6b is a diagram of a software architecture of an electronic device according to an embodiment of the present application;
FIG. 7 is a first flowchart illustrating a method for processing a distributed computing task according to an embodiment of the present disclosure;
fig. 8 is an exemplary flowchart of a device status information obtaining method provided in an embodiment of the present application;
FIG. 9a is a second exemplary flowchart of a method for processing a distributed computing task according to an embodiment of the present application;
FIG. 9b is an exemplary flowchart of a method for determining an actual available computing power of a computing device according to an embodiment of the present application;
FIG. 9c is a flowchart of a training data obtaining method for a computational calculation model according to an embodiment of the present disclosure;
fig. 10 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 11 shows a block diagram of a control device provided in an embodiment of the present application;
fig. 12 shows a schematic structural diagram of a System on Chip (SoC) according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, specific embodiments of the present application will be described in detail with reference to the accompanying drawings.
At present, various electronic devices provide increasingly rich functions for people. To support these rich functions, the electronic device sometimes needs to perform more complex operations, such as various codec operations, AI operations (e.g., image recognition, voice recognition, etc.), graphics operations (e.g., game interface rendering, etc.), and so on. However, for some electronic devices, the hardware configuration itself is limited, and thus it is difficult to support complex computing tasks.
In short video applications (e.g., tremble) that are currently favored by users TM Watermelon video TM ) For example. Through the platform that short video application provided, the user can release the video works that oneself shot, cut on the platform to watch the video works that other users released on the platform, thereby can participate in the social mode that has more richness, interest.
When a user needs to publish a work on a short video application platform (hereinafter referred to as "platform"), an original video file shot by the user may have a different resolution from a video file uploaded to the platform. Typically, the original video file captured by the user has a higher resolution (e.g., 4K, 2K), while the video file uploaded to the platform has a lower resolution. This is because, for one thing, short video applications have certain resolution requirements on video files uploaded by users, for example, some short video applications require that the video uploaded by users cannot exceed 720P; secondly, when the resolution is too high, the time consumption of network transmission of the video file is increased. Therefore, when uploading a video file to a platform, the original video file needs to be compressed.
Fig. 1 shows a process of compressing a video file by a user operating a user interface of an electronic device (fig. 1 is a mobile phone). The interface shown in FIG. 1 may be an interface for a short video application or may be video clipping software (e.g., clip-on TM Love clip TM ) The interface of (2). In fig. 1(a), after finishing the editing of the video, the user sets the compression parameters (for example, the resolution after compression is set to 720p), and after clicking the "generate video" button, starts the compression process of the video file; in the figure1(b), the mobile phone calls a video compression function of the mobile phone to compress a video file, and displays a compression progress (shown as 36%) on an interface; in fig. 1(c), the handset completes the compression of the video file and stores the compressed video locally in the handset. After clicking a 'click play' button, a user can play the compressed video; after clicking the 'upload video' button, the user can upload the compressed video to the short video application platform.
For various types of high definition video (e.g., 4K video), the electronic device needs a long compression latency when compressing it. Table 1 shows the compression time of a 4K video (video with a resolution of 3840 × 2160) compressed by the huabei Mate 20 handset, where the duration of the 4K video is t and the data size is 234 MB. Referring to table 1, the compression time taken for the video editing application a to compress the video is 53.23s, and the compression time taken for the video editing application B to compress the video is 20.77 s. In addition, some electronic devices may not even have high-definition video compression functionality due to computational limitations. E.g. glory TM The 20 youth edition does not open the 4K video compression function.
TABLE 1 time consumption (units: s) for HUAWEI Mate 20 handset to perform video compression task
Compression duration 1 Duration of compression 2 Duration of compression 3 Average compression duration
Video editing application A 53.78 52.94 52.97 53.23
Video editing application B 33.84 33.71 33.75 33.77
To reduce the video compression latency, referring to fig. 2, in some implementations, the video is compressed with the aid of the computing power of the cloud server. Specifically, after finishing video clipping on a mobile phone, a user uploads a video file to a cloud server (e.g., a short video application server), and the cloud server compresses the video file uploaded by the user. For a low-end model, the implementation mode can overcome the defect that the low-end model does not have a high-definition video compression function; for models with video compression capability, the implementation mode can reduce the user waiting time in the video compression process. However, as the number of users of short video applications increases, the cloud server receives a large number of concurrent video compression requests, which causes the hardware cost of the cloud server to increase dramatically.
For this reason, in the implementation provided in the present application, when an electronic device (e.g., a mobile phone) receives a computing task (e.g., the video compression task described above) to be executed, the electronic device divides the computing task into a plurality of sub-tasks, and distributes each sub-task to a plurality of electronic devices in a distributed computing system in which the electronic device is located (the electronic devices distributed to the computing task in the distributed computing system are referred to as "computing devices" herein), so as to collectively complete the computing task by means of the computing power of the plurality of computing devices (hereinafter, specifically, N is an integer greater than or equal to 2). Because the computing power for executing the computing task is increased, the task execution efficiency can be improved, and the task execution time can be shortened.
Further, the embodiment of the application divides the computing task to be executed into N subtasks based on the task execution rate information of each of the N computing devices. Wherein the task execution rate information of the computing device is a rate at which the computing device is to complete a predetermined amount of computing tasks. Illustratively, a process by which a computing device accomplishes a computing task includes: a process in which the computing device receives task data for a subtask from the task distribution device; the computing device runs the process of the subtask (e.g., the process of compressing video slices); and a process in which the computing device returns the result data of the subtask to the task distributing device.
Therefore, for the equipment with high task execution rate, the subtasks with larger task amount can be distributed; for equipment with slow task execution rate, subtasks with smaller task amount can be distributed, so that the overall execution efficiency of the computing task can be improved. In some examples, the task execution rate information of the computing device includes computing power of the computing device and/or network communication rate of the computing device. It can be understood that the computing power of the computing device is related to the time required by the computing device to run the corresponding subtask, and the network communication rate of the computing device is related to the time required by the task data of the subtask to be transmitted in the network.
The processing method of the computing task provided by the present application is described below with reference to fig. 3, which shows a distributed computing system. Fig. 3 includes N computing devices, where N is a positive integer greater than 2, and the N computing devices are in communication connection with each other. When one of the computing devices (shown as computing device 1) receives a computing task a to be executed, the computing device 1 divides the computing task to be executed into N subtasks, and the task data volumes of the N subtasks are respectively marked as Q 1 ,Q 2 ,……,Q i ,……,Q N Wherein Q is i The task data amount of the ith subtask, i, is a positive integer between 1 and N.
After the N subtasks are distributed to the N computing devices (specifically, task data of the ith subtask is distributed to the ith computing device (also referred to as "computing device i"), that is, the ith subtask corresponds to the ith computing device), time lengths of the computing devices for completing the subtasks may be different, and an actual completion time length of the computing task depends on the computing device that takes the longest time for the computing device to complete the subtask. For example, in one example, where N is 5, the time duration for the 5 th computing device to complete the respective corresponding subtasks is 10s, 12s, 9s, 8s, and 15s, respectively, then the actual completion time duration of the computing task depends on the time duration (i.e., 15s) for the 5 th computing device to complete the subtasks. For convenience of description, the longest time that the computing device completes the subtask is hereinafter referred to as "longest time", and it is understood that "longest time" is 15s in the above example.
In some examples of embodiments of the present application, the subtasks are distributed based on the principle of "longest time consumption" being the shortest. Specifically, the calculation task is divided such that the objective function f is max { T ═ max { 1 ,T 2 ,……,T i ,……,T N Has a minimum value, T i The time length required for the ith computing device to complete the ith subtask, and T i According to the task execution rate information of the ith computing device and the task data quantity Q of the ith subtask i And calculating, wherein the task execution rate information of the computing device is used for characterizing the rate of the computing device completing the distributed computing task.
Further, in some examples,
Figure BDA0002912310880000051
wherein:
Q i the task data amount of the ith subtask. And when the computing task A is divided into N subtasks, the task distributing equipment distributes the task data of the ith subtask to the ith computing equipment. In some examples, when a subtask is executed, its task data is loaded into memory of the computing device used to execute the subtask;
c i computing power for the ith computing device. Computational power is used to represent the ability of a computing device to process data,typically measured by the amount of data processed by the computing device per unit of time. For example, the computational power may be measured in floating point numbers processed by the computing device per second, in this example, the unit of computational power is: (iii) Flop/s.
v i The network communication rate of the ith computing device is a data transmission rate of the computing device in the network communication process, and the data transmission rate is, for example, bps (i.e., b/s), Kbps, and the like. The network communication rate is divided into a data uplink rate and a data downlink rate of the computing device in the network communication process, wherein the data uplink rate is the rate of the computing device for transmitting data to the outside, and the data downlink rate is the rate of the computing device for receiving external data.
k is a constant related to the task type of the calculation task, and specifically, k is a ratio between an operation amount of the calculation task and a task data amount of the calculation task. When the computing device is running the computing task, the computing process involves not only the operation on the task data but also the operation on the intermediate data generated during the computing process, so the actual operation amount (the number of actually operated data) of the computing device may be larger than the task data amount of the computing task, and k is used to take the influence of this factor into account. Different types of computational tasks have different values of k. In some examples, the value k is determined empirically, e.g., for a transcoding task (e.g., a codec task for an audio-video file), the amount of computation is substantially the same as the amount of task data, and thus, the value k may be set to 1; for the AI calculation task, since a large number of convolution operations need to be performed on task data (e.g., input features), the value of k may be set to a large value, for example, k is 8; in other examples, the k value of the computation task may be determined according to an actual operation manner of the computation task, for example, for the AI task, the computation amount of the AI task is determined according to the AI computation model, and then the computation amount of the AI task is divided by the task data amount to obtain the k value of the AI task.
s is also a constant related to the task type of the calculation task, and specifically, s is a ratio of a result data amount of the calculation task (i.e., a data amount of an execution result of the calculation task) to a task data amount of the calculation task. Different types of tasks have different values of s. For example, for an audio/video compression task, the resulting data is compressed video data, so s is equal to the compression rate; for an AI task, the result data is usually a (or a group of) predicted data, so the result data amount of the AI task is much smaller than the task data amount thereof (the task data of the AI task includes an AI calculation model and input features), and thus the k value of the AI task can be set to 0; for other tasks, the k value of the task may be determined according to the ratio of the result data amount of the task to the task data amount, which is not described in detail herein.
After the computing task a is divided into N subtasks by the method, task data of the N subtasks is distributed to N computing devices (specifically, task data of the ith subtask is distributed to the ith computing device), so that each computing device executes the received subtask.
In summary, based on the method provided by the embodiment of the present application, the distributed computing task is distributed based on the principle of "longest time consumption" being shortest, so that the execution time of the computing task and the user waiting time can be significantly reduced, and the user experience is improved. In addition, the computing task is executed based on the distributed computing system where the electronic device is located (namely, the computing task is executed through the computing device in the local network where the electronic device is located), so that the computing burden and the hardware cost of the cloud server can be reduced.
In addition, in the embodiment of the application, since the complex computing task can be completed by means of other devices in the distributed computing network, the task distribution device itself may not have a function of executing the complex task, and thus the complex task can be opened to more models (for example, the high-resolution video compression function is opened to a low-end model), so that the stickiness of the user to the product is increased. In addition, the embodiment of the application also improves the friendliness degree of the application developer, and is beneficial to construction of ecology (for example, Hongmon ecology) while attracting the developer.
It should be noted that, in the example shown in fig. 3, the electronic device for distributing the computing task (referred to as "task distributing device" herein) is one of N computing devices, that is, the task distributing device distributes the computing task to N electronic devices including itself, but the application is not limited thereto. In other examples, the N computing devices do not include a task distribution device, i.e., the task distribution device distributes computing tasks to N other electronic devices in the distributed computing system other than itself.
Herein, the electronic device "receives the computing task" may be a computing task received locally from the electronic device, for example, a computing task generated by a computing device local application; or receiving a computing task from other electronic devices, for example, receiving an image recognition task from a camera by a mobile phone.
The above-described computing task that is collectively performed by a plurality of computing devices in a distributed computing system is referred to herein as a "distributed computing task". On the basis, the task type of the distributed computing task is not limited, and the distributed computing task can be an Artificial Intelligence (AI) task such as voice recognition, image recognition, user behavior prediction and navigation path planning, and can also be a non-AI task such as database maintenance, audio and video file transcoding, engineering computation and graphic computation.
In addition, a distributed computing system is a system in which several electronic devices are interconnected via a network. In a distributed computing system, electronic devices may cooperate to accomplish distributed computing tasks together. A Network for carrying a Distributed computing system is referred to herein as a "Distributed computing Network" (e.g., a hong meng system-based Distributed Network (ZDN)) ". The form of the distributed computing network may be an intelligent home network, an office local area network, a vehicle-mounted device network, a smart city network, etc., and the present application is not limited as long as each electronic device in the network can communicate with each other to complete the distributed computing task.
In addition, the embodiments of the present application do not limit the types of the task distribution apparatus and the computing apparatus. The types of task distribution devices and computing devices may be cell phones, laptops, tablets, wearable devices (e.g., watches, smart glasses, helmets), desktop computers, network devices (e.g., gateways, routers), smart appliances (e.g., smart speakers, smart screens), vehicle-mounted computers, etc., as long as computing capabilities are available.
For convenience of understanding, the technical solution of the present application is described below with an intelligent home system as an example of a distributed computing system and a video compression task as an example of a distributed computing task. It is to be understood that the present application is not so limited.
Fig. 4 shows the smart home system provided in this embodiment. In fig. 4, the mobile phone 100, the smart screen 210, the smart speaker 220, the camera 230, and the notebook computer 240 are connected to the home gateway 250 through their WiFi communication modules to form a home lan 200, and the electronic devices in the home lan 200 together form a distributed computing system. It should be noted that fig. 4 is only an exemplary illustration of the network topology form of the distributed computing system, and in other examples, the distributed computing system may adopt other network topology forms, for example, the smart screen 210 is not connected to the mobile phone 100 through the home gateway 250 in communication, but is connected to the mobile phone 100 through WiFi P2P in communication directly.
In the present embodiment, the cell phone 100 is taken as an example of a task distribution device. When the cell phone 100 receives a video compression task (e.g., a video compression task in the manner shown in fig. 1 (a)), the cell phone 100 slices the original video file. In this embodiment, the mobile phone 100 splits the original video file into video slices 1, 2 and 3. After the video file is divided, referring to fig. 5, the mobile phone 100 distributes the video segment 1 to itself, distributes the video segment 2 to the smart screen 210, and distributes the video segment 3 to the notebook computer 240. Then, the mobile phone 100, the smart screen 210 and the notebook computer 240 compress the video slices distributed to them. At this time, the cellular phone 100 may display an interface as shown in fig. 5. After the compression is completed, the smart screen 210 and the notebook computer 240 return the compressed video segment file to the mobile phone 100, and the mobile phone 100 synthesizes the compressed video segment file to form a compressed video file. After the composition of the video file is completed, the handset 100 may display an interface as shown in fig. 1 (c).
The following first describes a schematic structural diagram of the mobile phone 100 in this embodiment, and then describes specific steps of the video compression method provided in this embodiment.
Fig. 6a shows a schematic structural diagram of the mobile phone 100 provided in the present embodiment. Referring to fig. 6a, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the mobile phone 100. In other embodiments of the present application, the handset 100 may include more or fewer components than shown, or some components may be combined, some components may be separated, or a different arrangement of components may be used. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The processor can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, and a Subscriber Identity Module (SIM) interface.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement the touch function of the mobile phone 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, the processor 110 and the camera 193 communicate through a CSI interface to implement the camera function of the handset 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the mobile phone 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only an exemplary illustration, and does not limit the structure of the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The USB connector 130 is a connector conforming to the USB standard specification, and can be used to connect the mobile phone 100 and a peripheral device, and specifically can be a standard USB connector (e.g., Type C connector), a Mini USB connector, a Micro USB connector, and the like. The USB connector 130 may be used to connect a charger to charge the mobile phone 100, and may also be used to transmit data between the mobile phone 100 and peripheral devices. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The connector may also be used to connect other electronic devices, such as AR devices and the like. In some embodiments, processor 110 may support a Universal Serial Bus (Universal Serial Bus), which may have a standard specification of USB1.x, USB2.0, USB3.x, USB 4.
The wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the handset 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G, etc. applied to the handset 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication applied to the mobile phone 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, the antenna 1 of the handset 100 is coupled to the mobile communication module 150 and the antenna 2 is coupled to the wireless communication module 160 so that the handset 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The mobile phone 100 implements the display function through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the cell phone 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The mobile phone 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the handset 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the handset 100 is in frequency bin selection, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. Handset 100 may support one or more video codecs. Thus, the handset 100 can play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. The NPU can realize applications such as intelligent recognition of the mobile phone 100, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The data storage area may store data (e.g., audio data, a phonebook, etc.) created during use of the handset 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 110 executes various functional applications of the cellular phone 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor. The instructions stored in the internal memory 121 may include: the processing of the computing tasks provided by the embodiments of the application, when executed by at least one of the processors 110, causes the handset 100 to perform the processing methods provided by the embodiments of the application.
The software system of the mobile phone 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention uses an Android system with a layered architecture as an example to exemplarily illustrate a software structure of the mobile phone 100.
Fig. 6b is a block diagram of the software architecture of the handset 100 according to an embodiment of the invention.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 6b, the application package may include camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc. applications.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 6b, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide the communication functions of the handset 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The following describes specific steps of the processing method for video compression task provided in this embodiment. Referring to fig. 7, the processing method of the video compression task provided in this embodiment includes 3 stages, which are respectively:
s100: a service discovery and registration phase. The handset 100 discovers electronic devices in the home lan; and each electronic device registers its service capabilities in the cell phone 100, e.g., the smart screen 210 registers it with video compression capabilities in the cell phone 100.
S200: and a distributed task scheduling stage. The mobile phone 100 segments an original video file, and distributes the segmented video segments to electronic devices (referred to as "computing devices" in this embodiment) with video compression capability, so that each computing device compresses the distributed video segments.
S300: and a result summarizing stage. Each computing device returns the compressed video segments to the mobile phone 100, and the mobile phone 100 synthesizes the compressed video segments to form a compressed video file.
The specific steps of each stage will be described below.
Referring to fig. 7, the service discovery and registration phase S100 includes:
s110: the handset 100 discovers online devices in the home lan 200.
Illustratively, when the handset 100 joins the home lan (e.g., when the user returns home with the handset 100 and turns on the "WLAN" feature of the handset 100), an inquiry message is broadcast to the home lan to inquire about the devices on-line in the home lan. After receiving the query message sent by the mobile phone 100, the electronic device in the home lan sends a query reply to the mobile phone 100 to inform the mobile phone 100 of the online status of the electronic device.
The query reply sent by the electronic device in the home lan to the mobile phone 100 carries the device identifier of the electronic device, so that the mobile phone 100 knows the online status of the electronic device. In this embodiment, the form of the device identifier is not limited, and the device identifier may be a MAC address of the electronic device, a device name of the electronic device, a number of the electronic device in the home lan, and the like. The second column in table 2 shows the device numbers of the electronic devices in the home lan in fig. 4, for example, the device number of the mobile phone 100 is Node 001, the device number of the smart screen 210 is Node 002, and so on.
In the above example, the handset 100 actively sends the query message to discover the online device in the home lan when joining the home lan, but the application is not limited thereto. For example, in other examples, each electronic device in the home lan periodically broadcasts its own presence status in the home lan (e.g., once every 10 minutes), and the handset 100 can discover the presence devices in the home lan by listening to the broadcast.
S120: the online device in the home lan 200 registers its own service capability information with the cellular phone 100.
In this embodiment, the online device also carries its own service capability information in the query reply sent to the mobile phone 100, so as to register its own service capability information with the mobile phone 100. After receiving the service capability information of each online device, the mobile phone 100 stores the service capability information of each online device locally, so as to facilitate subsequent distribution of distributed computing tasks according to the service capability information of each online device, for example, distributing a video compression task to an electronic device with an audio/video transcoding function.
The service capability information of the electronic device includes functions and/or services supported by the electronic device, for example, whether a display function is supported, whether an audio playing function is supported, whether an audio/video transcoding function is supported, whether a telephone function is supported, whether 4G/5G communication is supported, and the like. The service capability information of the electronic device may also include applications supported by the electronic device, such as a browser application, an email application, and even a conversation application (e.g., WeChat) TM ) Screen sharing applications (e.g., screen projection applications), etc.
The third column of table 2 shows service capability information of each electronic device in fig. 4.
Table 2 service capability information of electronic device in home lan
Device name Device numbering Service capability information
Mobile phone 100 Node 001 Displaying; audio playing; audio and video transcoding; a telephone; … …, respectively; 5G communication
Intelligent screen
210 Node 002 Displaying; audio playing; … …, respectively; browser application
Smart speaker
220 Node 003 Audio playing; … …, respectively; speech recognition
Camera
230 Node 004 Image acquisition, audio recording
Notebook computer
240 Node 005 Displaying; audio playing; audio and video transcoding; … …; image recognition
The specific steps of the service discovery and registration phase in this embodiment are described above. It should be noted that the data obtained in the service discovery and registration phase may be shared by a plurality of distributed computing tasks. In other words, the data acquired in the service discovery and registration stage may be used for other distributed computing tasks, such as screen projection service, image recognition service, and the like, besides the video compression task in this embodiment.
The distributed task scheduling stage S200 is next described. Referring to fig. 7, the distributed task scheduling stage S200 includes the steps of:
s210: the handset 100 receives the video compression task.
In this embodiment, after the user clicks "generate video" on the interface shown in fig. 1, the mobile phone 100 receives a video compression task. That is, in the embodiment, the video compression task is from the application program of the mobile phone 100 itself. The application is not limited thereto and in other embodiments the video compression task may come from other devices, for example from a camera. In this embodiment, after the camera captures a video, the camera sends the video file to the mobile phone 100 and requests the mobile phone 100 to compress the video file, so that the mobile phone 100 receives the video compression task.
S220: the handset 100 screens the computing devices for performing the video compression task.
After receiving the video compression task, the handset 100 determines a device for performing the video compression task according to the locally stored device service capability information (i.e., table 3). Referring to table 3, in the present embodiment, the electronic device with video compression capability includes the mobile phone 100, the smart screen 210 and the notebook computer 240, so that the mobile phone 100 determines the above three devices as devices for performing video compression task. That is, in the present embodiment, the computing devices for performing video compression are the mobile phone 100, the smart screen 210, and the notebook computer 240.
S230: the handset 100 determines the task data volume of the video compression task.
After receiving the video compression task, the mobile phone 100 determines the task data volume of the video compression task according to the file information of the video file. The file information of the video file includes: the duration of the video file, the resolution of the video file (3840 × 2160), the frame rate of the video file, the number of channels of the video file (R, G, B three channels), etc. The mobile phone 100 can determine that the task data amount Q of the video file is 234MB, i.e., duration × resolution × frame rate × channel number, according to the file information of the video file. In other embodiments, the handset 100 determines the amount of task data Q based on the storage space occupied by the video file. For example, when the memory space occupied by the video file is 234MB, the mobile phone may determine that the task data amount Q is 234 MB.
The cell phone 100 further determines the resulting data size of the video compression task based on the task setting of the video compression task. In this embodiment, according to the task setting of the video compression task (refer to fig. 1), the target resolution of the video file is 720p (i.e., 1280 × 720), and therefore, the mobile phone 100 determines that the compression rate s of the video compression task is 9 for the original resolution/target resolution, and that the resultant data amount of the video compression task is 26MB for the task data amount Q/compression rate s.
S240: the handset 100 obtains device state information for each computing device. The status information of the computing device includes resource status information and communication rate information of the computing device, which are described separately below.
(1) Resource state information of a computing device.
The resource state information of the computing device is used to determine the computing power c of the computing device. Wherein the resources of the computing device include one or more computing resources that affect the computing power of the computing device. On this basis, since the performance of the CPU is directly related to the computing capability of the computing device, in this embodiment, the resource of the computing device is the CPU of the computing device, and the resource state information of the computing device is the current utilization rate of the CPU. However, the present application is not limited thereto, and in other embodiments, the resource of the computing device may be other options of computing resources, such as a CPU, a GPU, an NPU, and/or an SoC chip (e.g., Kirin 9000 chip, APPLE a14 chip) of the computing device, and so on.
(2) Communication rate information of the device is calculated.
The communication rate information is used to determine a network communication rate of the computing device during network communication. In this embodiment, the communication rate information of the computing device is a network communication rate of the computing device in a historical communication process. Specifically, the electronic device in the home lan periodically records (for example, records once every 0.5 hour) the data uplink rate and the data downlink rate (hereinafter referred to as "data uplink/downlink rate") of the electronic device during the network communication process, and the communication rate information of the computing device is the data uplink/downlink rate newly recorded by the computing device; in other embodiments, the communication rate information of the computing device is the data uplink/downlink rate recorded by the computing device for a last period of time (e.g., the last 1 day).
In addition, in the present embodiment, the communication rate information of the computing apparatus is communication rate information of the computing apparatus in the history communication period. However, the present application is not limited to this, and in other embodiments, the communication rate information of the computing device may be a theoretical communication rate of the computing device, where the theoretical communication rate is a communication rate determined according to a communication protocol standard, for example, according to the communication protocol standard ieee802.11a, the theoretical communication rate of the WiFi communication mode is 54 Mbps; according to the communication protocol standard of IEEE802.11b, the theoretical communication rate of the WiFi communication mode is 11 Mbps.
The network communication mode is not limited in this embodiment, and the network communication mode may be a WiFi communication mode, a WiFi P2P communication mode, a bluetooth communication mode, an NFC communication mode, and/or a cellular communication mode. In some examples, the network communication rate may be the sum of the communication rates of one or more of the above communication manners, for example, if the mobile phone 100 communicates with other devices in the home lan via the WiFi P2P communication manner and the bluetooth communication manner at the same time, assuming that the communication rate of the WiFi P2P communication manner is 500Kbps, and the communication rate of the bluetooth communication manner is 100Kbps, the communication rate of the mobile phone 100 is 600 Kbps. In other examples, the communication rate may be a communication rate of a particular communication means of the computing device. For example, since the WiFi communication scheme is a common scheme for the computing device to access the home lan (as shown in fig. 4), the communication rate of the computing device is the communication rate of the WiFi communication scheme.
Upon determining cell phone 100, smart screen 210 and laptop 240 as computing devices for performing video compression tasksThe mobile phone 100 sends a status information query request to the smart screen 210 and the notebook computer 240 to obtain the device status information of the smart screen 210 and the notebook computer 240; meanwhile, the mobile phone 100 accesses its own operating system, system application (e.g., system setup application), user application (e.g., mobile phone housekeeping) TM ) And/or device storage of the handset 100 to obtain device state information of itself.
Table 3 lists the device status information of each computing device provided by the present embodiment, wherein A1, A2, A3 are each a number between 0 and 100.
TABLE 3 device status information for computing devices
Figure BDA0002912310880000141
S250: the handset 100 determines task execution rate information for the computing device, including computing power and network communication rate of the computing device, as described separately below.
(1) Computing the computing power c of the device.
In this embodiment, the computing power c of the computing device is the theoretical available computing power thereof, where the theoretical available computing power of the computing device is the theoretical peak computing power x of the computing device (1-the usage rate of the CPU).
When there are multiple CPUs in a computing device, the theoretical peak computing power of the computing device is the sum of the theoretical peak computing powers of the CPUs. For example, the smart screen 210 includes 4 CPUs (2 a73 big cores and 2 a53 small cores), and then the theoretical peak computational power of the smart screen 210 is the sum of the theoretical peak computational powers of the 4 CPUs. The theoretical peak computing power of each CPU is the main frequency of the CPU multiplied by the number of times that the CPU executes the floating-point operation in each clock cycle, wherein the main frequency of the CPU and the number of times that the CPU executes the floating-point operation in each clock cycle are determined according to the type of the CPU.
In other embodiments, the computing power c of the computing device may also be determined according to other methods. For example, in another embodiment, the computing device's calculated force c is its theoretical peak calculated force; in another embodiment, the computing power of the computing device is its actual available computing power (the determination of the actual available computing power will be described in embodiment two).
(2) The network communication rate v of the device is calculated.
In this embodiment, the network communication rate of the computing device is an average value of the data uplink rate and the data downlink rate of the computing device. Taking the smart screen 210 as an example, referring to table 3, the network communication rate of the smart screen 210 is (85Kbps +45Kbps)/2 is 65 Kbps.
In other embodiments, the network communication rate of the computing device may also be determined according to other methods. For example, in another embodiment, the lesser of the data upstream rate and the data downstream rate is determined as the network communication rate of the computing device.
In other embodiments, when the communication rate information is the data uplink/downlink rate recorded by the computing device in the last period of time (i.e. the communication rate information includes multiple sets of data uplink/downlink rates), the handset 100 determines the network communication rate v of the computing device according to an average value of the multiple sets of data uplink/downlink rates.
S260: the handset 100 determines the distribution strategy for the video compression task.
Since the number of computing devices is 3, the cell phone 100 divides the video file into 3 shares. Suppose that the amount of data for video slice i distributed to the ith computing device is Q i Then, the ith computing device is configured to complete the ith subtask at the time of
Figure BDA0002912310880000151
Wherein, c i Computing power, v, for the i-th computing device i For the network communication rate of i computing devices, i is 1, 2, 3. k is a ratio between an operation amount of the video compression task and a task data amount of the video compression task, and in the embodiment, k is 1; s is the compression ratio, and in this embodiment, s is 9.
In this embodiment, the mobile phone 100 is a computing device 1, the smart screen 210 is a computing device 2, and the notebook computer 240 is a computing device 3. As can be appreciated, the first and second,
Figure BDA0002912310880000152
indicating the length of time that the ith computing device compressed the ith video slice,
Figure BDA0002912310880000153
the network transmission duration of the slice data (including task data and result data) representing the ith video slice in the distributed computing network.
The video file is distributed according to the principle that the longest time is shortest. That is, in the present embodiment, the video distribution problem can be regarded as one to { Q } 1 ,Q 2 ,Q 3 Is the optimization problem of the arguments, which is such that the objective function f (q) has a minimum value, wherein,
Figure BDA0002912310880000154
it will be appreciated that the constraints of the optimization problem include: q 1 +Q 2 +Q 3 Q, where Q is the data size of the original video file.
Solving the optimization problem to obtain the optimal solution of the problem as follows:
Figure BDA0002912310880000155
the computing power and the network communication rate of each computing device are substituted into formula (2), and the data quantity Q of each video fragment can be obtained through calculation i . In this embodiment, the data amount Q of video slice 1 1 82MB, data size Q of video slice 2 2 58.5MB, data size Q of video slice 3 3 =93.5MB。
In addition, in this embodiment, the optimization problem of video distribution has an accurate solution (reference formula (2)), so that iteration is not required in the solving process, the solving difficulty can be reduced, and the solving efficiency can be improved.
S270: the mobile phone 100 segments the video file according to the video compression task distribution strategy.
In this embodiment, the handThe machine 100 divides the video file according to the storage address of each video fragment in the mobile phone 100. Assume that the original video file occupies a continuous storage space in the memory of the mobile phone 100, and the addresses corresponding to the storage space are 0 to (D-1). The data amount Q of each video clip of the mobile phone 100 i And determining an address range corresponding to each video fragment, and dividing data in the address range into corresponding video fragments to finish the division of the video file. Specifically, the mobile phone 100 divides data having an address range of 0 to (0.35D-1) into video slices 1, divides data having an address range of 0.35D to (0.6D-1) into video slices 2, and divides data having an address range of 0.6D to (D-1) into video slices 3.
In addition, the mobile phone 100 adds a task identifier and a file identifier to each video segment. The task identifier is used for identifying the video compression task, and it can be understood that each video fragment belongs to the same task, so that each video fragment has the same task identifier. The form of the task identifier is not limited in this embodiment, and the task identifier may be a letter, a number, a symbol, or a combination thereof. In this embodiment, CV _010 is used as the task identifier of the video compression task.
The file identifier is used to identify different video segments, and in this embodiment, the file identifier is a timestamp of a first frame video of the video segments. The video time length corresponding to the video fragment i and the data volume Q of the video fragment i i Is proportional, and therefore, the amount of data Q according to each video slice i A timestamp may be determined for each video slice first frame video. Specifically, the file identifier of video segment 1 is 00: 00; identification of video file 2 is 21: 00; file identification of video segment 3 is 36: 00. for example, in another embodiment, the files of video segment 1-video segment 3 are identified as section1, section2, and section3, as long as the respective video segments can be distinguished.
In this embodiment, the task identifiers and the file identifiers are added to the video segments, so that when multiple distributed computing tasks are concurrently executed on the computing device (that is, when the computing device executes the distributed computing tasks from multiple devices at the same time), the subsequent identification and summarization of the result files are facilitated. However, the present application is not limited thereto, and in other embodiments, no task identifier or file identifier may be added to the video segment.
S280: cell phone 100 distributes video segments to computing devices.
Specifically, the mobile phone 100 distributes the video segment 1 (as task data of the subtask 1) to itself, the video segment 2 (as task data of the subtask 2) to the smart screen 210, and the video segment 3 (as task data of the subtask 3) to the notebook computer 240. The mobile phone 100 distributes the video segments to each computing device, and includes the task identifier and the file identifier of each video segment.
In this embodiment, the mobile phone 100 distributes the video clips to the smart screen 210 and the notebook computer 240 through the communication method (i.e., the WiFi communication method) shown in fig. 4, but the application is not limited thereto. In other embodiments, the mobile phone 100 may distribute the video clips to the smart screen 210 and the notebook computer 240 through other means (e.g., bluetooth communication means, wired communication means).
S290: each computing device compresses the received video slices.
Each computing device compresses the received video fragments through the video compression function of the computing device. The computing device may compress the video slices through video compression functionality provided by the operating system, for example, when the computing device is installed with a hongmeng operating system, the video slices may be compressed through an atomic capability of video transcoding (AA) provided by the hongmeng system. The computing device may also compress the video slices via video compression functionality provided by the application programs (including system applications and/or third party applications).
Referring to fig. 7, the result summarization stage S300 includes:
s310: each computing device returns the compressed video segments to the handset 100.
Specifically, the smart screen 210 adds the task identifier CV _010 and the file identifier 21 to the compressed video slice 2: after 00, returning the video fragment 2 to the mobile phone 100; the notebook computer 240 adds the task identifier CV _010 and the file identifier 36 to the compressed video slice 3:00, returning the video fragment 3 to the mobile phone 100. In this embodiment, the smart screen 210 and the notebook computer 240 return the compressed video file to the mobile phone 100 through a WiFi communication mode (i.e., a communication channel during distribution of the subtasks).
S320: the handset 100 synthesizes the compressed video file.
After the mobile phone 100 completes compression of the video segment 1, the compressed video segment 2, and the compressed video segment 3 are sequentially combined according to the file identifier of each video segment (for example, the video segments are sequentially stored in a continuous memory space) to synthesize a compressed video file.
After the handset 100 completes the composition of the video file, the handset 100 displays the interface shown in fig. 1 (c). After clicking 'upload video', the user can upload the compressed video file to a short video application platform so as to publish video content to the public.
It was tested that in this example, the time taken for compressing the video file by the video editing application B is 22s, which is significantly lower than the time taken for compressing in the prior art, 33.77s (see table 1). That is, in this embodiment, the mobile phone 100 completes compression of the video file together by means of the computing power of the smart screen 210 and the notebook computer 240, so as to significantly reduce the execution time of the video compression task, reduce the waiting time of the user, and improve the user experience.
The above is an exemplary description of the embodiments of the present application, and those skilled in the art may make other modifications based on the description.
For example, in another embodiment, since the mobile phone 100 distributes the video segment 1 to itself, the network transmission time of the video segment 1 is 0. Therefore, in this embodiment, it can be considered that
Figure BDA0002912310880000171
That is, in this embodiment, the duration of time that the mobile phone 100 is used to complete its corresponding subtask is
Figure BDA0002912310880000172
Wherein, T 1 As T B ,Q 1 As Q B ,c 1 As c is B
For example, in another embodiment, in order to guarantee the usage requirement of the computing device memory for the computing device local task (e.g., a task generated by a computing device local application), in step S260, the remaining memory capacity of the computing device is also considered, wherein the remaining memory capacity of the computing device is the memory capacity of the computing device that is not occupied before the computing device receives the video slice. Specifically, in the optimization problem of video distribution, a memory constraint condition is added, so that when the computing device compresses video fragments, the memory capacity occupied by the video compression task does not exceed the residual memory capacity of the computing device.
Illustratively, the memory constraint is k.Q i ≤E i Wherein k and Q i Please refer to the description in step S260, E i The remaining memory capacity of the i-th computing device. The remaining memory capacity of the computing device may be obtained by querying the computing device, for example, in step S240, when querying the device status information of the computing device, the remaining memory capacity of the computing device is queried at the same time.
For another example, in another embodiment, in the device status information obtaining step (i.e., in step S240), the mobile phone 100 first queries whether there is available device status information in the local cache, and if so, the mobile phone 100 determines task execution rate information of the computing device according to the locally stored device status information (i.e., performs step S250); if not, the handset 100 queries each computing device for its device status information (i.e., performs step S240). The embodiment is beneficial to simplifying the communication process between the devices and improving the execution efficiency of the distributed computing task. Fig. 8 shows the method for acquiring device status information of a computing device according to this embodiment, which specifically includes the following steps:
s241: the handset 100 queries the local cache for device state information for the computing device.
The cell phone 100, in response to receiving the video compression task, queries the local cache of the cell phone 100 for device state information for the computing devices (i.e., the cell phone 100, the smart screen 210, and the laptop 240). If so, the handset 100 executes step S242 to further determine whether the device status information is available; if not, the handset 100 executes step S244 to query the computing device for its device status information.
S242: the mobile phone 100 determines whether the cache duration of the device status information exceeds a set duration threshold.
The mobile phone 100 determines whether the cache duration exceeds the set duration threshold according to the acquisition time of the device status information. For example, the mobile phone 100 may determine the cache duration of the device status information by calculating the difference between the current system time and the acquisition time of the device status information.
When the caching duration of the device status information exceeds the set threshold, the device status information is considered to not reflect the current status of the computing device (i.e., the device status information is unavailable), and the mobile phone 100 executes step S244 to query the computing device for the device status information thereof; when the cache duration of the device status information does not exceed the set threshold, the mobile phone 100 regards the device status information as available information, and the mobile phone 100 executes step S243.
In this embodiment, the time length threshold is preset in the mobile phone 100. In this embodiment, the value of the time length threshold is not limited, and the time length threshold may be 1 minute, 15 minutes, 1 hour, or the like. In one example, to avoid the handset 100 from frequently querying the computing device for its device status information, the example sets the duration threshold to a small value (e.g., 1 minute) in view of the fact that the user may repeat the video compression operation multiple times in a short period of time (e.g., the user needs to make multiple clip modifications to the video file).
In some implementations, when the device state information cached in the cell phone 100 exceeds a set duration threshold, the cell phone 100 deletes the device state information from the local cache. This makes the device status information stored in the mobile phone 100 available, and thus step S242 may be omitted.
S243: the handset 100 determines status information of the computing device.
When the device state information cached in the cell phone 100 is available information, the cell phone 100 determines the locally cached device state information as the device state information of the computing device.
S244: the handset 100 queries the computing device for its status information to obtain device status information for the computing device.
The mobile phone 100 sends a status information query request to the smart screen 210 and the notebook computer 240 to obtain the device status information of the smart screen 210 and the notebook computer 240; meanwhile, the mobile phone 100 accesses its own operating system, system application (e.g., system setup application), user application (e.g., mobile phone housekeeping) TM ) And/or device storage of the handset 100 to obtain device state information of itself.
S245: the handset 100 writes the queried device state information in a local cache.
The handset 100 caches the device state information queried in step S244 locally on the handset 100 for the next query.
[ example two ]
The present embodiment provides another processing method for video compression task based on the first embodiment. The core difference between this embodiment and the first embodiment is: in one embodiment, the calculated force c of the computing device (e.g., calculated force c in equations (1) and (2)) is the theoretical available calculated force of the computing device; in this embodiment, the calculated power c of the computing device is the actual available calculated power of the computing device.
In the first embodiment, the computing power c of the computing device is a theoretical computing power determined by the CPU of the computing device. In practice, however, the factors that affect the computing power c of the computing device are various, such as the GPU, NPU, power, type of computing device, etc. of the computing device. In order to consider the influence of various factors, the embodiment provides a method for determining the actual available computing power of the computing device, and the method provided by the embodiment can be used for calculating the actual available computing power of electronic devices of different forms. Moreover, the method provided by the embodiment can reflect the current available computing power of the computing device more truly, so that when the computing task is distributed based on the computing power provided by the embodiment, the influence on the normal use of the computing device can be reduced, for example, the influence on the local application running on the computing device is reduced.
Referring to fig. 9c, the method for processing a video compression task provided by this embodiment includes:
s410: the handset 100 discovers online devices in the home lan 200.
S420: the online device in the home lan 200 registers its own service capability information with the cellular phone 100.
S430: the handset 100 receives the video compression task.
S440: the handset 100 screens computing devices for performing video compression tasks.
S450: the handset 100 determines the task data volume of the video compression task.
Steps S410 to S450 are substantially the same as steps S110, S120, S210, S220, and S230 in the first embodiment, and therefore, specific contents of steps S410 to S450 may refer to descriptions in steps S110, S120, S210, S220, and S230 in the first embodiment, and are not repeated herein.
S460: device state information of a computing device is obtained.
The device state information of the computing device includes computing device resource state information and communication rate information. The meaning of the communication rate information is the same as that described in step S240 of the embodiment, and therefore, the description is omitted. The meaning of the resource status information in the present embodiment is described below.
The resource status information of the computing device includes the current usage rate of each computing resource in the computing resource group G1 of the computing device and the expected usage rate of each computing resource in the computing resource group G2 of the computing device, which are respectively described below.
(1) The current usage of each computing resource in the computing resource group G1 of the computing device Q1. The computing power resource group G1 of the electronic device includes one or more computing power resources of the electronic device, and for convenience of description, the usage rate of each computing power resource in the computing power resource group G1 is hereinafter referred to as "usage rate of the computing power resource group G1".
In this embodiment, the computing resources of the electronic device may be hardware resources of the electronic device, and may also be software resources of the electronic device. The hardware resources of the electronic device may include one or more of the following:
a processor: the processor may be a CPU, a GPU and/or an NPU of the electronic device, and the processor may also be an SoC chip of the electronic device, for example, a huamei Kirin 9000 chip;
a memory: the memory may be a memory of the electronic device, a device storage of the electronic device, or the like;
a battery: for some electronic devices, when the battery capacity is lower than a set threshold (e.g., 30%), the CPU may operate down, and therefore, the usage rate of the battery may also affect the computing power of the electronic device;
whether the electronic equipment is in power-on operation or not is judged, and when the electronic equipment is in power-on operation, the electronic equipment is powered by an external power supply;
a communication module: the communication module can be a WiFi communication module, a Bluetooth communication module, an NFC communication module, a 4G/5G communication module and the like;
the device type (also called device form) may be a mobile phone 100, a smart screen 210, a car machine, a tablet, a smart watch, etc. The devices in the same form have different application emphasis points, and the scheduling mode of the operating system to each hardware in the device, the resources occupied by the operating system during running and the like are also different. Therefore, the device type may affect the computing power of the electronic device to some extent.
The software resources of the electronic device may be one or more of: the number of applications installed by the electronic device; the number of processes supported by the electronic device; the type of task the electronic device is running (e.g., whether to run a display task, whether to run a computing task), etc.
Table 4 illustrates an example of the current usage of the resource group G1, using the smart screen 210 as an example. In table 4, the first column is the calculation resource option included in the calculation resource group G1, the second column is the current usage of each calculation resource, and the third column is the current usage of each calculation resource.
Wherein, for the 'number of applications' option, the current usage rate Q 11 Is asPre usage (10 in table 4)/total installed application; for the option of 'whether or not to display the task', when the task is displayed, the current utilization rate Q 13 100%, when no task is displayed, the current usage rate Q 13 0 percent; for the "computing task existence" option, when there is a computing task (e.g., AI computing task, codec task, and/or graphics computing task), the current utilization rate Q 14 100%, when there is no calculation task, the current utilization rate Q 14 0 percent; for the "Battery" option, if there is no battery in the electronic device, the current usage Q 15 100%, if a battery is provided in the electronic device, the current usage rate Q 15 Current usage/battery capacity; for the "memory" option, the current usage rate Q 17 Current usage (1 GB in table 2)/memory capacity; for the option of 'whether NPU is used', when NPU is used, the current utilization rate Q 19 100%, when NPU is not used, current usage Q 19 0 percent; for the option of 'whether power is plugged in' or not, when power is plugged in, the current utilization rate Q 110 100%, when no power is inserted, the current utilization rate Q 110 =0%。
TABLE 4 Current utilization of computing resources group G1 for Smart Screen 210
Figure BDA0002912310880000191
Figure BDA0002912310880000201
It should be noted that table 4 is an exemplary illustration of the current utilization rate of the computing resource group G1, and those skilled in the art can make other adjustments based on this. For example, add computing resources option in computing resources group G1 (e.g., add "communication module" option), reduce computing resources option in computing resources group G1 (e.g., reduce "if there is computing task option"), replace computing resources option in computing resources group G1 (e.g., replace "number of applications" option with "number of processes" option), and replace "current usage" of part or all of computing resources option (e.g., memory) with "current remaining amount" of computing resources, etc.
In addition, the mobile phone 100 may directly obtain the "current usage" information in the third column of table 2 from the computing device, or may obtain the "current usage" information in the second column of table 2 from the computing device, and then the mobile phone 100 determines the current usage of the computing resource group G1 of the computing device according to the computing resource configuration information (for example, the total amount of applications installed in the computing device, the memory capacity, and the like) of the computing device stored by itself.
After acquiring the current utilization rates of the computing resources in the computing resource group G1 of the computing device, the mobile phone 100 obtains the current utilization rates Q of the computing resources 1i And combining to obtain the current utilization rate Q1 of the computing power resource group G1. For example, referring to table 4, the current usage Q1 ═ Q of the computing power resource group G1 of the smart screen 210 11 ,Q 12 ,…,Q 110 }={0.2,0.5,1,1,1,0.2,0.25,0.4,1,1}。
(2) The expected usage rate Z of each computing resource in the computing resource group G2 of the computing device.
The computing power resource group G2 of the electronic device includes one or more computing power resources of the electronic device, and the items of the computing power resources included in the computing power resource group G2 may be the same as the items of the computing power resources included in the computing power resource group G1 or may be different from the items of the computing power resources included in the computing power resource group G1. Since the current usage of computing resources is data that can be collected once and the expected usage of computing resources is data that is statistically collected over multiple collections, in some examples, the number of computing resource items in the computing resource group G1 is greater than the number of computing resource items in the computing resource group G2. For convenience of description, the usage rates of the computing power resources in the computing power resource group G2 are simply referred to as "usage rate of the computing power resource group G2" hereinafter.
Table 5 illustrates an example of expected usage Z of resource group G2 using smart screen 210. As seen from table 5, the resource group G2 provided in this embodiment includes "CPU", "GPU", "memory", "NPU", "battery level", and "network bandwidth", but the application is not limited thereto. In other embodiments, the computing resource group G2 may have more or less computing resource items than listed in table 4 or table 5.
TABLE 5 expected utilization Z of resource G2 for smart screen 210
Computing resource options CPU GPU Memory device Electric quantity of battery NPU Network bandwidth
Expected rate of use Z 59.2% 28.3% 37.7% 62.5% 12.4% 47.3%
In this embodiment, the expected usage rate Z of the computing resource is used to represent the usage rate of the computing resource expected to occur in the current time period. In this embodiment, the expected usage rate Z of the computing resource is obtained according to statistics of actual usage rates of the computing resource in M historical usage periods, where M is a positive integer.
Specifically, assume that the usage rate of computing resources in the ith historical usage period is Z i Wherein i is a positive integer between 1 and N, then the expected utilization rate Z of the computing resources is the utilization rate Z of the computing resources in each historical utilization period i Is calculated as the weighted average of (a). In particular, the expected usage of computing resources
Figure BDA0002912310880000211
Wherein, K i As a usage rate Z i Weight of, and K i ≤K i+1 . That is to say, the more recent historical usage period, the more the calculation resource usage rate has a heavier weight, which means that the present embodiment focuses more on the calculation resource usage rate of the historical usage period close to the current time, which is beneficial to improving the accuracy of the expected usage rate Z. On the basis, the embodiment pairs the weight value K i The determination method of (a) is not limited, and in one example, K may be set to 10 when M ═ 10 1 ~K 5 Respectively, 0.05, and K 6 ~K 10 Each was determined to be 0.15. In some examples of the method of the present invention,
Figure BDA0002912310880000212
that is, each usage rate Z i The sum of the weights of (a) is 1.
In some implementations, the duration of each historical usage period is W days, W being a positive integer. Usage rate Z of computing resources in ith historical usage period i Is a set { Z i,1 ,Z i,2 ,…,Z i,j ,…,Z i,W Maximum of each element in (b) }, wherein Z i,j And j is the utilization rate of the computational power resource in the j day of the ith historical use period, and is a positive integer between 1 and W. Equivalently, for each historical usage period, its computational resource usage rate Z i The maximum value of the computing power resource utilization rate of each day in the period.
The work and life of the user are usually one weekAnd one cycle is adopted, so that the actual use state of the electronic equipment can be reflected by taking one cycle as a historical use period. For this reason, in the present embodiment, the duration of each history use period is set to one week, i.e., W is 7. However, the present application is not limited thereto, and in other embodiments, the duration of each historical usage period may be 3 days, 10 days, a month, and other values. Additionally, in other implementations, the usage rate Z for each historical usage period i The usage rate may be an average of the usage rates of the respective days in the period, or the usage rate of a date (for example, day 1) specified for the period, or the like.
In some implementations, Z i,j The utilization rate of the computing resources in a specific time period of the jth day of the ith historical usage cycle is the time period to which the current time (e.g., the time at which the computing task is received by the cell phone 100) belongs. Because the habits of users in using electronic devices are different in different periods of the day, for example, during the working hours in the morning, the probability that the users are using the electronic devices is low; at rest time, the probability of the user using the electronic device is high. Therefore, the expected utilization rate of the computing resources is determined according to the utilization rate of the computing resources in the period of the current time, and the accuracy is high.
Since the execution time of the calculation task is usually about 1 hour, in the embodiment, the time of the specific period is 1 hour, so as to more accurately reflect the expected usage rate of the computational resources during the execution of the calculation task. For example, when the current time is 22:13, the specific time period corresponding to the current time is 22: 00-23: 00. The application is not so limited and in other embodiments the duration of a particular period may be other values such as 0.5 hours, 1.5 hours, 2 hours, etc. Additionally, in other implementations, the usage rate Z for the jth day of the ith historical usage cycle i,j Or the usage rate at any time (or moment) of the day.
S470: the mobile phone 100 determines task execution rate information of the computing device, where the task execution rate information of the computing device includes computing power c of the computing device and a network communication rate v, and a determination method of the network communication rate v is the same as that described in step S250 of the embodiment, and therefore, description thereof is omitted. The following describes a method of determining the computational power c of the computing apparatus in this embodiment.
Referring to fig. 9b, the calculation power c of the computing device provided by the present embodiment is the actual available calculation power of the computing device, and the determining method further includes the following exemplary steps:
s471: determining a peak computing force C of a computing device max
The peak computing power of the electronic device is used to characterize the maximum computing power of the electronic device. In this embodiment, the peak calculation power of the computing device is the theoretical peak calculation power of the computing device, and the calculation method may refer to the description in step S250, which is not described again.
S472: a current usage of a set of computing power resources G1 of the computing device Q1 is determined.
Specifically, the cell phone 100 determines the current usage rate of the resource calculation group G1 (i.e., the data in the column 3 in table 4) acquired in step S460 as the current usage rate Q1 of the resource calculation group G1.
S473: an expected idle rate Q2 for a computing device's computing resource group G2 is determined.
After obtaining the expected usage rates (i.e., the data in table 5) of the computing resource group G2 of the computing device through step S460, the cell phone 100 subtracts the expected usage rates of each computing resource from 1, so as to obtain the expected idle rate Q2 of the computing resource group G2. Table 6 lists one example of the expected idle rate Q2 for computing resource group G2 for smart screen 210.
TABLE 6 expected idle Q2 for resource group G2 of smart screen 210
CPU GPU Memory device NPU Electric quantity of battery Network bandwidth
Expected rate of use Z 59.2% 28.3% 37.7% 62.5% 12.4% 47.3%
Expected idle rate Q2 ═ (1-Z) 40.8% 71.7% 62.3% 37.5% 87.6% 52.7%
S474: calculating the peak force C of the computing device max The current utilization rate Q1 of the computing power resource group G1 and the expected idle rate Q2 of the computing power resource group G2 input the computing model M _ c (as a first computing power computing model), run the computing model M _ c and compute the actual available computing power of the equipment.
The computational model M _ C is a pre-trained machine learning model (e.g., XGBoost model) with input features of x ═ C max ,Q1,Q2},C max For peak computing power of a computing device, Q1 is the current usage of the computing power resource group G1 of the computing device, and Q2 is the computing power resource group of the computing deviceExpected idle rate of G2; the output of which is the actual available computing power of the computing device.
The peak calculation force C of the calculation device is obtained in step S471 max After obtaining the current usage rate Q1 of the computing device 'S computing power resource group G1 through step S472 and obtaining the expected idle rate Q2 of the computing device' S computing power resource group G2 through step S473, the cell phone 100 will peak computing power C max The current utilization rate Q1 and the expected idle rate Q2 are combined to obtain an input characteristic x ═ C max Q1, Q2 }. Then, the mobile phone 100 sets the input feature x to { C ═ C max And Q1 and Q2 are input into the calculation model M _ c, and the calculation model M _ c is operated, so that the available calculation power of the calculation equipment can be obtained.
The training method of the calculation model M _ c is described below. In the training phase of the computation model M _ c, first, sample data (x) for training the computation model M _ c is acquired c ,y c ) And then, adjusting the weight coefficient in the calculation model M _ c according to the training sample data to finally obtain the calculation model M _ c with certain prediction accuracy. The process of adjusting the weight coefficients of the computation model M _ c according to the training sample data may refer to the description of the training method of the machine learning model (for example, the training method of the XGBoost model) in the prior art, and the following description focuses on the method for acquiring the training sample data.
The training sample data of the computational model M _ C comprises the peak computational power C of the sample computational device max C, the current utilization of the sample computing device resource group G1Q 1_ c, and the expected idle rate of the sample computing device resource group G2Q 2_ c. The device type and the number of the sample computing devices are not limited in this embodiment, but it can be understood that the richer the types of the sample computing devices are, the greater the number of the sample computing devices is, the more the prediction accuracy of the computing model M _ c is improved.
Training sample data (x) of the computational model M _ c c ,y c ) Input feature x in c ={C max C, Q1_ C, Q2_ C }, wherein C max C is the peak computing power of the sample computing device, Q1_ c is the current usage of the computing power resource group G1 of the sample computing device, and Q2_ c is the computing power resource group of the sample computing deviceExpected idle rate of source group G2. Training sample data (x) c ,y c ) Label y in (1) c The available computing power of the device (units: Flop/s) is calculated for the sample.
FIG. 9c shows training sample data (x) provided by the present embodiment c ,y c ) The method of (1). This example does not limit the main implementation of the method shown in fig. 9 c. The main body of the method shown in fig. 9c may be a device in the home lan 200, or a device outside the home lan 200; it may be a PC or a server.
Specifically, referring to fig. 9c, training sample data (x) of the model M _ c is calculated c ,y c ) The determination method comprises the following steps:
s610: determining a peak computing force C of a sample computing device max C, peak calculated force C max Method for determining C and calculating peak calculation force C of device in step S471 above max The determining methods in step S471 are substantially the same, and thus, reference may be made to the description in step S471, which is not repeated.
S620: a current usage Q1_ c of a set of computing power resources G1 for the sample computing device is determined. When the sample computing device is operated in a certain state (the state is referred to as a "state P2"), the utilization rates of various computing resources in the computing resource group G1 of the sample computing device are collected in real time, and the collected utilization rates are used as the current utilization rate Q1_ c of the computing resource group G1 of the sample computing device.
S630: an expected idle rate Q2_ c for a set of computing power resources G2 for a sample computing device is determined. The expected idle rate Q2_ c of the resource group of computing G2 is used to reflect the expected idle state of the sample computing device. In some examples, the expected idle rate Q2_ c for the set of computing power resources G2 is determined empirically; in other examples, the expected utilization rate Z _ c of the resource group G2 of the sample computing device is first determined according to the method shown in step S460 above, and then the expected utilization rate Z _ c is subtracted from 1 to obtain the expected idle rate Q2_ c of the resource group G2 of the sample computing device (i.e., the method shown in table 6); in other examples, the expected idle rate Q2_ c for the set of computing resources G2 may be determined randomly within a certain range. For example, in the range of 0-40%, the expected idle rate Q2_ c of each computing resource in the sample computing device computing resource group G2 is determined. Illustratively, the expected idle rate Q2_ c of the resource group G2 of the computing power of the sample computing device is {0.32, 0.28, 0.33, 0.39, 0.33, 0.42 }.
S640: an available computing power C _ C of the sample computing device is determined.
Keeping the sample computing device working at the state P2, then deploying the test task T _ c with the operand Q _ c (unit: Flop) on the sample computing device, and recording the time length T for the sample computing device to complete the test task T _ c c (unit: s).
And in the process that the sample computing equipment completes the test task T _ c, acquiring the utilization rate of each computing resource in the computing resource group G2 of the sample computing equipment in real time. If the utilization rate of each computing power resource in the computing power resource group G2 does not exceed the expected idle rate Q2_ C of the computing power resource determined in step S630, it indicates that the test task Tc is successfully deployed (table 7 gives an example of successful deployment of the test task Tc), and at this time, the available computing power of the sample computing device is determined to be C _ C — Q _ C/t c (ii) a Otherwise, adjusting the test task deployed on the sample computing device until the test task is successfully deployed.
TABLE 7 example of successful deployment of test task T _ c
Figure BDA0002912310880000231
S650: determining training sample data (x) c ,y c ) Wherein x is c ={C max _c,Q1_c,Q2_c},y c =C_c。
Steps S610-S650 describe one set of training sample data (x) c ,y c ) According to the method shown in steps S251 to S255, multiple sets of training sample data can be obtained by replacing the sample computing device, adjusting the current usage rate Q1_ c of the computing resource group G1 in the sample computing device, and/or adjusting the expected idle rate Q2_ c of the computing resource group G2 in the sample computing device. During the training of the computational model M _ c, each sample computing device is available to obtainA plurality of training sample data are taken. In particular, multiple sets of training sample data may be obtained by the sample computing device by adjusting the operating states of the sample computing device (i.e., adjusting the current utilization Q1_ c of the resource set of computing power G1 of the sample computing device), and/or adjusting the expected idle rate Q2_ c of the resource set of computing power G2 of the sample computing device.
The method for determining the actual available computing power of the computing device provided by the embodiment is described above. It should be noted that the present embodiment is an exemplary illustration of the technical solution of the present application, and those skilled in the art may make other modifications on the basis of the present embodiment.
For example, since the usage rate of each computing resource and the idle rate of the computing resource have a unique correspondence relationship (i.e., the usage rate of each computing resource and the idle rate of the computing resource are added to be equal to 1), in some embodiments, the usage rate of the computing resource may be adjusted to the idle rate in the input features of the computing model M _ c; or adjust the idle rate of the computing resources to the usage rate. For example, the current utilization rate of part or all of the computing resources in the computing resource group G1 is adjusted to the current idle rate of the part of the computing resources, and/or the expected idle rate of part or all of the computing resources in the computing resource group G2 is adjusted to the expected utilization rate of the part of the computing resources. It should be noted that the current usage rate, the current idle rate, the expected usage rate, and the expected idle rate of the above computing resources all belong to the usage rate information of the computing resources.
S480: the handset 100 determines the distribution strategy for the video compression task. The mobile phone 100 substitutes the actual available computational power of the computing device determined in step S470 as the computational power of the computing device in equations (1) and (2) to calculate the data amount of each video clip. Other details in step S480 are substantially the same as those in step S260 in the first embodiment, so that reference may be made to the description of the first embodiment, and further description is omitted.
S490: the mobile phone 100 segments the video file according to the video compression task distribution strategy.
S500: cell phone 100 distributes video segments to computing devices.
S510: each computing device compresses the received video slices.
S520: each computing device returns the compressed video segments to the handset 100.
S530: the handset 100 synthesizes the compressed video file.
Steps S490 to S5300 are substantially the same as steps S270, S280, S290, S310, and S320 in the first embodiment, and therefore, specific contents of steps S410 to S450 may refer to descriptions in steps S270, S280, S290, S310, and S320 in the first embodiment, and are not repeated herein.
In the above embodiments of the present application, the number of each step is not intended to limit the order of execution of each step. The skilled person can adjust the order of the steps, for example, the order of steps S471, S472, and S473, to meet the purpose of the invention.
An electronic device 300 provided according to an embodiment of the present application is described below with reference to fig. 10. Referring to fig. 10, an embodiment of the present application provides an electronic device 300, where the electronic device 300 includes an application module M100, a service discovery and registration module M200, and a distributed task scheduling module M300.
Where application module M100 includes one or more applications (e.g., short video applications, video editing programs, etc.) of electronic device 300, application module M100 may be used to generate task data for a distributed computing task, e.g., raw video data. After the application module M100 generates the distributed computing task, it may notify the distributed task scheduling module M300 of task information of the computing task, for example, notify the networking module M310 of a task type of the distributed computing task, and notify the scheduling decision module M330 of a task data address of the distributed computing task.
The functions performed by the service discovery and registration module M200 may correspond to the steps of the service discovery and registration phase S100 in fig. 7; the service discovery and registration module M200 includes:
(1) the device management module M210. The device management module M210 is used to discover online devices in a distributed computing network. The functions performed by the device management module M210 may correspond to step S110 in fig. 7, step S410 in fig. 9 a;
(2) the distributed data management module M220. The distributed data management module M220 includes: A. task data queuing storage unit M221: the task data processing module is configured to read task data of each subtask from a memory of the electronic device 300, and sequentially store the task data of each subtask, for example, store each video slice according to a time sequence; B. the subtask data distribution unit M222: the task data of the subtasks are distributed to each computing device; and, means for receiving result data of the computing task from the computing devices. The functions performed by the subtask data distribution unit M222 may correspond to steps S280, S310 in fig. 7, and steps S500, S520 in fig. 9 a.
The functions performed by the distributed task scheduling module M300 may correspond to the functions of the distributed task scheduling stage S200 and the result summarizing stage S300 in fig. 7. The distributed task scheduling module M300 includes:
(1) the networking module M310 is used for sensing the distributed computing tasks generated by the application program module M100; and for screening out computing devices suitable for performing distributed computing tasks (e.g., video compression tasks) from the devices discovered by the device management module M210. The functions performed by the networking module M310 may correspond to steps S210, S220 in fig. 7, steps S430, S440 in fig. 9 a;
(2) the state recognition module M320. The state identifying module M320 includes: A. the resource state acquisition unit M321: for obtaining resource status information (e.g., CPU usage) of the computing device; B. communication rate information acquisition unit M322: for obtaining communication rate information for a computing device. The functions performed by the state recognition module M320 may correspond to step S240 in fig. 7, step S460 in fig. 9 a;
(3) a scheduling decision module M330. The scheduling decision module M330 includes: A. a calculating unit M331 for determining the computing power c and the network communication rate v of the computing device, the functions performed by the calculating unit M331 may correspond to step S250 in fig. 7, step S470 in fig. 9 a; B. a decision unit M332, configured to obtain task data of a calculation task from the application program module M100; and determining a task distribution policy based on the task data volume of the computing task, the computing power c of the computing device and the network communication rate v, the function performed by the decision unit M332 may correspond to steps S230, S260 in fig. 7, steps S450, S480 in fig. 9 a;
(4) the module M340 is executed. The execution module M340 includes: A. the task data segmentation unit M341 is configured to segment the task data of the distributed computing task according to the task distribution policy determined by the decision unit M332, where a function executed by the task data segmentation unit M341 may correspond to step S270 in fig. 7 and step S490 in fig. 9 a; a result data synthesizing unit M342, configured to read execution result data of the distributed computing task from the task data queuing storage unit M221 and combine result data of multiple sub-tasks to form final result data, where the function performed by the result data synthesizing unit M342 may correspond to step S320 in fig. 7 and step S530 in fig. 9 a.
Referring now to FIG. 11, shown is a block diagram of an electronic device 400 in accordance with one embodiment of the present application. The electronic device 400 may include one or more processors 401 coupled to a controller hub 403. For at least one embodiment, the controller hub 403 communicates with the processor 401 via a multi-drop Bus such as a Front Side Bus (FSB), a point-to-point interface such as a QuickPath Interconnect (QPI), or similar connection 406. Processor 401 executes instructions that control general types of data processing operations. In one embodiment, the Controller Hub 403 includes, but is not limited to, a Graphics Memory Controller Hub (GMCH) (not shown) and an Input/Output Hub (IOH) (which may be on separate chips) (not shown), where the GMCH includes a Memory and a Graphics Controller and is coupled to the IOH.
The electronic device 400 may also include a coprocessor 402 and memory 404 coupled to the controller hub 403. Alternatively, one or both of the memory and GMCH may be integrated within the processor (as described herein), with the memory 404 and coprocessor 402 coupled directly to the processor 401 and controller hub 403, with the controller hub 403 and IOH in a single chip.
The Memory 404 may be, for example, a Dynamic Random Access Memory (DRAM), a Phase Change Memory (PCM), or a combination of the two. Memory 404 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions therein. A computer-readable storage medium has stored therein instructions, and in particular, temporary and permanent copies of the instructions. The instructions may include: the instructions, when executed by at least one of the processors, cause the electronic device 400 to implement the methods illustrated in fig. 7, 8, 9a, 9b, and/or 9 c. When the instructions are executed on a computer, the computer is caused to execute the method disclosed in the first embodiment and/or the second embodiment.
In one embodiment, the coprocessor 402 is a special-purpose processor, such as, for example, a high-throughput MIC (man Integrated Core) processor, a network or communication processor, compression engine, graphics processor, GPGPU (General-purpose computing on graphics processing unit), embedded processor, or the like. The optional nature of coprocessor 402 is represented in FIG. 11 by dashed lines.
In one embodiment, the electronic device 400 may further include a Network Interface Controller (NIC) 406. Network interface 406 may include a transceiver to provide a radio interface for electronic device 400 to communicate with any other suitable device (e.g., front end module, antenna, etc.). In various embodiments, the network interface 406 may be integrated with other components of the electronic device 400. The network interface 406 may implement the functions of the communication unit in the above-described embodiments.
The electronic device 400 may further include an Input/Output (I/O) device 405. I/O405 may include: a user interface designed to enable a user to interact with the electronic device 400; the design of the peripheral component interface enables peripheral components to also interact with the electronic device 400; and/or sensors are designed to determine environmental conditions and/or location information associated with electronic device 400.
It is noted that fig. 11 is merely exemplary. That is, although fig. 11 shows that the electronic device 400 includes a plurality of devices, such as a processor 401, a controller hub 403, a memory 404, etc., in practical applications, a device using the methods of the present application may include only a part of the devices of the electronic device 400, and for example, may include only the processor 401 and the network interface 406. The nature of the alternative device in fig. 11 is shown in dashed lines.
Referring now to fig. 12, shown is a block diagram of a SoC (System on Chip) 500 in accordance with an embodiment of the present application. In fig. 12, like parts have the same reference numerals. In addition, the dashed box is an optional feature of more advanced socs. In fig. 12, the SoC500 includes: an interconnect unit 550 coupled to the processor 510; a system agent unit 580; a bus controller unit 590; an integrated memory controller unit 540; a set or one or more coprocessors 520 which may include integrated graphics logic, an image processor, an audio processor, and a video processor; a Static Random Access Memory (SRAM) unit 530; a Direct Memory Access (DMA) unit 560. In one embodiment, coprocessor 520 comprises a special-purpose processor, such as, for example, a network or communication processor, compression engine, GPGPU (General-purpose computing on graphics processing units, General-purpose computing on a graphics processing unit), high-throughput MIC processor, or embedded processor, among others.
Static Random Access Memory (SRAM) unit 530 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions. A computer-readable storage medium has stored therein instructions, and in particular, temporary and permanent copies of the instructions. The instructions may include: instructions that when executed by at least one of the processors cause the SoC to implement the method as illustrated in fig. 7, fig. 8, fig. 9a, fig. 9b, and/or fig. 9 c. The instructions, when executed on a computer, cause the computer to perform the methods disclosed in embodiment one and/or embodiment two above.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The method embodiments of the present application may be implemented in software, magnetic, firmware, etc.
Program code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a Processor such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application Specific Integrated Circuit (ASIC), or a microprocessor.
The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. The program code can also be implemented in assembly or machine language, if desired. Indeed, the mechanisms described herein are not limited in scope to any particular programming language. In any case, the language may be a compiled or interpreted language.
One or more aspects of at least one embodiment may be implemented by representative instructions stored on a computer-readable storage medium, which represent various logic in a processor, which when read by a machine causes the machine to fabricate logic to perform the techniques described herein. These representations, known as "IP (Intellectual Property) cores," may be stored on a tangible computer-readable storage medium and provided to a number of customers or production facilities to load into the manufacturing machines that actually manufacture the logic or processors.
In some cases, an instruction converter may be used to convert instructions from a source instruction set to a target instruction set. For example, the instruction converter may transform (e.g., using a static binary transform, a dynamic binary transform including dynamic compilation), morph, emulate, or otherwise convert the instruction into one or more other instructions to be processed by the core. The instruction converter may be implemented in software, hardware, firmware, or a combination thereof. The instruction converter may be on the processor, external to the processor, or partially on and partially off the processor.

Claims (15)

1. A processing method of a computing task is used for electronic equipment, and is characterized in that the method distributes the computing task to be executed to N computing equipment in a distributed computing system where the electronic equipment is located for execution, wherein N is a positive integer more than 2; the method comprises the following steps:
receiving task data of the computing task to be executed;
dividing the computing task to be executed into N subtasks based on task execution rate information of each computing device in the N computing devices, wherein the task execution rate information of the computing device is a rate for the computing device to complete a predetermined amount of computing tasks; and
distributing task data of the N subtasks to the N computing devices so that each computing device executes the subtasks received by the computing device.
2. The method of claim 1, wherein the task execution rate information of the computing device comprises computing power of the computing device and/or network communication rate of the computing device.
3. Method according to claim 1, characterized in that the computation task is partitioned such that the objective function f ═ max { T ═ 1 ,T 2 ,…,T i ,…,T N Has a minimum value, where T i And the time length required by the ith computing equipment for completing the ith subtask is obtained according to the task execution rate information of the ith computing equipment and the task data volume of the ith subtask, wherein i is a positive integer between 1 and N.
4. The method of claim 3,
Figure FDA0002912310870000011
wherein Q is i Is the ith subAmount of task data of task, c i Computing power, v, for the i-th computing device i The network communication speed of the ith computing device is s is the ratio of the result data volume of the computing task to the task data volume of the computing task, and k is the ratio of the operation volume of the computing task to the task data volume of the computing task.
5. The method of claim 2 or 3, wherein the network communication rate of the computing device is an average of a data uplink rate and a data downlink rate of the computing device during network communication.
6. The method of claim 2 or 3, wherein the network communication rate of the computing device is determined based on network communication rate information of the computing device during historical communications.
7. The method according to claim 2 or 3, wherein the computing power of the computing device is a theoretical available computing power of the computing device determined according to CPU model information and CPU utilization rate of the computing device.
8. The method of claim 2 or 3, wherein the computing power information of the computing device is an actual available computing power of the computing device; the method for determining the actual available computing power of the computing device comprises the following steps:
determining a peak computing force of the computing device;
determining usage information for computing resources of the computing device, the usage information including current usage or current idleness of each of one or more computing resources of the computing device, the usage information further including expected usage or expected idleness of each of the one or more computing resources of the computing device;
taking the peak calculation power and the current utilization rate information as input, and operating a preset first calculation power calculation model to obtain the available calculation power of the calculation equipment; the first computing power calculation model is a machine learning model obtained through training according to peak computing power of a plurality of sample computing devices and utilization rate information of the sample computing devices.
9. The method of claim 8, wherein the expected usage of the computing resource is determined based on the usage of the computing resource over M historical usage periods, wherein M is a positive integer.
10. The method of claim 1, wherein the computational task is partitioned such that k-Q i ≤E i Wherein E is i The remaining memory capacity of the i-th computing device.
11. The method of claim 1, wherein the electronic device is one of the N computing devices.
12. The method of claim 4, wherein the electronic device is one of the N computing devices, and wherein a duration of time for the electronic device to complete its corresponding subtask is utilized by the electronic device
Figure FDA0002912310870000021
Wherein Q B A task data volume of a subtask corresponding to the electronic device, c B Computing power for the electronic device.
13. The method of claim 1, wherein the computational task to be performed is a video compression task.
14. An electronic device, comprising:
a memory to store instructions for execution by one or more processors of the electronic device;
a processor which, when executing the instructions in the memory, causes the electronic device to perform a method of processing a computing task as claimed in any of claims 1 to 13.
15. A computer-readable storage medium having stored thereon instructions which, when executed on a computer, cause the computer to perform the method of processing a computing task of any of claims 1 to 13.
CN202110089838.2A 2021-01-22 2021-01-22 Processing method of computing task, electronic device and storage medium Pending CN114816686A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110089838.2A CN114816686A (en) 2021-01-22 2021-01-22 Processing method of computing task, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110089838.2A CN114816686A (en) 2021-01-22 2021-01-22 Processing method of computing task, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN114816686A true CN114816686A (en) 2022-07-29

Family

ID=82523898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110089838.2A Pending CN114816686A (en) 2021-01-22 2021-01-22 Processing method of computing task, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114816686A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117119032A (en) * 2023-10-20 2023-11-24 成都秦川物联网科技股份有限公司 Remote price adjustment method, device and equipment for ultrasonic metering instrument based on Internet of things
WO2024099280A1 (en) * 2022-11-07 2024-05-16 北京字跳网络技术有限公司 Video editing method and apparatus, electronic device, and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024099280A1 (en) * 2022-11-07 2024-05-16 北京字跳网络技术有限公司 Video editing method and apparatus, electronic device, and storage medium
CN117119032A (en) * 2023-10-20 2023-11-24 成都秦川物联网科技股份有限公司 Remote price adjustment method, device and equipment for ultrasonic metering instrument based on Internet of things

Similar Documents

Publication Publication Date Title
CN113553130B (en) Method for executing drawing operation by application and electronic equipment
WO2020119464A1 (en) Video splitting method and electronic device
CN113722087B (en) Virtual memory management method and electronic equipment
WO2022017474A1 (en) Task processing method and related apparatus
CN114816686A (en) Processing method of computing task, electronic device and storage medium
CN111382087A (en) Memory management method and electronic equipment
CN111078376A (en) Process management method and device
CN115333941B (en) Method for acquiring application running condition and related equipment
CN111045732B (en) Data processing method, chip, device and storage medium
CN117130773A (en) Resource allocation method, device and equipment
CN116048933A (en) Fluency detection method
CN113391743B (en) Display method and electronic equipment
WO2021057565A1 (en) Processing method and mobile device
CN114697348A (en) Distributed implementation method, distributed system, readable medium and electronic device
CN114968540A (en) Frequency adjustment method for inter-core migration
CN113760191B (en) Data reading method, data reading apparatus, storage medium, and program product
CN115220881A (en) Process management method, electronic device, process management system, and storage medium
CN113760192A (en) Data reading method, data reading apparatus, storage medium, and program product
CN114443240B (en) Input/output request processing method and electronic equipment
CN116700913B (en) Scheduling method, equipment and storage medium of embedded file system
WO2023051036A1 (en) Method and apparatus for loading shader
CN117130765B (en) Configuration method of computing resources and electronic equipment
WO2022222780A1 (en) Audio output method, media file recording method, and electronic device
WO2024032430A1 (en) Memory management method and electronic device
CN116320727B (en) Algorithm scheduling method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination