Resource sharing method, electronic equipment and storage medium
By sharing resource information and task instructions among multiple shooting devices, and determining the target shooting device to perform tasks, the problem of resource and information barriers between shooting devices is solved, and task execution efficiency is improved.
Patent Information
- Application Number
- CN202311609818.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2025-05-27
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 on the first photographing device and improve task execution efficiency.
Smart Images

Figure CN120050513A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a resource sharing method, an electronic device, and a storage medium. Background Art
[0002] With the development of the times, the application scenarios of camera devices are increasing. 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 communicate directly, which leads to huge resource and information barriers between multiple cameras. The lack of communication between multiple cameras in the same scene may cause the load of the camera to be too high, thereby affecting the task execution efficiency of the camera. Summary of the invention
[0003] The embodiments of the present disclosure provide a resource sharing method, an electronic device, and a storage medium, which are used to ensure the task execution efficiency of a shooting device.
[0004] In one aspect, a resource sharing method is provided, the method comprising:
[0005] Acquire resources required for a target task of the first photographing device;
[0006] Acquire resource information corresponding to at least one second shooting device;
[0007] Determine a target shooting device based on resources required for the target task and resource information corresponding to at least one second shooting device, where the target shooting device is the second shooting device selected to perform the target task;
[0008] 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 a target task based on the shooting information of the first shooting device.
[0009] On the other hand, a resource sharing device is provided, the device comprising:
[0010] A communication module, used to obtain resources required for the target task of the first shooting device;
[0011] The communication module is further used to obtain resource information corresponding to at least one second shooting device;
[0012] A processing module, 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, the target photographing device being the second photographing device selected to perform the target task;
[0013] 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, wherein 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.
[0014] 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.
[0015] 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.
[0016] On the other hand, a computer program product is provided. The computer program product includes computer program instructions. When the computer program instructions are executed, the resource sharing method of any of the above embodiments is implemented.
[0017] In the technical solution provided by the present disclosure, the first camera determines the target camera in at least one second 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, and instructs the target camera to perform the target task based on the shooting information of the first camera. In this way, through the communication between the first camera and the at least one second camera, the first camera can select the target camera to perform the target task, which helps to avoid excessive load on the first camera, thereby ensuring the task execution efficiency of the first camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A schematic diagram of the architecture of a shooting system provided by an embodiment of the present disclosure;
[0019] Figure 2 A schematic diagram of the architecture of another shooting system provided by an embodiment of the present disclosure;
[0020] Figure 3 A flow chart of a resource sharing method provided in an embodiment of the present disclosure;
[0021] Figure 4 A resource sharing method provided in the embodiment of the present disclosure Figure 1 ;
[0022] Figure 5 A resource sharing method provided in the embodiment of the present disclosure Figure 2 ;
[0023] Figure 6A resource sharing method provided in the embodiment of the present disclosure Figure 3 ;
[0024] Figure 7 A resource sharing method provided in the embodiment of the present disclosure Figure 4 ;
[0025] Figure 8 A resource sharing method provided in the embodiment of the present disclosure Figure 5 ;
[0026] Fig. 9 A resource sharing method provided in the embodiment of the present disclosure Figure 6 ;
[0027] Fig.10 A resource sharing method provided in the embodiment of the present disclosure Figure 7 ;
[0028] Fig.11 A schematic diagram of the structure of a resource sharing device provided in an embodiment of the present disclosure;
[0029] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] The following will be combined with the 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 described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0031] 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 three relationships may exist. 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 "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0032] It should be noted that in the present disclosure, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described in the present 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 related concepts in a concrete way.
[0033] With the development of the times, the application scenarios of camera devices are increasing. 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 communicate directly, which leads to huge resource and information barriers between multiple cameras. The lack of communication between multiple cameras in the same scene may cause the load of the camera to be too high, thereby affecting the task execution efficiency of the camera.
[0034] In order to solve the problems existing in the above-mentioned prior art, the present disclosure provides a resource sharing method, in which the first camera determines the target camera in at least one second camera based on the resources required for the acquired target task and the resource information corresponding to each of at least one second camera, and instructs the target camera to perform the target task based on the shooting information of the first camera. In this way, through the communication between the first camera and at least one second camera, the first camera can select the target camera to perform the target task, which helps to avoid the overload of the first camera, thereby ensuring the task execution efficiency of the first camera.
[0035] The resource sharing method provided by the present disclosure can be applied to Figure 1 In the shooting system shown. Figure 1 FIG. 2 shows a schematic diagram of the architecture of a shooting system provided by the present disclosure. Figure 1 As shown, the shooting system includes a plurality of shooting devices, including a first shooting device 11 that receives a target task, and at least one second shooting device 12 other than the first shooting device 11. The first shooting device 11 and the at least one second shooting device 12 are connected by wire or wirelessly.
[0036] In a possible implementation, the resource sharing method disclosed in the present invention can be applied to home security scenarios, community security scenarios, or factory security scenarios, and the present disclosure does not impose specific restrictions on specific application scenarios.
[0037] In some embodiments, the first photographing device 11 and the second photographing device 12 are both photographing devices having wireless communication functions.
[0038] In some embodiments, the first camera 11 and the at least one second camera 12 may establish storage space based on a trans-flash card (TF), a hard disk, or a cloud space.
[0039] For example, assuming that the first camera 11 and at least one second camera 12 both establish storage space through TF cards, and one camera can simultaneously receive video information sent by at most X cameras. At this time, the number of TF cards required can be determined based on the following formula:
[0040]
[0041] In the formula, 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.
[0042] 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, and the present disclosure does not impose any specific restrictions on this.
[0043] Exemplarily, in 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).
[0044] In some embodiments, the first camera 11 and the second camera can be a camera with wireless transceiver function, which can be deployed on land, including indoors or outdoors, handheld, wearable or vehicle-mounted; can also be deployed on the water surface (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 function and camera function, a camera end in industrial control, a camera in self-driving, a camera in remote medical, a camera in smart grid, a camera in transportation safety, a camera in smart city, a camera in smart home, etc. The embodiments of the present disclosure do not limit the application scenarios.
[0045] It should be noted that Figure 1 This is just an exemplary framework diagram. Figure 1The number of devices included in the Figure 1 In addition to the devices shown, the shooting system may also include other devices, such as a server.
[0046] For example, see Figure 2 As shown, Figure 2 FIG. 2 is a schematic diagram showing the architecture of another shooting system provided by the present disclosure. Figure 2 As shown, the shooting system may include a server 13 in addition to the first shooting device 11 and the at least one second shooting device 12. The first shooting device 11 and the at least one second shooting device 12, as well as the first shooting device 11 and the server 13, and the at least one second shooting device 12 and the server 13 may be connected in a wired or wireless manner.
[0047] In some embodiments, server 13 can be an independent server, a server cluster or a 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.
[0048] The present disclosure provides a resource sharing method, which is applied to Figure 1 The first shooting device 11. Figure 3 As shown, the method comprises the following steps:
[0049] S101: Acquire resources required for a target task of a first photographing device.
[0050] 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 period of time, storing an image, or storing audio information within a certain period of time, and the present disclosure does not specifically limit 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 specifically limit this.
[0051] 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.
[0052] In some embodiments, upon receiving the target task, the first photographing device acquires resources required for the target task.
[0053] 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 for 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. In this way, it is helpful for the first camera to 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.
[0054] S102: Obtain resource information corresponding to at least one second shooting device.
[0055] Among them, the 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.
[0056] In some embodiments, upon receiving the target task, the first shooting device obtains resource information corresponding to at least one second shooting device.
[0057] 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, so that when the idle resources of the first camera cannot meet the resources required for the target task, the second camera with a lower resource occupancy rate can be selected to perform the target task.
[0058] 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.
[0059] In some embodiments, the target camera is a second camera selected to perform the target task.
[0060] It is understandable that if the idle resources of the first camera cannot meet the resources required for the target task, the first camera will randomly delegate the target task to a second camera, and the idle resources of the second camera to which the target task is delegated may not necessarily meet the resources required for the target task. Therefore, the first camera needs to determine the target camera from at least one second camera based on the resources required for the target task and the resource information corresponding to each of the at least one second camera.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] For example, assuming that the target task is a storage task, specifically, storing the video information acquired by the first camera within 30 minutes from now on. Within 30 minutes from now on, the first camera shares the video information acquired by the first camera with the target camera, and sends a collaborative work instruction to the target camera to instruct the target camera to store the video information acquired by the first camera within 30 minutes from now on.
[0065] In another exemplary embodiment, assuming that the target task is a calculation task, specifically, calculating the number of teenagers appearing in the video information acquired by the first camera within 30 minutes from now. Within 30 minutes from now, the first camera shares the video information acquired by the first camera with the target camera, and sends a collaborative work instruction to the target camera, so that the target camera calculates the number of teenagers appearing in the next 30 minutes based on the video information acquired by the first camera in the next 30 minutes.
[0066] In the disclosed embodiment, the first camera determines the target camera in at least one second 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, and instructs the target camera to perform the target task based on the shooting information of the first camera. In this way, through the communication between the first camera and the at least one second camera, the first camera can select the target camera to perform the target task, which helps to avoid excessive load on the first camera, thereby ensuring the task execution efficiency of the first camera.
[0067] In one possible implementation, see Figure 4 As shown, the above S102 may include the following steps:
[0068] a1. Send a first message to the second shooting device.
[0069] In some embodiments, the first message is used to request the second camera to send a second message to the first camera. The second message includes a device identifier of the second camera and resource information of the second camera.
[0070] In some embodiments, after receiving the target task, the first photographing device sends a first message to the second photographing device to request the second photographing device to send a second message including the resource information of the second photographing device.
[0071] a2. Receive a second message sent by a second shooting device.
[0072] a3. Obtain resource information corresponding to the second shooting device from the second message.
[0073] 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.
[0074] 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 according to the resource information corresponding to the second shooting device.
[0075] In another possible implementation, see Figure 5 As shown, the above S102 may also include the following steps:
[0076] b1. Receive a second message periodically sent by a second shooting device.
[0077] In some embodiments, the second message is periodically sent by the second shooting device to the first shooting device.
[0078] For example, the second shooting device sends the second message to the first shooting device once every 1 minute.
[0079] b2. Obtain resource information corresponding to the second shooting device from the second message.
[0080] 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.
[0081] In this way, it helps the first shooting device to periodically understand the resource occupancy of the second shooting device, and 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 most recently acquired when the idle resources of the first shooting device cannot meet the target task.
[0082] In yet another possible implementation, see Figure 6 As shown, the above S102 may also include the following steps:
[0083] 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.
[0084] In some embodiments, the change value of the resource occupancy rate is the 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. For example, the resource occupancy rate corresponding to the second message sent by the second camera A last time is 57%, and the resource occupancy rate of the second camera A in the previous cycle is 65.35%. At this time, based on the resource occupancy rate corresponding to the second message sent by the second camera A last time and the resource occupancy rate of the second camera A in the previous cycle, it can be determined that the change value of the resource occupancy rate is 8.35%.
[0085] The resource occupancy rate corresponding to the second message is the average of the resource occupancy rates of each resource in the resource information of the second message. For example, in the resource information of the second message, the neural network processor computing power resource occupancy rate is 56%, the central processing unit computing power resource occupancy rate is 54%, the memory resource occupancy rate is 45%, the storage resource occupancy rate and the network bandwidth resource occupancy rate are 78%, then the occupancy rate corresponding to the second message is 58.25%.
[0086] The resource occupancy rate of the second camera in the previous cycle is the average resource occupancy rate of each hardware of the second camera at the end of the previous cycle. For example, assuming that at the end of the previous cycle, the computing power resource occupancy rate of the neural network processor of the second camera is 50%, the computing power resource occupancy rate of the central processing unit is 70%, and the memory resource occupancy rate is 66%. At this time, it can be determined that the resource occupancy rate of the second camera in the previous cycle is 62%.
[0087] c2. Obtain the resource occupancy rate corresponding to the second shooting device from the second message.
[0088] 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.
[0089] In this way, when the resource occupancy rate of the second camera device changes greatly, the first camera device can timely learn about the resource occupancy of the second camera device.
[0090] According to the above content, it can be known 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.
[0091] In some embodiments, see Figure 7 As shown, 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.
[0092] d1. Determine idle resources of the first shooting device.
[0093] In some embodiments, after receiving the target task, the first shooting device obtains the usage status 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.
[0094] For example, assuming that the computing power of the neural network processor of the first shooting device 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 shooting device A is 2.5GHz, and the current occupancy rate is 30%; the memory size of the first shooting device A is 16GB, and the current amount of memory used is 8GB; the first shooting device A is equipped with a 1TB storage hard disk, and the used storage space is 700GB; the first shooting device A is connected to a 100Mbps network, and the current network traffic is 60Mbps. At this time, it can be determined that the idle resources of the first shooting device 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.
[0095] d2. If the idle resources of the first shooting device do not meet the resources required by the target task, determine the target shooting device based on the resources required by the target task and the resource occupancy rate corresponding to at least one second shooting device.
[0096] 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. The present disclosure does not impose any specific restrictions on the size of the first preset threshold.
[0097] 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.
[0098] This helps to avoid excessive resource usage of the first shooting device, and further helps to ensure load balance between the first shooting device and at least one second shooting device.
[0099] 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.
[0100] In one possible implementation, see Figure 8 As shown, the above S103 may include the following steps:
[0101] e1. For each second shooting device in the at least one second shooting device, based on resource information of the second shooting device and resources required for the target task, determine a resource occupancy rate of the second shooting device when executing the target task.
[0102] 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.
[0103] 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.
[0104] For example, assuming that the resource occupancy rate corresponding to the resource information of the second camera is 50%, the first camera determines that the resource occupancy rate of the target task for the second camera is 12% based on the resource information of the second camera. At this time, based on the resource occupancy rate of the target task for the second camera and the resource information of the second camera, it is determined that the resource occupancy rate of the second camera in the state of executing the target task is 62%.
[0105] e2. Determine a target shooting device based on the resource occupancy rate of at least one second shooting device when executing the target task.
[0106] This helps to select a second shooting device with a lower resource occupancy rate when executing a target task as a target shooting device from 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.
[0107] In one possible implementation, see Fig. 9 As shown, the above e2 may include the following steps:
[0108] 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.
[0109] It should be understood that the search is performed in the order of resource occupancy rate from small to large when executing the target task. Once a second camera having a resource occupancy rate less than the first preset threshold is found, the first camera can immediately stop searching without continuing to check the remaining second cameras. In this way, the number of searches can be greatly reduced and the search efficiency can be improved.
[0110] 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 order of priority from high to low.
[0111] 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.
[0112] The priority of the second shooting device and the resource occupancy rate corresponding to the reference resource in the resource occupancy rate corresponding to the second shooting device satisfy a negative correlation relationship.
[0113] f2. The second photographing device found for the first time is used as the target photographing device.
[0114] 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.
[0115] 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.
[0116] 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 situation where the shooting device fails or crashes due to insufficient resources when executing the target task.
[0117] See also Fig.10 As shown, after the above S104, the technical solution provided by the present disclosure further includes the following steps:
[0118] S201, receiving task execution result information sent by the target shooting device.
[0119] The task execution result information is used to indicate the result of the target shooting device executing the target task.
[0120] For example, assuming that the target task is a storage task, specifically storing audio information acquired by the first shooting device within 20 minutes from now on, the task execution result information may be the audio information indicated by the target task that has been stored by the target shooting device.
[0121] For another example, suppose the target task is a calculation task, specifically, to calculate the number of people with blond hair based on the video information acquired by the first shooting device within 10 minutes from now on. In this case, the task execution result information may be that there are 13 people with blond hair in the video information acquired by the first shooting device within 10 minutes from now on.
[0122] 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.
[0123] As an example, the resource sharing method provided by the present disclosure may specifically include the following steps:
[0124] Step 1: Receive and execute the target task.
[0125] Step 2: Obtain resources required for the target task; obtain resource information of at least one second shooting device.
[0126] 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.
[0127] Step 4: Based on the resource occupancy rate of at least one second camera in the state of executing the target task, search for a second camera whose resource occupancy rate is less than the first preset threshold value from at least one second camera in the state of executing the target task. If at least one second camera includes a second camera whose resource occupancy rate is less than the first preset threshold value in the state of executing the target task, proceed to step 5; if the target camera is not found in at least one second camera, issue a prompt message to prompt that the target task is rejected.
[0128] Step 5: Use the second shooting device found for the first time as the target shooting device.
[0129] 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.
[0130] Step 7: Receive the task execution result information sent by the target shooting device.
[0131] The above mainly introduces the scheme of the embodiment of the present disclosure from the perspective of the 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 implementations thereof. It can be understood that in order to implement the resource sharing method, the resource sharing device includes a hardware structure and / or software module corresponding to 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.
[0132] The embodiments of the present disclosure may divide the resource sharing device into functional modules according to the above method embodiments. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one functional module. The above integrated modules may be implemented in the form of hardware or software. It should be noted that the division of modules in the embodiments 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.
[0133] Fig.11 2 is a schematic diagram of a resource sharing device provided by an embodiment of the present disclosure. The resource sharing device 20 includes: a communication module 21 and a processing module 22.
[0134] The communication module 21 is used to obtain the resources required for the target task of the first shooting device;
[0135] The communication module 21 is further used to obtain resource information corresponding to at least one second shooting device;
[0136] A processing module 22, 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, the target photographing device being the second photographing device selected to perform the target task;
[0137] The communication module 21 is further 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, wherein the collaborative work instruction is used to instruct the target shooting device to perform a target task based on the shooting information of the first shooting device.
[0138] 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.
[0139] 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 when executing a 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 when executing the target task.
[0140] In some other embodiments, the processing module 22 is specifically used to search for a second shooting device whose resource occupancy rate when 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 rates corresponding to at least one second shooting device when executing the target task; and use the second shooting device found for the first time as the target shooting device.
[0141] 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 by 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.
[0142] In some other embodiments, the communication module 21 is specifically used to send a first message to a 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 identification of the second shooting device and 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 resource information corresponding to the second shooting device from the second message.
[0143] In some further embodiments, the communication module 21 is specifically used to receive a second message periodically sent by a 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.
[0144] In some other 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 to 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.
[0145] In some other embodiments, the communication module 21 is further used to send a prompt message when the target shooting device is not found in at least one second shooting device, and the prompt message is used to indicate that the target task is refused to be executed.
[0146] In some other embodiments, the communication module 21 is further used 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.
[0147] In yet other embodiments, the target task includes a storage task or a computing task.
[0148] In the case of implementing the functions of the above-mentioned integrated modules in the form of hardware, the embodiment of the present disclosure also provides a possible structure of an electronic device, which is used to execute the resource sharing method provided by the embodiment of the present disclosure. Fig.12 As shown, the electronic device 300 includes: a communication interface 303, a processor 302 and a bus 304. Optionally, the electronic device may further include a memory 301.
[0149] The processor 302 may be a processor that implements or executes various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of the present disclosure. The 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 devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of the present disclosure. The processor 302 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0150] The communication interface 303 is used to connect with other devices via a communication network, such as Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0151] The memory 301 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices 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 codes in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0152] As a possible implementation, the memory 301 may exist independently of the processor 302, and the memory 301 may 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.
[0153] In another possible implementation, the memory 301 may also be integrated with the processor 302 .
[0154] The bus 304 may be an extended industry standard architecture (EISA) bus, etc. The bus 304 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0155] Some embodiments of the present disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium), in which computer program instructions are stored. When the computer program instructions are executed on a computer, the computer executes the resource sharing method as described in any of the above embodiments.
[0156] In an exemplary implementation, the computer may be the resource sharing device described above, and the present disclosure does not limit the specific form of the computer.
[0157] In some examples, the above-mentioned computer-readable storage media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes, etc.), optical disks (e.g., compact disks (CD), digital versatile disks (DVD), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks, or key drives, etc.). The various computer-readable storage media described in the present 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.
[0158] The embodiment of the present disclosure provides a computer program product including 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.
[0159] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A resource sharing method, It is characterized in that Applied to a first photographing device, the method includes: 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, It is characterized in that The resource information includes at least one of the following: the computing power resource occupancy rate of the neural network processor, the computing power resource occupancy rate of the central processing unit, the memory resource occupancy rate, the storage resource occupancy rate and the 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, It is characterized in that 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, It is characterized in that 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, It is characterized in that 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, It is characterized in that 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 identification 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, It is characterized in that 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, It is characterized in that 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, It is characterized in that 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, It is characterized in that 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, It is characterized in that The target task includes a storage task or a computing task.
12. An electronic device, It is characterized in that 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, It is characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 11.