Algorithm running method, electronic equipment and computer readable medium

By introducing decoupling design between basic components and management components in smart devices, the registration and callback of business components are realized, and the resource waste caused by independent business function packages is solved and resource utilization is improved.

CN120335879APending Publication Date: 2025-07-18ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410062934.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-16
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In smart devices, independent business function algorithm packages lead to waste of resources and cannot effectively share computing resources.

Method used

Through the decoupling design of basic components and management components, the registration and callback mechanism of business components is realized, so that each business component can share target business data and avoid repeated calculations.

Benefits of technology

This improves the resource utilization rate of equipment, especially the resource utilization rate of IPU, and reduces the utilization of equipment resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335879A_ABST
    Figure CN120335879A_ABST
Patent Text Reader

Abstract

The invention provides an algorithm operation method. The algorithm operation method comprises the steps that a basic component calls back target business data to a plurality of registered business components through a management component; wherein the basic component, the management component and the plurality of service components are mutually decoupled; and the multiple service components operate according to the target service data to obtain a target operation result. The invention further provides electronic equipment and a computer readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and particularly to an algorithm running method, an electronic device, and a computer-readable medium. Background Art

[0002] Currently, many service functions are available in intelligent devices. These service functions are all independent algorithm packages. After a user subscribes to a relevant service function, it is downloaded to the corresponding intelligent device and runs independently. Data cannot be shared, which causes resource waste for intelligent devices with limited computing resources.

[0003] For example, the AI functions of an AI (Artificial Intelligence) cloud camera all exist on an AI algorithm mall. The user needs to purchase an AI package in the AI algorithm mall and then subscribe to the AI functions included in the AI package. The algorithms corresponding to each AI function in the AI package are all independent algorithm packages in the algorithm mall. After the function is subscribed, it is downloaded to the corresponding cloud camera and runs independently. Data cannot be shared, resulting in the inability to make good use of the resources in the cloud camera and causing resource waste. Summary of the Invention

[0004] Embodiments of the present disclosure provide an algorithm running method, an electronic device, and a computer-readable medium.

[0005] In a first aspect, embodiments of the present disclosure provide an algorithm running method, which includes:

[0006] A basic component callbacks target service data to a plurality of registered service components through a management component; wherein, the basic component, the management component, and the plurality of service components are decoupled from each other;

[0007] The plurality of service components run according to the target service data to obtain a target running result.

[0008] In a second aspect, embodiments of the present disclosure provide an electronic device, including:

[0009] One or more processors;

[0010] A memory storing one or more programs thereon. When the one or more programs are executed by the one or more processors, the one or more processors implement the algorithm running method described in the first aspect.

[0011] In a third aspect, embodiments of the present disclosure provide a computer-readable medium storing a computer program thereon. When the program is executed by a processor, the algorithm running method described in the first aspect is implemented.

[0012] The algorithm running method provided by the embodiments of the present disclosure enables the basic component to call back target service data to each registered service component through the management component based on the service association relationship between each service component and the basic component, so that each service component can share the target service data, improving the resource utilization rate of the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a flowchart of an algorithm running method provided by an embodiment of the present disclosure;

[0014] Figure 2 It is a schematic diagram of the business parameter distribution process provided by an embodiment of the present disclosure;

[0015] Figure 3 It is a schematic structural diagram of an algorithm running system provided by an embodiment of the present disclosure;

[0016] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure;

[0017] Figure 5 It is a schematic structural diagram of a computer-readable medium provided by an embodiment of the present disclosure;

[0018] Figure 6 It is a schematic flowchart of the algorithm running method in a specific example provided by an embodiment of the present disclosure;

[0019] Figure 7 It is a schematic structural diagram of the algorithm running system in a specific example provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0020] To enable those skilled in the art to better understand the technical solutions of the present disclosure, the control method of the control, the electronic device, and the computer-readable medium provided by the present disclosure will be described in detail below with reference to the accompanying drawings.

[0021] In the following, example embodiments will be described more fully with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0022] In the case of no conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.

[0023] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0024] The terms used in this disclosure are only for describing specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprises" and / or "consists of" are used in this specification, the specified features, wholes, steps, operations, elements, and / or components are present, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups thereof.

[0025] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.

[0026] Figure 1 The flowchart of an algorithm running method provided for the embodiments of the present disclosure. In a first aspect, with reference to Figure 1 , the embodiments of the present disclosure provide an algorithm running method, wherein the method includes:

[0027] S1. The basic component calls back the target service data to multiple registered service components through the management component; wherein, the basic component, the management component, and the multiple service components are decoupled from each other;

[0028] S2. The multiple service components run according to the target service data to obtain a target running result.

[0029] In the embodiments of the present disclosure, the service component is a component with different service functions. The management component is used to manage each service component. The basic component is used to receive the data to be processed from the lower layer, and after processing these data, obtain the target service data required by multiple service components. Among them, the target service data in the basic component can be shared with the registered service components through the management component. In some embodiments, managing each service component may be managing the loading or unloading of each service component, or managing the registration of each service component in the basic component, etc., and the present disclosure is not limited thereto.

[0030] Each service component having a service association relationship with the basic component can be registered in the basic component through the management component. The basic component calls back the target service data to each registered service component through the management component, so that each service component can share the target service data, without repeated calculation, reducing the occupation of device resources and effectively improving the resource utilization rate of the IPU (Intelligence Processing Unit) in the device.

[0031] Among them, the basic component, the management component, and each business component are all decoupled algorithms that run independently. That is to say, these algorithm components are independent of each other, without direct dependencies or interactions. When these components independently process their respective tasks, the running process will not be affected by other independent components.

[0032] In some embodiments, if the business corresponding to the business component is image processing, the business functions corresponding to the business component can be at least one of human body detection, area intrusion, passenger flow statistics, face capture, license plate capture, face surveillance, and license plate surveillance.

[0033] It should be noted that among the registered business components in the same basic component, there is a correlation, which means that these business components have common required data.

[0034] In some embodiments, before S1, it further includes:

[0035] S0. In response to the business function start instruction, the management component loads the business component corresponding to the business function start instruction.

[0036] In the embodiments of the present disclosure, since each component is a decoupled algorithm, during the algorithm operation process, the management component can dynamically load newly added business components in response to the business function start instruction. In some embodiments, the business function start instruction is sent by the client.

[0037] It should be noted that when loading the business component, since the business component has been pre-downloaded in the system, there is no need to re-download the business component, nor to re-register the business component in the basic component, and the business component can run directly.

[0038] In some embodiments, after S0, it further includes:

[0039] The management component registers the business component corresponding to the business function start instruction in the basic component.

[0040] The registration in this embodiment means that the management component provides the callback function corresponding to the business component to the basic component, so that the basic component can call the callback function to send the target business data to the business component after obtaining the target business data. There is a business association between the business component and the basic component. Through the business association relationship between each business component and the basic component, the basic component calls back the target business data to each registered business component through the management component, so that each business component can share the target business data, improving the resource utilization rate of the device. In this case, registering the business component in the basic component can more effectively utilize the computing power resources when each business component runs independently.

[0041] In one example, the service corresponding to the service component is image processing. The basic component is used to perform human detection on the collected video stream data to obtain the human detection result in the video stream picture. The service function corresponding to the first service component is human detection, the service function corresponding to the second service component is area intrusion, the service function corresponding to the third service component is passenger flow statistics, the service function corresponding to the fourth service component is face capture, and the service function corresponding to the fifth service component is license plate capture. Among them, since there is a service association relationship among the service functions corresponding to the first service component, the second service component, and the third service component, that is, human detection is to be performed using the video stream data, after the first service component, the second service component, and the third service component are loaded, the management component registers these service components in the basic component so that the human detection result obtained by the basic component can be shared by these service components.

[0042] In some embodiments, after S0, it further includes:

[0043] In response to the service function closing instruction, the management component unloads the service component corresponding to the service function closing instruction from the multiple service components it manages.

[0044] In the embodiments of the present disclosure, since each component is an independent decoupled algorithm, the management component can dynamically unload the service component in response to the service function closing instruction during the algorithm operation. In some embodiments, the service function closing instruction is issued by the client.

[0045] It should be noted that after the service component is unloaded, the service component is still registered in the basic component. The service component can be reloaded through the service function opening instruction. At this time, there is no need to re-download the service component, nor to re-register the service component in the basic component, and the service component can run directly.

[0046] In some embodiments, the target service data is a face detection result;

[0047] Before S1, it further includes:

[0048] The basic component acquires video stream data;

[0049] The basic component performs detection processing on the video stream data to obtain a face detection result.

[0050] In this embodiment, the type of the target service data is not specifically limited. In the case where the target service data is a face detection result, the basic component acquires video stream data and performs detection processing on the video stream data to obtain a face detection result, and this face detection result can be shared and used by multiple service components that have been registered in the basic component.

[0051] In some examples, the target service data may also be a human detection result, a license plate detection result, a building detection result, etc.

[0052] In some embodiments, before S1, it further includes:

[0053] Receiving service parameters sent by the client through the middleware;

[0054] Inputting the service parameters into at least one of the basic component, the management component, and the multiple service components.

[0055] In some embodiments, after S2, it further includes:

[0056] The multiple service components feedback the target operation result to the client through the middleware.

[0057] In this embodiment, the middleware is used to bridge the firmware with the basic component, the management component, and each service component. The middleware is integrated in the algorithm process corresponding to the firmware. The firmware here refers to the firmware that downloads and runs the algorithm operation system. The present disclosure does not make special limitations on the firmware, and it can be a camera, a server, etc.

[0058] In some embodiments, since the basic component, the management component, the multiple service components, etc. may need to run according to different configuration information (i.e., service parameters) of different users, relevant service parameters can be provided to the algorithm processes corresponding to these components through the middleware according to the operations of the user on the client, so that these components run according to the user's needs. In one example, the basic component is used to detect a video stream to obtain a human detection result. The user adds a marking box to a partial range in the image corresponding to a frame of the video stream, and the marking box defines the position range information to be detected (i.e., service parameter), and this position range information is used as an input parameter of the basic component.

[0059] Figure 2 It is a schematic diagram of the service parameter distribution process provided by the embodiments of the present disclosure. Refer to Figure 2 , as an exemplary embodiment, the algorithm operation system is used to read, analyze, and identify a video stream or a video file, and report the identification result to the middleware. The algorithm operation system includes a basic component, a management component, multiple service components, etc.

[0060] The algorithm management process module is used to manage the algorithm processes of the algorithm operation system according to the scheduling of the middleware. Among them, the scheduling process includes starting and stopping the algorithm operation system, etc.

[0061] The middleware is integrated into the algorithm process corresponding to the camera firmware. The middleware can call the corresponding API (Application Programming Interface) to interact with the algorithm operation system. When the middleware receives the service parameters uploaded by the client, the middleware distributes the service parameters to the algorithm operation system.

[0062] In some embodiments, the algorithm operation method further includes:

[0063] In response to a deletion instruction, delete the basic component, the management component, and the multiple service components.

[0064] In this embodiment, deleting a component refers to the process of completely removing the component and all its related files and configurations from the system. If it is necessary to restart the service function of the component, it is necessary to re-download (for service components, it is also necessary to re-register the service component in the basic component). It can be decided whether to delete or uninstall the service component according to the user requirements of the client.

[0065] In some embodiments, the algorithm operation method further includes:

[0066] In response to a download instruction, download the basic component, the management component, and the multiple service components.

[0067] In this embodiment, downloading a service component refers to adding a component that did not exist originally in the system, so it is necessary to re-download. For a service component, it is also necessary to re-register the service component in the basic component.

[0068] Figure 3 It is a schematic structural diagram of the algorithm operation system provided by the embodiments of the present disclosure. Refer to Figure 3 , as an exemplary embodiment, the algorithm operation system includes:

[0069] A basic component, a management component, and multiple service components;

[0070] Among them, the basic component callbacks target service data to the multiple registered service components through the management component; among them, the basic component, the management component, and the multiple service components are all decoupled algorithms. There is a service association relationship between the multiple registered service components and the basic component. The target service data is the data commonly required by the multiple service components; the multiple service components run according to the target service data to obtain a target operation result.

[0071] The embodiments of the present disclosure do not impose special limitations on the operating environment of the algorithm running system. It can be applied to the AI algorithm mall of cloud cameras, or to the AI algorithms corresponding to other firmware of non-cloud cameras, or to the AI algorithms deployed on the server side.

[0072] As an exemplary embodiment, referring to Figure 3 , the algorithm running system is applied to the AI algorithm of cloud cameras. The algorithm running system includes a basic component, a management component, and multiple service components.

[0073] Among them, the service functions corresponding to the service components include human detection, area intrusion, passenger flow statistics, etc.

[0074] The basic component is used to implement loading inference and target tracking in the AI algorithm of the cloud camera. The basic component receives the video stream collected by the cloud camera, analyzes the video stream to obtain the target tracking result, and transmits the target tracking result to the registered service components through the callback interface to achieve the sharing of the target tracking result. These registered service components have business association relationships.

[0075] The management component is used to manage the loading and unloading of the AI service layer (i.e., each service component) so that the service functions of the cloud camera can be dynamically loaded or unloaded.

[0076] In the above embodiments of the present disclosure, by registering each service component having a business association relationship with the basic component, the basic component calls back the target service data to each registered service component through the management component, so that each service component can share the target service data without repeated calculation, reducing the occupation of device resources and effectively improving the resource utilization rate of the IPU in the device.

[0077] In a second aspect, referring to Figure 4 , the embodiments of the present disclosure provide an electronic device, which includes:

[0078] One or more processors 401;

[0079] A memory 402, on which one or more programs are stored. When the one or more programs are executed by the one or more processors, the one or more processors implement the algorithm running method of any one of the above.

[0080] One or more I / O interfaces 403, connected between the processor and the memory, configured to implement information interaction between the processor and the memory.

[0081] Among them, the processor 401 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory 402 is a device with data storage capabilities, including but not limited to a random access memory (RAM, more specifically such as SDRAM, DDR, etc.), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), and a flash memory (FLASH); the I / O interface (read / write interface) 403 is connected between the processor 401 and the memory 402 and can realize the information interaction between the processor 401 and the memory 402, including but not limited to a data bus (Bus), etc.

[0082] In a third aspect, referring to Figure 5 , an embodiment of the present disclosure provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, it implements any one of the above algorithm running methods.

[0083] In order to enable those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present disclosure, the following uses specific embodiments to detail the technical solutions provided by the embodiments of the present disclosure:

[0084] Figure 6 It is a schematic flowchart of an algorithm running method in a specific example provided by an embodiment of the present disclosure. Referring to Figure 2 and 6 , the algorithm running system is stored in a server in the cloud. The algorithm running system includes basic components, management components, and multiple service components. Among them, the service function corresponding to the service component is an AI function, and multiple service components form an AI package. A user of the client can determine one or more service components to be run by selecting an AI package. The middleware needs to be integrated into the camera firmware, and the middleware is used to bridge the algorithm running system and the camera manufacturer's firmware. The cloud camera starts an algorithm management process for scheduling the algorithm processes of the algorithm running system, and the scheduling content includes starting and stopping. The algorithm running process in the cloud camera is as follows:

[0085] Step 601: Integrate the middleware in the cloud camera, start the algorithm management process of the algorithm running system in the cloud camera. The processing result of the algorithm running system in the cloud camera is transparently transmitted to the upper-layer service through the middleware, and at the same time, the parameters of the upper-layer service are sent to the algorithm running system through the middleware.

[0086] Step 602: The user selects an AI package to be bound or an AI package to be unbound. Send a binding AI package instruction to the cloud server through the client to run the service components corresponding to the AI package. Or send an unbinding AI package instruction to the cloud server through the client to suspend the operation of the service components corresponding to the AI package.

[0087] Step 603: In response to the AI package binding or unbinding instruction, the cloud camera downloads or deletes the algorithm package corresponding to the algorithm running system from the cloud server.

[0088] Step 604: After downloading the algorithm package of the algorithm running system, the cloud camera starts the algorithm process of the algorithm running system.

[0089] Step 605: The user selects the AI function to be turned on or off. The client sends an instruction to start the service function to the cloud server to start running the service component corresponding to the AI function. Or the client sends an instruction to close the service function to the cloud server to pause the operation of the service component corresponding to the AI function.

[0090] Step 606: In response to the instruction to start or close the service function, the management component in the cloud camera can dynamically load or unload the service component corresponding to the AI function.

[0091] Through the algorithm running system in which each component of the cloud camera runs independently, the resources in the cloud camera can be well utilized. The AI function of the cloud camera has the advantages of low IPU resource consumption and high integration efficiency during operation, improving the competitiveness of the cloud camera.

[0092] Figure 7 It is a schematic structural diagram of the algorithm running system in a specific example provided by this embodiment of the disclosure. Refer to Figure 7 , the algorithm running system is stored in the cloud server. The algorithm running system includes: a service docking layer, a service module layer, a service module management layer, a basic component layer, an HAL (Hardware Abstraction Layer) layer interface, and an input medium layer.

[0093] Among them, the intake medium in the input medium layer is the data processed in the cloud camera, which can be a real-time video stream or a video file.

[0094] The HAL layer interface is used to abstract functions such as image acquisition, image release, IPU initialization and de-initialization, so as to isolate the interface changes caused by the differences in cloud cameras.

[0095] The basic components corresponding to the basic component layer exist in the form of independent secondary processes. This layer mainly performs the loading and inference of algorithm models and target tracking processing, and provides the registration of business components and callback interfaces to the business module layer to achieve data sharing of target tracking results. If the basic components are used to detect people, vehicles, and non-target objects in the collected video stream, the target tracking results obtained by the basic components through video stream inference and tracking can be used by multiple business components involved in business related to the detection of people, vehicles, and non-target objects, such as business components for human detection, area intrusion, passenger flow statistics, and stay warning.

[0096] The management components corresponding to the business module management layer also exist in the form of independent secondary processes. This layer mainly manages the loading or unloading of each business component, and can realize the dynamic loading or unloading of business components corresponding to different business functions during the operation of the cloud camera.

[0097] The business module layer is the specific implementation of business functions, which can be human detection, area intrusion, passenger flow statistics, etc. Each business component depends on the target tracking results of the basic component layer. After registering with the basic component layer through the registration interface, the target tracking results of the basic component layer can be shared with each business component by calling the callback interface. Among them, each business component runs independently.

[0098] The business docking layer encapsulates the external interfaces of each business component in the business module layer, including: parameter distribution, registration, deregistration and other interfaces. The middleware realizes the interaction with the algorithm operation system through these interfaces.

[0099] Each business component in the above embodiments runs independently. During the implementation of its business function, the target tracking results of the basic component layer are required, that is, the results of detecting people, vehicles, and non-target objects in the collected video stream. These business components do not need to recalculate the target tracking results, effectively improving the resource utilization rate of the IPU in the cloud camera.

[0100] Those of ordinary skill in the art will understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations. In the hardware implementation, the division between the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be executed by several physical components in cooperation. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or can be implemented as hardware, or can be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory, or other memory technologies, CD-ROM, digital versatile disk (DVD), or other optical disk storage, magnetic cassettes, tapes, magnetic disk storage, or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, a communication medium typically contains computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.

[0101] Example embodiments have been disclosed herein, and although specific terms have been employed, they are used for and should be construed only for general illustrative purposes and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in connection with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in connection with other embodiments. Accordingly, those skilled in the art will understand that various forms and details may be changed without departing from the scope of the disclosure as set forth in the appended claims.

Claims

1. An algorithm running method, wherein, The method includes: The basic component calls back target service data to multiple registered service components through the management component; wherein, the basic component, the management component, and the multiple service components are decoupled from each other; The multiple service components operate according to the target service data to obtain a target operation result.

2. The algorithm running method according to claim 1, wherein, Before the basic component calls back the target service data to the multiple registered service components through the management component, it further includes: In response to an instruction to enable a service function, the management component loads the service component corresponding to the instruction to enable the service function.

3. The algorithm running method according to claim 2, wherein, After the management component loads the service component corresponding to the instruction to enable the service function, it further includes: The management component registers the service component corresponding to the instruction to enable the service function in the basic component.

4. The algorithm running method according to claim 2, wherein, After the management component loads the service component corresponding to the instruction to enable the service function, it further includes: In response to an instruction to disable a service function, the management component unloads the service component corresponding to the instruction to disable the service function from the multiple service components it manages.

5. The algorithm running method according to claim 1, wherein, The target service data is a face detection result; Before the basic component calls back the target service data to the multiple registered service components through the management component, it further includes: The basic component acquires video stream data; The basic component performs detection processing on the video stream data to obtain a face detection result.

6. The algorithm running method according to claim 1, wherein, Before the basic component calls back the target service data to the multiple registered service components through the management component, it further includes: Receive service parameters sent by the client through the middleware; Input the service parameters into at least one of the basic component, the management component, and the multiple service components.

7. The algorithm running method according to claim 1, wherein, After the multiple service components operate according to the target service data to obtain a target operation result, it further includes: The multiple service components feedback the target operation result to the client through the middleware.

8. The algorithm running method according to claim 1, wherein, It further includes: In response to a deletion instruction, delete the basic component, the management component, and the multiple service components.

9. An electronic device, including: One or more processors; A memory, on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the algorithm operation method according to any one of claims 1 to 8.

10. A computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, it implements the algorithm operation method according to any one of claims 1 to 8.