Resource sharing method, electronic device, and storage medium
By sharing resource information and task instructions between multiple shooting devices, the problem of resource and information barriers between shooting devices is solved, and the task execution efficiency is improved.
Patent Information
- Application Number
- PCT/CN2024/133727
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-27
- Filing Date
- 2024-11-22
- Publication Date
- 2025-06-05
AI Technical Summary
Due to the lack of direct communication in the same scene, multiple shooting devices may lead to resource and information barriers, which may lead to excessive load on the shooting device and affect the task execution efficiency.
By acquiring the resource required for the target task of the first photographing device and the resource information of the at least one second photographing device, the target shooting device is determined, and the shooting information is shared thereto and the collaborative working instructions are sent, so that the target shooting device can perform the target task.
Through the communication between the first photographing device and the second photographing device, a suitable photographing device is selected to perform tasks, avoid excessive load and improve task execution efficiency.
Smart Images

Figure CN2024133727_05062025_PF_FP_ABST
Abstract
Description
Resource sharing method, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on November 27, 2023, with application number 202311609818.9 and invention name “A resource sharing method, electronic device and storage medium”. The entire contents of the Chinese patent application are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the field of communication technology, and in particular to a resource sharing method, electronic device, and storage medium. Background Art
[0004] With the development of the times, the application scenarios of cameras are also expanding. Multiple cameras in the same scene are usually connected to the same local area network, the same wide area network, or the same cloud platform through wired or wireless means, and do not directly communicate with each other. This leads to significant resource and information barriers between multiple cameras. The lack of communication between multiple cameras in the same scene can lead to excessive load on the cameras, thereby affecting their task execution efficiency. Summary of the Invention
[0005] On the one hand, a resource sharing method is provided, which includes: obtaining resources required for a target task of a first shooting device; obtaining resource information corresponding to at least one second shooting device; determining a target shooting device based on the resources required for the target task and the resource information corresponding to at least one second shooting device, the target shooting device being the second shooting device selected to perform the target task; sharing the shooting information of the first shooting device with the target shooting device, and sending a collaborative work instruction to the target shooting device, the collaborative work instruction being used to instruct the target shooting device to perform the target task based on the shooting information of the first shooting device.
[0006] On the other hand, a resource sharing device is provided, which includes: a communication module for obtaining resources required for a target task of a first shooting device; the communication module is also used to obtain resource information corresponding to at least one second shooting device; a processing module is used to determine a target shooting device based on the resources required for the target task and the resource information corresponding to at least one second shooting device, the target shooting device being the second shooting device selected to perform the target task; the communication module is also used to share the shooting information of the first shooting device with the target shooting device, and send a collaborative work instruction to the target shooting device, the collaborative work instruction being used to instruct the target shooting device to perform the target task based on the shooting information of the first shooting device.
[0007] On the other hand, an electronic device is provided, comprising: a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program instructions executable by the processor; and the resource sharing method of any of the above embodiments is implemented when the processor executes the computer program instructions.
[0008] On the other hand, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed on an electronic device, the resource sharing method of any of the above embodiments is implemented.
[0009] On the other hand, a computer program product is provided, which includes computer program instructions, and when the computer program instructions are executed, the resource sharing method of any one of the above embodiments is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] FIG1 is a schematic diagram of the architecture of a shooting system provided by an embodiment of the present disclosure;
[0011] FIG2 is a schematic diagram of the architecture of another shooting system provided by an embodiment of the present disclosure;
[0012] FIG3 is a flow chart of a resource sharing method provided by an embodiment of the present disclosure;
[0013] FIG4 is a flowchart of a resource sharing method provided by an embodiment of the present disclosure;
[0014] FIG5 is a second flowchart of a resource sharing method provided by an embodiment of the present disclosure;
[0015] FIG6 is a third flowchart of a resource sharing method provided by an embodiment of the present disclosure;
[0016] FIG7 is a fourth flowchart of a resource sharing method provided by an embodiment of the present disclosure;
[0017] FIG8 is a fifth flowchart of a resource sharing method provided by an embodiment of the present disclosure;
[0018] FIG9 is a sixth flowchart of a resource sharing method provided by an embodiment of the present disclosure;
[0019] FIG10 is a flowchart of a resource sharing method provided by an embodiment of the present disclosure;
[0020] FIG11 is a schematic structural diagram of a resource sharing device provided by an embodiment of the present disclosure;
[0021] FIG12 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] The following will be combined with the accompanying drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present disclosure.
[0023] In the description of the present disclosure, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "a plurality" means two or more. Words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not limit them to be necessarily different.
[0024] It should be noted that, in this disclosure, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described in this disclosure as "exemplary" or "for example" should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of "exemplary" or "for example" should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete way.
[0025] With the development of the times, the application scenarios of cameras are also expanding. Multiple cameras in the same scene are usually connected to the same local area network, the same wide area network, or the same cloud platform through wired or wireless means, and do not directly communicate with each other. This leads to significant resource and information barriers between multiple cameras. The lack of communication between multiple cameras in the same scene can lead to excessive load on the cameras, thereby affecting their task execution efficiency.
[0026] To address the aforementioned issues in the prior art, the present disclosure provides a resource sharing method. Based on the resources required for a target task and the resource information corresponding to at least one second camera, a first camera identifies a target camera from among at least one second camera and instructs the target camera to execute the target task based on the camera information captured by the first camera. This allows communication between the first camera and at least one second camera to select the target camera to execute the target task, helping to avoid excessive load on the first camera and thereby ensuring the efficiency of task execution for the first camera.
[0027] The resource sharing method provided by the present disclosure can be applied to a camera system as shown in Figure 1. Figure 1 shows a schematic diagram of the architecture of a camera system provided by the present disclosure. As shown in Figure 1, the camera system includes multiple camera devices, including a first camera 11 that receives a target task and at least one second camera 12 other than the first camera 11. The first camera 11 and the at least one second camera 12 are connected via a wired or wireless connection.
[0028] In one possible implementation, the resource sharing method disclosed herein can be applied to home security scenarios, community security scenarios, factory security scenarios, etc. The disclosure does not impose any specific restrictions on specific application scenarios.
[0029] In some embodiments, the first camera 11 and the second camera 12 are both cameras with wireless communication capabilities.
[0030] In some embodiments, the first camera 11 and the at least one second camera 12 may both establish storage space based on a trans-flash card (TF), a hard disk, or a cloud space.
[0031] For example, assuming that the first camera 11 and at least one second camera 12 both use TF cards to create storage space, and one camera can simultaneously receive video information sent by at most X cameras. In this case, the number of TF cards required can be determined based on the following formula:
[0032] Where F is used to indicate the number of TF cards required, M is used to indicate the duration of video that each TF card can store, and T is used to indicate the duration of video that each shooting device needs to store.
[0033] In some embodiments, the second camera 12 may be a camera connected to the same local area network as the first camera 11, or may be a camera connected to the same switch local area network as the first camera. This disclosure does not impose any specific restrictions on this.
[0034] For example, within the same local area network, the first camera 11 and at least one second camera 12 can discover each other and exchange information through a distributed soft bus technology (such as the KOP protocol).
[0035] In some embodiments, the first camera 11 and the second camera can both be cameras with wireless transceiver capabilities, which can be deployed on land, including indoors or outdoors, handheld, wearable, or vehicle-mounted; can also be deployed on water (such as ships, etc.); can also be deployed in the air (for example, on airplanes, balloons, and satellites, etc.). The camera can be a mobile phone, a tablet computer, a computer with wireless transceiver and camera functions, a camera end in industrial control, a camera in self-driving, a camera in remote medical care, a camera in a smart grid, a camera in transportation safety, a camera in a smart city, a camera in a smart home, etc. The embodiments of the present disclosure do not limit the application scenarios.
[0036] It should be noted that FIG1 is only an exemplary framework diagram, and the number of devices included in FIG1 and the names of the devices are not limited. In addition to the devices shown in FIG1 , the shooting system may also include other devices, such as a server.
[0037] For example, see Figure 2, which illustrates a schematic diagram of the architecture of another camera system provided by the present disclosure. As shown in Figure 2, the camera system includes, in addition to a first camera 11 and at least one second camera 12, a server 13. The first camera 11 and the at least one second camera 12, as well as the first camera 11 and the server 13, and the at least one second camera 12 and the server 13, can be connected via wired or wireless means.
[0038] In some embodiments, server 13 can be an independent server, or a server cluster or distributed system composed of multiple servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data service networks.
[0039] The present disclosure provides a resource sharing method, which is applied to the first camera 11 in FIG1 . As shown in FIG3 , the method includes the following steps:
[0040] S101: Acquire resources required for a target task of a first photographing device.
[0041] In some embodiments, the target task includes a storage task or a computing task. The storage task may be storing video information within a certain time period, storing a certain image, or storing audio information within a certain time period, and the present disclosure does not impose specific limitations on this. The computing task may be an artificial intelligence (AI) function, a data processing task, a target detection and recognition task, or a motion detection task, and the present disclosure does not impose specific limitations on this.
[0042] In some embodiments, the resources required for the target task include at least one of the following: neural network processor computing power resources, central processing unit computing power resources, memory resources, storage resources, and network bandwidth resources required for the target task.
[0043] In some embodiments, upon receiving the target task, the first shooting device obtains resources required for the target task.
[0044] It is understandable that after the first camera receives the target task, if the first camera directly executes the target task, the idle resources of the first camera may not meet the resources required by the target task, resulting in the first camera missing key video frames or key audio frames when executing the target task, thereby affecting the processing effect of the target task. Therefore, the first camera needs to obtain the resources required for the target task to determine whether other cameras can assist in executing the target task. This helps the first camera select other cameras to execute the target task when the idle resources of the first camera cannot meet the resources required for the target task, thereby avoiding affecting the processing effect of the target task due to insufficient idle resources of the first camera.
[0045] S102: Obtain resource information corresponding to at least one second shooting device.
[0046] Among them, resource information includes at least one of the following: neural network processor computing power resource occupancy rate, central processing unit network computing power resource occupancy rate, memory resource occupancy rate, storage resource occupancy rate and network bandwidth resource occupancy rate.
[0047] In some embodiments, upon receiving the target task, the first shooting device obtains resource information corresponding to at least one second shooting device.
[0048] It is understandable that the idle resources of the first camera may not necessarily meet the resources required for the target task. Therefore, the first camera needs to obtain the resource information corresponding to at least one second camera. In this way, if the idle resources of the first camera cannot meet the resources required for the target task, the second camera with lower resource utilization rate can be selected to perform the target task.
[0049] S103: Determine a target shooting device based on resources required for the target task and resource information corresponding to at least one second shooting device.
[0050] In some embodiments, the target camera is the second camera selected to perform the target task.
[0051] It is understood that if the first camera's available resources are insufficient to meet the target task's resource requirements, the first camera will randomly delegate the target task to a second camera. However, the available resources of the second camera to which the target task is delegated may not necessarily meet the required resources. Therefore, the first camera needs to determine the target camera from the at least one second camera based on the resources required for the target task and the resource information corresponding to the at least one second camera.
[0052] In this way, it is helpful to select a shooting device whose idle resources can meet the target resources to perform the target task, thereby helping to ensure the processing effect of the target task.
[0053] S104: Share the shooting information of the first shooting device with the target shooting device, and send a collaborative work instruction to the target shooting device.
[0054] The collaborative work instruction is used to instruct the target shooting device to perform the target task based on the shooting information of the first shooting device. The shooting information includes video information, image information or audio information acquired by the shooting device.
[0055] For example, assuming the target task is a storage task, specifically storing video information captured by the first camera within 30 minutes from the moment it is captured. Within 30 minutes from the moment it is captured, the first camera shares the video information captured by the first camera with the target camera and sends a collaborative work instruction to the target camera, instructing the target camera to store the video information captured by the first camera within 30 minutes from the moment it is captured.
[0056] As another example, assume the target task is a calculation task, specifically, to calculate the number of teenagers appearing in the video information captured by the first camera within 30 minutes from now. Within 30 minutes from now, the first camera shares the video information captured by the first camera with the target camera and sends a collaborative work instruction to the target camera, causing the target camera to calculate the number of teenagers appearing in the next 30 minutes based on the video information captured by the first camera in the next 30 minutes.
[0057] In the disclosed embodiment, the first camera, based on the acquired resources required for the target task and the resource information corresponding to each of the at least one second camera, identifies a target camera from the at least one second camera and instructs the target camera to execute the target task based on the camera information of the first camera. This allows the first camera to select the target camera to execute the target task through communication between the first camera and the at least one second camera, thereby helping to avoid excessive load on the first camera and thereby ensuring the efficiency of task execution by the first camera.
[0058] In a possible implementation, as shown in FIG4 , the above S102 may include the following steps:
[0059] a1. Send a first message to the second shooting device.
[0060] In some embodiments, the first message is used to request the second camera to send a second message to the first camera, wherein the second message includes a device identifier of the second camera and resource information of the second camera.
[0061] In some embodiments, after receiving the target task, the first shooting device sends a first message to the second shooting device to request the second shooting device to send a second message including the information of the second shooting device.
[0062] a2. Receive a second message sent by a second shooting device.
[0063] a3. Obtain resource information corresponding to the second shooting device from the second message.
[0064] In some embodiments, after receiving the second message sent by the second camera, the first camera parses the second message to obtain resource information corresponding to the second camera.
[0065] In this way, it is helpful for the first shooting device to determine whether the second shooting device can be used to perform the target task based on the resource information corresponding to the second shooting device.
[0066] In another possible implementation, as shown in FIG5 , the above S102 may further include the following steps:
[0067] b1. Receive a second message periodically sent by a second shooting device.
[0068] In some embodiments, the second message is periodically sent by the second shooting device to the first shooting device.
[0069] For example, the second shooting device sends the second message to the first shooting device once every 1 minute.
[0070] b2. Obtain resource information corresponding to the second shooting device from the second message.
[0071] In some embodiments, after receiving the second message periodically sent by the second camera, the first camera parses the second message to obtain resource information corresponding to the second camera.
[0072] In this way, it helps the first shooting device to periodically understand the resource occupancy of the second shooting device, and it also helps to determine whether the second shooting device can be used to perform the target task based on the resource information corresponding to the second shooting device obtained most recently when the idle resources of the first shooting device cannot meet the target task.
[0073] In another possible implementation, as shown in FIG6 , the above S102 may further include the following steps:
[0074] c1. Receive a second message sent by the second shooting device when the change value of the resource occupancy rate is greater than a second preset threshold.
[0075] In some embodiments, the change in resource utilization is the change in resource utilization of the second camera during the previous cycle compared to the resource utilization corresponding to the second message last sent by the second camera. For example, if the resource utilization corresponding to the second message last sent by the second camera A is 57%, and the resource utilization of the second camera A during the previous cycle is 65.35%, then based on the resource utilization corresponding to the second message last sent by the second camera A and the resource utilization of the second camera A during the previous cycle, the change in resource utilization can be determined to be 8.35%.
[0076] The resource utilization rate corresponding to the second message is the average of the resource utilization rates of each resource in the resource information of the second message. For example, if the resource information of the second message shows that the neural network processor computing power resource utilization rate is 56%, the central processing unit computing power resource utilization rate is 54%, the memory resource utilization rate is 45%, and the storage resource utilization rate and network bandwidth resource utilization rate are 78%, then the utilization rate corresponding to the second message is 58.25%.
[0077] The resource utilization rate of the second camera in the previous cycle is the average resource utilization rate of each hardware component of the second camera at the end of the previous cycle. For example, suppose that at the end of the previous cycle, the computing resource utilization rate of the neural network processor of the second camera was 50%, the computing resource utilization rate of the central processing unit was 70%, and the memory resource utilization rate was 66%. In this case, the resource utilization rate of the second camera in the previous cycle can be determined to be 62%.
[0078] c2. Obtain the resource occupancy rate corresponding to the second shooting device from the second message.
[0079] In some embodiments, after receiving the second message sent by the second camera when the change value of the resource occupancy rate is greater than a second preset threshold, the first camera parses the second message to obtain resource information corresponding to the second camera.
[0080] In this way, when the resource occupancy rate of the second camera device changes significantly, the first camera device can promptly learn about the resource occupancy rate of the second camera device.
[0081] According to the above content, it can be seen that in the present disclosure, the first shooting device can obtain the resource information corresponding to the second shooting device through various methods such as active request and periodic reception, so that the first shooting device can flexibly choose the method of obtaining the resource information corresponding to the second shooting device, avoiding the limitations caused by a single acquisition method.
[0082] In some embodiments, as shown in FIG7 , before the above S103 , the resource sharing method provided by the present disclosure may further include the following step d1 . The above S103 may be specifically implemented as the following step d2 .
[0083] d1. Determine idle resources of the first shooting device.
[0084] In some embodiments, after receiving the target task, the first shooting device obtains the usage of one or more of the neural network processor, central processing unit, memory, storage space and network bandwidth of the first shooting device, and then determines the idle resources of the first shooting device.
[0085] For example, assume that the computing power of the neural network processor of the first camera A is 10TOPS (10 trillion floating-point operations per second) and the current utilization rate is 50%; the main frequency of the central processing unit of the first camera A is 2.5GHz and the current occupancy rate is 30%; the memory size of the first camera A is 16GB and the currently used memory amount is 8GB; the first camera A is equipped with a 1TB storage hard drive with 700GB of used storage space; the first camera A is connected to a 100Mbps network and the current network traffic is 60Mbps. At this point, it can be determined that the idle resources of the first camera A include 5TOPS of neural network processor computing power resources, 700MHz of central processing unit computing power resources, 8GB of memory resources, 200GB of storage resources, and 40Mbps of network bandwidth resources.
[0086] d2. If the idle resources of the first shooting device do not meet the resources required by the target task, determine a target shooting device based on the resources required by the target task and the resource occupancy rate corresponding to the at least one second shooting device.
[0087] In some embodiments, the "idle resources of the first shooting device do not meet the resources required for the target task" in the above d2 may mean that the resource occupancy rate of the first shooting device when executing the target task is above the first preset threshold. This disclosure does not impose any specific restrictions on the size of the first preset threshold.
[0088] Exemplarily, assuming that the first preset threshold is 80%, when the resource occupancy rate of the first shooting device in the state of executing the target task is above 80%, the idle resources of the first shooting device do not meet the resources required by the target task.
[0089] This helps to avoid excessive resource usage of the first camera, thereby helping to ensure load balance between the first camera and at least one second camera.
[0090] It should be understood that when the idle resources of the first shooting device do not meet the resources required for the target task, determining the target shooting device from at least one second shooting device can also help avoid unnecessary adjustments to the target task, thereby helping to avoid unnecessary consumption of communication resources, storage resources, etc.
[0091] In a possible implementation, as shown in FIG8 , the above S103 may include the following steps:
[0092] e1. For each of the at least one second shooting device, determine a resource occupancy rate of the second shooting device when executing the target task based on resource information of the second shooting device and resources required by the target task.
[0093] The resource information may also include at least one of the following: computing power resources of the neural network processor of the shooting device, computing power resources of the central processing unit, memory resources, storage resources and network bandwidth resources.
[0094] In some embodiments, the first shooting device determines the resource occupancy rate of the target task for the second shooting device based on the resource information of the second shooting device, and then determines the resource occupancy rate of the second shooting device when executing the target task based on the resource occupancy rate of the target task for the second shooting device and the resource information of the second shooting device.
[0095] For example, assuming the resource information of the second camera indicates a resource utilization rate of 50%, and the first camera determines, based on the resource information of the second camera, that the resource utilization rate of the target task for the second camera is 12%, then, based on the resource utilization rate of the target task for the second camera and the resource information of the second camera, the resource utilization rate of the second camera when executing the target task is determined to be 62%.
[0096] e2. Determine a target shooting device based on the resource occupancy rate corresponding to at least one second shooting device when executing the target task.
[0097] This helps select a second shooting device with a lower resource occupancy rate when executing the target task as the target shooting device among at least one second shooting device, thereby helping to ensure load balancing between the first shooting device and at least one second shooting device.
[0098] In a possible implementation, as shown in FIG9 , the above-mentioned step e2 may include the following steps:
[0099] f1. Based on the order of resource occupancy rates corresponding to at least one second shooting device in the state of executing the target task from small to large, search for a second shooting device whose resource occupancy rate in the state of executing the target task is less than a first preset threshold from at least one second shooting device.
[0100] It should be understood that the search is performed in ascending order of resource utilization while executing the target task. Once a second camera with a resource utilization less than a first preset threshold is found, the first camera can immediately stop searching without further checking the remaining second cameras. This can significantly reduce the number of searches and improve search efficiency.
[0101] In another possible implementation, based on the priority of at least one second shooting device, a second shooting device whose resource occupancy rate when executing the target task is less than a first preset threshold is searched from at least one second shooting device in descending order of priority.
[0102] In some embodiments, the reference resource is any resource required by the target task. For example, the resources required by the target task include memory resources, CPU resources, and storage resources, and the reference resource can be any one of the memory resources, CPU resources, and storage resources.
[0103] The priority of the second shooting device is negatively correlated with the resource occupancy rate of the reference resource in the resource occupancy rate corresponding to the second shooting device.
[0104] f2. The second shooting device found for the first time is used as the target shooting device.
[0105] In this way, the first shooting device uses the second shooting device with the lowest resource occupancy rate when executing the target task as the target shooting device, which is beneficial to load balancing between the first shooting device and at least one second shooting device.
[0106] In some embodiments, when the first shooting device fails to find the target shooting device in at least one second shooting device, the first shooting device sends a prompt message to refuse to execute the target task.
[0107] It should be understood that when the target shooting device is not found in at least one second shooting device, it indicates that each second shooting device does not have sufficient free resources to perform the target task. At this time, refusing to execute the target task will help avoid the shooting device from malfunctioning or crashing due to insufficient resources when executing the target task.
[0108] As shown in FIG10 , after the above S104 , the technical solution provided by the present disclosure further includes the following steps:
[0109] S201: Receive task execution result information sent by a target shooting device.
[0110] The task execution result information is used to indicate the result of the target shooting device executing the target task.
[0111] For example, assuming that the target task is a storage task, specifically storing the audio information acquired by the first shooting device within 20 minutes from now, the task execution result information may be that the target shooting device has stored the audio information indicated by the target task.
[0112] For example, suppose the target task is to count the number of people with blond hair in the video captured by the first camera within 10 minutes from the moment the task is completed. In this case, the task execution result information may be that there are 13 people with blond hair in the video captured by the first camera within 10 minutes from the moment the task is completed.
[0113] In this way, the first shooting device can timely learn about the progress of the target task, thereby achieving the purpose of collaborative work between the first shooting device and the target shooting device.
[0114] As an example, the resource sharing method provided in the present disclosure may specifically include the following steps:
[0115] Step 1: Receive and execute the target task.
[0116] Step 2: Obtain resources required for the target task; obtain resource information of at least one second shooting device.
[0117] Step three, determine the idle resources of the first shooting device; if the idle resources of the first shooting device cannot meet the resources required for the target task, based on the resources required for the target task and the resource information corresponding to at least one second shooting device, determine the target shooting device for executing the target task in at least one second shooting device.
[0118] Step 4: Based on the resource utilization rates of the at least one second camera when executing the target task, the at least one second camera is sequentially searched for a second camera whose resource utilization rate when executing the target task is less than a first preset threshold. If the at least one second camera includes a second camera whose resource utilization rate when executing the target task is less than the first preset threshold, the process proceeds to Step 5. If the target camera is not found in the at least one second camera, a prompt message is issued to indicate that execution of the target task is rejected.
[0119] Step 5: The second shooting device found for the first time is used as the target shooting device.
[0120] Step 6: Share the shooting information of the first shooting device with the target shooting device, and send a collaborative work instruction to the target shooting device.
[0121] Step 7: Receive the task execution result information sent by the target shooting device.
[0122] The above mainly introduces the scheme of the embodiment of the present disclosure from the perspective of method. A resource sharing device is also shown below, which is used to execute the resource sharing method in any of the above embodiments and possible implementation methods thereof. It can be understood that in order to implement the resource sharing method, the resource sharing device includes hardware structures and / or software modules corresponding to the execution of each function; those skilled in the art should easily realize that, in combination with the algorithm steps of each example described in the embodiment of the present disclosure, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.
[0123] The embodiment of the present disclosure can divide the resource sharing device into functional modules according to the above-mentioned method embodiment. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one functional module. The above-mentioned integrated module can be implemented in the form of hardware or software. It should be noted that the division of modules in the embodiment of the present disclosure is schematic and is only a logical function division. There may be other division methods in actual implementation. The following is an example of dividing each functional module corresponding to each function.
[0124] FIG11 is a schematic diagram of a resource sharing device according to an embodiment of the present disclosure. The resource sharing device 20 includes a communication module 21 and a processing module 22 .
[0125] The communication module 21 is used to obtain the resources required for the target task of the first shooting device;
[0126] The communication module 21 is further configured to obtain resource information corresponding to at least one second shooting device;
[0127] A processing module 22 is configured to determine a target photographing device based on resources required for the target task and resource information corresponding to at least one second photographing device, where the target photographing device is the second photographing device selected to perform the target task;
[0128] The communication module 21 is further configured to share the shooting information of the first shooting device with the target shooting device and send a collaborative work instruction to the target shooting device, wherein the collaborative work instruction is configured to instruct the target shooting device to perform a target task based on the shooting information of the first shooting device.
[0129] In some embodiments, the resource information includes at least one of the following: neural network processor computing power resource occupancy rate, central processing unit computing power resource occupancy rate, memory resource occupancy rate, storage resource occupancy rate and network bandwidth resource occupancy rate; the resources required for the target task include at least one of the following: neural network processor computing power resources, central processing unit computing power resources, memory resources, storage resources and network bandwidth resources required for the target task.
[0130] In some embodiments, the processing module 22 is specifically used to determine, for each of the at least one second shooting devices, the resource occupancy rate of the second shooting device in the state of executing the target task based on the resource information of the second shooting device and the resources required for the target task; and determine the target shooting device based on the corresponding resource occupancy rate of at least one second shooting device in the state of executing the target task.
[0131] In some further embodiments, the processing module 22 is specifically used to search for a second shooting device whose resource occupancy rate in the state of executing the target task is less than a first preset threshold value from at least one second shooting device in order from small to large based on the resource occupancy rate corresponding to at least one second shooting device in the state of executing the target task; and use the second shooting device found for the first time as the target shooting device.
[0132] In some other embodiments, the processing module 22 is specifically used to determine the idle resources of the first shooting device; if the idle resources of the first shooting device do not meet the resources required for the target task, the target shooting device is determined based on the resources required for the target task and the resource occupancy rate corresponding to at least one second shooting device.
[0133] In some other embodiments, the communication module 21 is specifically used to send a first message to the second shooting device, where the first message is used to request the second shooting device to send a second message to the first shooting device, where the second message includes the device identification of the second shooting device and the resource information of the second shooting device; and receive the second message sent by the second shooting device; the processing module 22 is also used to obtain the resource information corresponding to the second shooting device from the second message.
[0134] In some further embodiments, the communication module 21 is specifically used to receive a second message periodically sent by the second shooting device, where the second message includes a device identification of the second shooting device and resource information of the second shooting device; the processing module 22 is also used to obtain resource information corresponding to the second shooting device from the second message.
[0135] In some further embodiments, the communication module 21 is specifically used to receive a second message sent by the second shooting device when the change value of the resource occupancy rate is greater than a second preset threshold; wherein the change value of the resource occupancy rate is the resource occupancy rate of the second shooting device in the previous cycle, compared with the change value of the resource occupancy rate corresponding to the second message sent by the second shooting device last time; the processing module 22 is also used to obtain resource information corresponding to the second shooting device from the second message.
[0136] In some other embodiments, the communication module 21 is further configured to issue a prompt message when the target shooting device is not found in at least one second shooting device, where the prompt message is used to indicate a refusal to execute the target task.
[0137] In some other embodiments, the communication module 21 is further configured to receive task execution result information sent by the target shooting device, where the task execution result information is used to indicate the result of the target shooting device executing the target task.
[0138] In still other embodiments, the target task includes a storage task or a computing task.
[0139] In the case of implementing the functions of the above-mentioned integrated modules in hardware, the embodiments of the present disclosure also provide a possible structure of an electronic device for executing the resource sharing method provided in the embodiments of the present disclosure. As shown in Figure 12, the electronic device 300 includes: a communication interface 303, a processor 302, and a bus 304. Optionally, the electronic device may also include a memory 301.
[0140] Processor 302 may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of this disclosure. Processor 302 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of this disclosure. Processor 302 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, or a combination of a DSP and a microprocessor.
[0141] The communication interface 303 is used to connect to other devices via a communication network, such as Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0142] The memory 301 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0143] As a possible implementation, the memory 301 can exist independently of the processor 302. The memory 301 can be connected to the processor 302 via a bus 304 to store instructions or program codes. When the processor 302 calls and executes the instructions or program codes stored in the memory 301, the resource sharing method provided in the embodiment of the present disclosure can be implemented.
[0144] In another possible implementation, the memory 301 and the processor 302 may also be integrated together.
[0145] Bus 304 can be an Extended Industry Standard Architecture (EISA) bus, etc. Bus 304 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG12 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0146] Some embodiments of the present disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium), which stores computer program instructions. When the computer program instructions are executed on a computer, the computer executes the resource sharing method described in any of the above embodiments.
[0147] In an exemplary embodiment, the computer may be the resource sharing device described above, and the present disclosure does not limit the specific form of the computer.
[0148] In some examples, the computer-readable storage media described above may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical disks (e.g., compact disks (CDs), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memories (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described in this disclosure may represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.
[0149] An embodiment of the present disclosure provides a computer program product comprising instructions. When the computer program product is run on a computer, the computer is enabled to execute the resource sharing method described in any one of the above embodiments.
[0150] The above is only a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or replacements within the technical scope disclosed in the present disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A resource sharing method, applied to a first shooting device, the method comprising: Acquire resources required for a target task of the first photographing device; Acquire resource information corresponding to at least one second shooting device; Determine a target shooting device based on the resources required for the target task and the resource information corresponding to each of the at least one second shooting device, the target shooting device being the second shooting device selected to perform the target task; The shooting information of the first shooting device is shared with the target shooting device, and a collaborative work instruction is sent to the target shooting device, where the collaborative work instruction is used to instruct the target shooting device to perform the target task based on the shooting information of the first shooting device.
2. The method according to claim 1, wherein: The resource information includes at least one of the following: neural network processor computing power resource occupancy rate, central processing unit computing power resource occupancy rate, memory resource occupancy rate, storage resource occupancy rate and network bandwidth resource occupancy rate; The resources required for the target task include at least one of the following: neural network processor computing power resources, central processing unit computing power resources, memory resources, storage resources and network bandwidth resources required for the target task.
3. The method according to claim 2, wherein: The determining the target shooting device based on the resources required by the target task and the resource information corresponding to each of the at least one second shooting device includes: For each of the at least one second shooting device, determining a resource occupancy rate of the second shooting device when executing the target task based on resource information of the second shooting device and resources required for the target task; The target shooting device is determined based on the resource occupancy rate corresponding to each of the at least one second shooting devices when executing the target task.
4. The method according to claim 3, wherein: The determining of the target shooting device based on the resource occupancy rate of each of the at least one second shooting device in the state of executing the target task includes: Based on the resource occupancy rates of the at least one second shooting device in the state of executing the target task, the second shooting device whose resource occupancy rate in the state of executing the target task is less than the first preset threshold is searched from the at least one second shooting device in sequence; The second photographing device found for the first time is used as the target photographing device.
5. The method according to claim 2, wherein: The determining the target shooting device based on the resources required by the target task and the resource occupancy rate corresponding to each of the at least one second shooting device includes: Determining idle resources of the first shooting device; If the idle resources of the first shooting device do not meet the resources required by the target task, the target shooting device is determined based on the resources required by the target task and the resource occupancy rate corresponding to each of the at least one second shooting device.
6. The method according to claim 1, wherein: The obtaining of information corresponding to at least one second shooting device includes: Sending a first message to the second shooting device, where the first message is used to request the second shooting device to send a second message to the first shooting device, where the second message includes a device identifier of the second shooting device and resource information of the second shooting device; receiving a second message sent by the second shooting device; Obtain resource information corresponding to the second shooting device from the second message.
7. The method according to claim 1, wherein: The obtaining of resource information corresponding to at least one second shooting device includes: receiving a second message periodically sent by the second shooting device, where the second message includes a device identification of the second shooting device and resource information of the second shooting device; Obtain resource information corresponding to the second shooting device from the second message.
8. The method according to claim 1, wherein: The obtaining of resource information corresponding to at least one shooting device includes: receiving a second message sent by the second camera when the change value of the resource occupancy rate is greater than a second preset threshold; wherein the change value of the resource occupancy rate is a change value of the resource occupancy rate of the second camera in the previous cycle compared to the resource occupancy rate corresponding to the second message sent by the second camera last time; Obtain the resource occupancy rate corresponding to the second shooting device from the second message.
9. The method according to claim 4, wherein: The method further comprises: In the case that the target shooting device is not found in the at least one second shooting device, a prompt message is issued, where the prompt message is used to indicate that the target task is refused to be executed.
10. The method according to claim 1, wherein: The method further comprises: Receive task execution result information sent by the target shooting device, where the task execution result information is used to indicate the result of the target shooting device executing the target task.
11. The method according to claim 1, wherein: The target task includes a storage task or a computing task.
12. An electronic device, wherein: include: Memory and processor; Memory and processor coupling; The memory is used to store instructions executable by the processor; When the processor executes the instructions, the method according to any one of claims 1 to 11 is performed.
13. A computer-readable storage medium having computer instructions stored thereon, wherein when the computer instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Multimedia resource sharing method, related device and storage medium
CN109195103A
Task scheduling method and device, electronic equipment and storage medium
CN113867914A
Video monitoring method and device, equipment and storage medium
CN114125372A
Roadside device, on-vehicle device, information processing method, and information processing program
JP2019185592A