Algorithm management method, algorithm management system and related device
By receiving and loading target algorithm packages that do not exist locally in the terminal device and recording function configuration information, the problem of low storage space utilization in the prior art is solved, and the effect of adding algorithm functions under limited storage space is achieved.
Patent Information
- Application Number
- CN202411756674.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, the storage space utilization rate of terminal devices is low because each functional algorithm corresponds to an algorithm package, resulting in a limited number of supported algorithm functions at the same size of Flash capacity.
By receiving download data of the algorithm function to be enabled, obtaining and loading target algorithm packages that do not exist locally, and recording function configuration information, to realize that multiple algorithm functions share one or more algorithm packages, thereby saving storage space.
It improves the storage space utilization rate of terminal devices, increases the number of algorithm functions under limited storage space, and increases the functional strength of terminal devices.
Smart Images

Figure CN119806664A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of algorithm configuration, and in particular to an algorithm management method and its system and related devices. Background Art
[0002] In the prior art, a variety of terminal devices support the algorithm mall function, which can empower the terminal device to support different types of algorithm functions. Through downloading and uninstalling operations, the target object can experience the functions of different algorithms. However, the existing technical solution usually corresponds to one algorithm package for each functional algorithm, for example, 10 algorithm functions correspond to 10 algorithm packages. This method limits the number of algorithm functions that the terminal device can support under the same Flash capacity, resulting in the problem of low storage space utilization of the terminal device. Summary of the invention
[0003] The present application at least provides an algorithm management method and its system, and related devices, which can improve the utilization rate of the storage space of the terminal device.
[0004] A first aspect of the present application provides an algorithm management method, which includes: a terminal device receives download data of a first algorithm function to be enabled, wherein the download data can indicate several target algorithm packages used by the first algorithm function, and the download data includes a first target algorithm package, which is a target algorithm package that does not currently exist locally on the terminal device; obtains the first target algorithm package in the download data and loads it locally; and, based on the download data, records function configuration information of the first algorithm function, wherein the function configuration information includes first configuration information characterizing a mapping relationship between the first algorithm function and the several target algorithm packages, and the function configuration information is used to find several target algorithm packages locally to enable the first algorithm function.
[0005] Among them, the first configuration information includes the function identifier of the first algorithm function and the package identifier of each target algorithm package; the function configuration information also includes the second configuration information, and the second configuration information includes the dedicated function configuration of the first algorithm function.
[0006] Among them, the function identifier of the first algorithm function includes at least one of the name and identification number of the first algorithm function; and / or, the first configuration information also includes the algorithm type to which the first algorithm function belongs, and the algorithm type includes at least one of a video algorithm and an audio algorithm; and / or, the first configuration information is stored in a first configuration file, and the first configuration file records the first configuration information of each algorithm function in the terminal device; and / or, the second configuration information includes the algorithm alarm linkage content and algorithm rule content of the first algorithm function; and / or, the second configuration information is stored in a second configuration file, and the second configuration file records the second configuration information of each algorithm function in the terminal device.
[0007] Among them, the target algorithm package currently existing locally in the terminal device is the second target algorithm package; after receiving the download data of the first algorithm function to be enabled, it also includes: recording the package configuration information of each first target algorithm package in a third configuration file, wherein the third configuration file records the package configuration information of each algorithm package currently existing locally in the terminal device, the package configuration information includes package information and local usage count, the local usage count indicates the number of algorithm functions of the algorithm package currently used in the terminal device, the package information includes the package identifier of the algorithm package and at least one of the local storage path; and, updating the local usage count of each second target algorithm package in the third configuration file.
[0008] The downloaded data includes several target algorithm packages; obtaining the first target algorithm package in the downloaded data and loading it locally includes: obtaining several target algorithm packages from the downloaded data; selecting the first target algorithm package from the several target algorithm packages and loading it locally.
[0009] Among them, before obtaining several target algorithm packages from the downloaded data, it includes: obtaining the function identifier and the first version of the first algorithm function corresponding to the downloaded data; searching the configuration file for the second version of the algorithm package that has a mapping relationship with the function identifier; performing version verification based on the first version and the second version, and if the version verification passes, downloading the target algorithm package that has a mapping relationship with the function identifier.
[0010] Among them, the target algorithm package currently existing locally in the terminal device is the second target algorithm package; after receiving the download data of the first algorithm function to be enabled, it also includes: deactivating each second target algorithm package currently enabled by the terminal device; after obtaining several target algorithm packages from the downloaded data, it also includes: reloading each second target algorithm package.
[0011] Among them, the downloaded data includes a composite algorithm package that packages several target algorithm packages, and obtaining several target algorithm packages from the downloaded data includes: decompressing the composite algorithm package to obtain several target algorithm packages; or, the downloaded data includes compressed target algorithm packages sent sequentially by the cloud, and the sending order of each target algorithm package is related to the dependency relationship of each target algorithm package; obtaining several target algorithm packages from the downloaded data includes: decompressing each target algorithm package in sequence.
[0012] Among them, before decompressing the composite algorithm package to obtain several target algorithm packages, it also includes: in response to a power outage during the downloading of the composite algorithm package, when the current downloaded amount of the composite algorithm package is greater than a first ratio, deleting the downloaded common algorithm package in the composite algorithm package; when the current downloaded amount of the composite algorithm package is not greater than the first ratio, not deleting the downloaded common algorithm package in the composite algorithm package; wherein the common algorithm package is an algorithm package that currently exists locally; in response to a network disconnection during the downloading of the composite algorithm package, when the current downloaded amount of the composite algorithm package is greater than a second ratio, performing decompression of the composite algorithm package and subsequent steps; when the current downloaded amount of the composite algorithm package is not greater than the second ratio, determining that the download of the first algorithm function has failed.
[0013] The method further includes: in response to receiving an uninstall instruction for the second algorithm function, deleting the function configuration information of the second algorithm function; wherein the uninstall instruction is generated by the target object performing an uninstall operation on the second algorithm function; or, the uninstall instruction is generated by the terminal device when it detects that the algorithm package used by the third algorithm function is locally missing when the third algorithm function is enabled, and the second algorithm function is each algorithm function related to the algorithm package that is locally missing in the terminal device.
[0014] Among them, the terminal device stores a third configuration file, and the third configuration file records the package configuration information of each algorithm package currently existing locally in the terminal device, and the package configuration information includes a local usage count, and the local usage count indicates the number of algorithm functions currently using the algorithm package in the terminal device; in response to receiving an uninstall instruction for the second algorithm function, the method also includes: updating the local usage count of each algorithm package used by the second algorithm function in the third configuration file; in response to the presence of invalid algorithm packages in the algorithm packages used by the second algorithm function, deleting the invalid algorithm packages, wherein the invalid algorithm package is an algorithm package whose local usage count after update is 0.
[0015] The second aspect of the present application provides a terminal device, including: a first configuration file, the first configuration file records first configuration information of each algorithm function in the terminal device, wherein the first configuration information represents a mapping relationship between the first algorithm function and a plurality of target algorithm packages, and the first algorithm function represents an algorithm function of the terminal device receiving downloaded data to be enabled; a second configuration file, the second configuration file records second configuration information of each algorithm function in the terminal device, wherein the second configuration information includes a dedicated function configuration of the first algorithm function; a third configuration file, the third configuration file records package configuration information of each algorithm package currently existing locally in the terminal device, wherein the package configuration information includes package information and a local usage count, the local usage count represents the number of algorithm functions of the algorithm package currently used in the terminal device, and the package information includes a package identifier of the algorithm package and at least one of a local storage path.
[0016] The third aspect of the present application provides an algorithm management system, including a cloud and a terminal device of the second aspect, wherein the cloud is communicatively connected with the terminal device, wherein the cloud is used to generate download data of the algorithm function that the terminal device needs to download and send it to the terminal device; the terminal device is used to receive the download data to implement the deployment of the algorithm function.
[0017] Among them, the terminal device is also used to: receive the function identifier and the first version of the algorithm function corresponding to the download data sent from the cloud; search for the second version of the algorithm package that has a mapping relationship with the function identifier from the configuration file; perform version verification based on the first version and the second version, and if the version verification passes, download the algorithm package that has a mapping relationship with the function identifier.
[0018] A fourth aspect of the present application provides an electronic device, comprising a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the algorithm management method in the first aspect.
[0019] A fifth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, which implement the algorithm management method in the above-mentioned first aspect when the program instructions are executed by a processor.
[0020] In the above scheme, the terminal device receives download data of the first algorithm function to be enabled, obtains the first target algorithm package that does not currently exist locally in the terminal device through the download data, and records the function configuration information of the first algorithm function through the download data, and uses the function configuration information to find out several target algorithm packages locally, combines the first target algorithm package and the found target algorithm packages to enable the first algorithm function, downloads the algorithm package that does not exist locally in the terminal device, and combines with other locally existing algorithm packages to jointly implement an algorithm function, thereby saving the storage space of the terminal device and improving the utilization rate of the storage space.
[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0023] Figure 1 It is a schematic diagram of the framework of an embodiment of a terminal device of the present application;
[0024] Figure 2 It is a flowchart of an embodiment of the algorithm management method of the present application;
[0025] Figure 3It is a schematic diagram of the framework of an embodiment of the composite algorithm of the present application;
[0026] Figure 4 It is a flowchart of another embodiment of the algorithm management method of the present application;
[0027] Figure 5 It is a schematic diagram of the framework of an embodiment of the algorithm management system of the present application;
[0028] Figure 6 It is a schematic diagram of the framework of an embodiment of the algorithm management device of the present application;
[0029] Figure 7 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0030] Figure 8 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0031] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0032] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0033] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previously associated objects are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B and C.
[0034] In the existing technical solutions, different algorithms can be downloaded or uninstalled through the algorithm mall for the terminal device, so that the target object can experience different algorithm functions. However, the existing technology usually corresponds to one algorithm package for one algorithm function, which leads to the target object downloading multiple algorithms. The storage space of the terminal device is often insufficient or the target object needs to download and delete algorithms frequently, which makes the target object's experience low. For example, when the terminal device is an IPC (IP CAMERA, network camera) camera product, the target object detection algorithm, vehicle detection algorithm, pet detection algorithm, passenger flow statistics algorithm, crying detection algorithm, etc. can be downloaded from the algorithm mall of the IPC camera product. Each functional algorithm corresponds to one or more algorithm packages, so that the number of algorithm functions supported by the IPC camera product is limited under limited storage space, resulting in low storage space utilization of the IPC camera product. Therefore, the present application proposes a method for algorithm management, which manages the entire process of algorithm deployment, verification, downloading, decompression, activation, and operation, thereby reducing the storage space of algorithm deployment, and expanding multiple algorithm functions under the limited storage space of the terminal device to achieve greater commercial value.
[0035] It is understandable that in addition to the above-mentioned IPC camera products, terminal devices can also be used on terminal devices such as natural language processors and machine learning products, and no specific limitation is made here.
[0036] Please refer to Figure 1 , Figure 1 It is a schematic diagram of a framework of an embodiment of a terminal device 100 of the present application. The terminal device 100 includes: a first configuration file 110, a second configuration file 120 and a third configuration file 130. The first configuration file 110 records the first configuration information of each algorithm function in the terminal device 100, wherein the first configuration information represents the mapping relationship between the first algorithm function and a plurality of target algorithm packages, and the first algorithm function represents the algorithm function of the terminal device 100 receiving the downloaded data to be enabled. The second configuration file 120 records the second configuration information of each algorithm function in the terminal device 100, wherein the second configuration information includes the dedicated function configuration of the first algorithm function. The first configuration information and the second configuration information can be used to find out a plurality of target algorithm packages locally to enable the first algorithm function. The third configuration file 130 records the package configuration information of each algorithm package currently existing locally in the terminal device 100, wherein the package configuration information includes the package information and the number of local uses, the number of local uses represents the number of algorithm functions of the algorithm package currently used in the terminal device 100, and the package information includes at least one of the package identifier of the algorithm package and the local storage path.
[0037] In some embodiments, if the first algorithm function is implemented by one target algorithm package, the first algorithm function corresponds to a single algorithm; if the first algorithm function is implemented by two or more target algorithm packages, the first algorithm function corresponds to a composite algorithm. When the first algorithm function is implemented by a composite algorithm, the sub-algorithm package on which the first algorithm function depends may be specified in the first configuration information. For example, when the terminal device 100 is an IPC camera product, the first configuration information in the first configuration file 110 is as follows:
[0038]
[0039]
[0040] Among the above contents, "AlgName", "AlgRefID" and "Type" are the function identifiers of the first algorithm function, "AlgPackName" and "DependPack" are the package identifiers of each target algorithm package. "Human" is the target object package, "Vehicle" is the vehicle package, and "Pet" is the pet package.
[0041] It is understandable that the first configuration file 110 may include not only the algorithm display name and the algorithm dependency package, but also the algorithm activation time, etc., which is not specifically limited here.
[0042] Specifically, the first configuration file 110 can be applied to the algorithm mall application of the terminal device 100 to provide the target object with information on various algorithm functions, for example, displaying downloadable or uninstallable algorithm functions in the display page of the algorithm mall application.
[0043] In some embodiments, the second configuration file 120 records the second configuration information of each algorithm function in the terminal device 100, and the second configuration information includes the dedicated function configuration of the first algorithm function, wherein the dedicated function configuration can be represented as a number of target algorithm packages related to the first algorithm function that are specifically used in specific fields or specific scenarios. For example, the target object key area detection algorithm function, the target object crossing line detection algorithm function, and the target object area detection algorithm function in the second configuration file 120 are all different algorithm functions obtained from the same target object algorithm package in the third configuration file 130, and the three algorithm functions of the target object key area detection algorithm function, the target object crossing line detection algorithm function, and the target object area detection algorithm function are obtained by adjusting the parameters of the target object algorithm package.
[0044] Furthermore, the dedicated function configuration in the second configuration file 120 can record all algorithms that share the same target algorithm package and store them in different channels. The specific configuration content stored includes AlgName (algorithm display name) and Config (algorithm configuration). The algorithm configuration is subdivided into link (algorithm alarm linkage content) + rule (algorithm rule content). Therefore, the second configuration information content in the second configuration file 120 is as follows:
[0045]
[0046]
[0047]
[0048]
[0049] In addition to recording the dedicated function configuration of the first algorithm function, the second configuration information in the second configuration file 120 may also record information such as the name of each algorithm package. Therefore, the content of the first configuration information in the first configuration file 11 and the content of the second configuration information in the second configuration file 120 may be partially the same.
[0050] In addition, the second configuration information in the second configuration file 120 is modifiable.
[0051] It is understandable that the dedicated function configuration also records information such as the activation order of several target algorithm packages used by the first algorithm function, which is not specifically limited here.
[0052] In some embodiments, the third configuration file 130 records the package configuration information of each algorithm package currently existing locally in the terminal device 100, the package configuration information includes package information and local usage times, the package information includes the package identifier and local storage path of the algorithm package, the package identifier may be the algorithm package name of the algorithm package, wherein each algorithm package recorded in the third configuration file 130 may be generated based on an AI (Artificial Intelligence, artificial intelligence) large model. Specifically, the package configuration information content in the third configuration file 130 may be as follows:
[0053] / / Algorithm package instance with dependencies, now with target object area + target object tripwire + target object key area
[0054]
[0055]
[0056] Among them, "path" is the local storage path, "refcount" is the number of local usages, and "AlgPackName" is the package identifier.
[0057] In addition, when the terminal device 100 downloads the algorithm function, a request for obtaining the corresponding algorithm function will be sent to the cloud through the terminal device 100. The request carries the function identifier corresponding to the algorithm function. The cloud searches for the corresponding algorithm package according to the function identifier in the request, and sends the corresponding algorithm package to the terminal device 100. Therefore, various algorithms are deployed in the cloud, and the deployment contents involved are: device model, language (Chinese and English), maximum number of algorithm downloads, algorithm type, algorithm rules, construction effective time, and upload algorithm package program. And each algorithm deployed on the cloud corresponds to the algorithm display name in the first configuration file 110 of the terminal device 100. The content of the algorithm rules on the cloud is set as follows:
[0058]
[0059]
[0060]
[0061] It can be understood that the first configuration file 110 , the second configuration file 120 , and the third configuration file 130 may be files of the same type or files of different types.
[0062] See also Figure 2 , Figure 2 It is a flowchart of an embodiment of the algorithm management method of the present application.
[0063] Specifically, the following steps may be included:
[0064] Step S110: The terminal device receives download data of the first algorithm function to be enabled.
[0065] The download data can indicate several target algorithm packages used by the first algorithm function, and the download data includes the first target algorithm package, which is a target algorithm package that does not currently exist locally in the terminal device 100.
[0066] For example, the target object detection algorithm already exists locally in the terminal device 100, that is, the target object algorithm package corresponding to the target object detection algorithm already exists locally in the terminal device 100. At this time, when the target object downloads the vehicle care algorithm, the target object algorithm package actually already exists locally in the terminal device 100. Therefore, when downloading the vehicle care algorithm, the specific download content includes: target object algorithm package (including AI large model and target object model parameters), vehicle algorithm package (including AI large model and vehicle model parameters), vehicle care algorithm package (including vehicle care model parameters and target object, vehicle dependency package index). Among them, the vehicle algorithm package and the vehicle care algorithm package are the first target algorithm package, which is the target algorithm package that does not currently exist locally in the terminal device 100. If the terminal device 100 already has a vehicle algorithm locally, the target object algorithm package and the vehicle care algorithm package are the first target algorithm package.
[0067] In addition, the download data may also only indicate a target algorithm package that does not currently exist locally in the terminal device 100, which is not specifically limited here.
[0068] In some embodiments, after the target object selects the first algorithm function in the algorithm mall of the terminal device 100, the terminal device 100 sends a download instruction containing the first algorithm function to the cloud. The cloud searches for the corresponding algorithm package based on the function identifier of the first algorithm function carried in the download instruction, wherein the function identifier of the first algorithm function includes at least one of the name and identification number of the first algorithm function, for example, the function identifier of the first algorithm function includes the name "Type" of the first algorithm function; for another example, the function identifier of the first algorithm function includes the name and identification number "AlgRefID" of the first algorithm function. The cloud compresses several target algorithm packages related to the found algorithm to obtain download data. The download data is sent to the terminal device 100, and the terminal device 100 decompresses the download data to obtain several target algorithm packages used by the first algorithm function.
[0069] Specifically, if the algorithm corresponding to the first algorithm function is a single algorithm, that is, the algorithm corresponding to the first algorithm function has one basic algorithm package, then the basic algorithm package corresponding to the algorithm is the target algorithm package, and the cloud compresses the target algorithm package and sends it to the terminal device 100. If the algorithm corresponding to the first algorithm function is a composite algorithm, the composite algorithm has multiple basic algorithm packages, and the multiple basic algorithm packages corresponding to the composite algorithm are all target algorithm packages. The cloud packages and compresses the multiple target algorithm packages to generate a compressed package, and sends it to each terminal device 100.
[0070] In addition, when the algorithm corresponding to the first algorithm function is a composite algorithm, after determining all target algorithm packages corresponding to the first algorithm function to be enabled by the terminal device 100, the cloud will compress each target algorithm package separately and send it to the terminal device 100. Figure 3 , the composite algorithm is root algorithm 1, root algorithm 1 depends on sub-algorithm 2 and sub-algorithm 3, sub-algorithm 2 depends on grandson algorithm 4 and grandson algorithm 5, and sub-algorithm 3 depends on grandson algorithm 6 and grandson algorithm 7. Therefore, after receiving the download instruction from the terminal device 100, the cloud first traverses according to the order that root algorithm 1 depends on sub-algorithm 2 and sub-algorithm 3, sub-algorithm 2 depends on grandson algorithm 4 and grandson algorithm 5, and sub-algorithm 3 depends on grandson algorithm 6 and grandson algorithm 7, so as to determine that the composite algorithm needs the algorithm package of root algorithm 1, the algorithm package of sub-algorithm 2, the algorithm package of sub-algorithm 3, the algorithm package of grandson algorithm 4, the algorithm package of grandson algorithm 5, the algorithm package of grandson algorithm 6, and the algorithm package of grandson algorithm 7, and according to the order of grandson algorithm 4->grandson algorithm 5->sub-algorithm 2->grandson algorithm 6->grandson algorithm 7->sub-algorithm 3->root algorithm 1, the cloud sends the compressed 7 target algorithm packages to the terminal device 100 in sequence. The terminal device 100 decompresses each target algorithm package in sequence.
[0071] At the same time, the cloud can adopt a tree growth strategy when traversing the dependencies of the composite algorithm:
[0072] Phase 1: The cloud first traverses root algorithm 1, and detects that root algorithm 1 includes sub-algorithm 2 and sub-algorithm 3, then automatically records root algorithm 1->(sub-algorithm 2, sub-algorithm 3); then, the cloud starts traversing from sub-algorithm 2, and detects that sub-algorithm 2 includes grandson algorithm 4 and grandson algorithm 5, then automatically records sub-algorithm 2->(grandson algorithm 4, grandson algorithm 5). Before traversing and executing sub-algorithm 3, the sub-items of sub-algorithm 3 are not added to the tree, and are constructed after traversing to sub-algorithm 3;
[0073] Phase 2 (traversal to 3): The cloud traverses and records sub-algorithm 3. When it is detected that sub-algorithm 3 includes grandson algorithm 6 and grandson algorithm 7, it automatically records root algorithm 1->(sub-algorithm 2, sub-algorithm 3), sub-algorithm 2->(grandson algorithm 4, grandson algorithm 5), and sub-algorithm 3->(grandson algorithm 6, grandson algorithm 7).
[0074] Phase 3: Traverse Grandson Algorithm 4, Grandson Algorithm 5, Grandson Algorithm 6, and Grandson Algorithm 7, and there are no sub-items. The whole process is completed.
[0075] It is understandable that, in addition to the above tree growth strategy, other methods such as depth-first traversal may also be used, which is not specifically limited here.
[0076] In some embodiments, in order to ensure that the data sent from the cloud to the terminal device 100 is not leaked, the download data sent from the cloud can be encrypted. After the terminal device 100 receives the encrypted download data sent from the cloud, it first decrypts it, and then decompresses it after the decryption is successful. Specifically, when the cloud establishes a communication connection with the terminal device 100, the terminal device 100 sends the public key it generates to the cloud. After the cloud receives the public key, it uses the public key to encrypt the download data to obtain the encrypted download data. The encrypted download data is sent to the terminal device 100, and the terminal device 100 uses its private key to decrypt the encrypted download data to obtain the original download data. It can be understood that the encryption and decryption method of the download data is not specifically limited here.
[0077] Step S120: Obtain the first target algorithm package in the downloaded data and load it locally.
[0078] In some embodiments, in order to further confirm that the algorithm package sent by the cloud is the algorithm required by the target object, the target algorithm package obtained by downloading the data can be verified to avoid the inconsistency between the downloaded target algorithm package and the required algorithm package, which may cause damage to the terminal device 100. Specifically, the function identifier and the first version of the first algorithm function corresponding to the downloaded data are obtained, and the second version of the algorithm package that has a mapping relationship with the function identifier is searched from the third configuration file 130 in the terminal device 100, and the version verification is performed based on the first version and the second version. If the version verification passes, the target algorithm package that has a mapping relationship with the function identifier is downloaded. Among them, the condition for passing the version verification can be that there is no conflict between the first version of the first algorithm function corresponding to the downloaded data and the second version of the algorithm package in the third configuration file 130 of the terminal device 100.
[0079] In addition, the target object can also be used to select the third version of the algorithm function to be downloaded in the algorithm mall and verify it with the first version of the first algorithm function corresponding to the downloaded data. If the two versions are consistent, the verification is successful.
[0080] In other embodiments, the capacity of all target algorithm packages in the downloaded data may also be verified. If the capacity of all target algorithm packages in the downloaded data is less than or equal to the capacity of the remaining storage space in the terminal device 100, the verification passes and the download of all target algorithm packages in the downloaded data begins; otherwise, an alarm is issued.
[0081] It is understandable that the verification method of the target algorithm report in the downloaded data is not specifically limited here.
[0082] In some embodiments, the downloaded data includes several target algorithm packages. To obtain a first target algorithm package, the terminal device 100 may obtain several target algorithm packages from the downloaded data; then select the first target algorithm package from the several target algorithm packages and load it locally.
[0083] Furthermore, the target algorithm package currently existing locally in the terminal device 100 is the second target algorithm package. To avoid conflicts between the target algorithm package downloaded by the terminal device 100 and the algorithm package currently being executed by the terminal device 100, the second target algorithm packages currently enabled by the terminal device 100 are disabled before the terminal device 100 downloads the target algorithm package. In addition, if the target algorithm package downloaded from the download data is the same type of algorithm package as the second target algorithm package, but the versions or some parameters are different, the second target algorithm packages are reloaded, that is, the second target algorithm package existing locally in the terminal device 100 is first uninstalled, and then the corresponding target algorithm package is downloaded according to the download data to replace the second target algorithm package.
[0084] In some embodiments, the download data includes a composite algorithm package that packages several target algorithm packages. To obtain the several target algorithm packages, the composite algorithm package can be first decompressed to obtain the several target algorithm packages. Further, the download data includes compressed target algorithm packages sent in sequence by the cloud. The order of sending the target algorithm packages is related to the dependency relationship of the target algorithm packages. After receiving the compressed target algorithm packages sent by the cloud, the terminal device 100 aligns and decompresses them in sequence to obtain the target algorithm packages.
[0085] In some embodiments, considering that when the terminal device 100 is downloading each target algorithm package of the composite algorithm, if there is a power outage or network disconnection, the algorithm packages already existing in the terminal device 100 may be damaged. Therefore, in this embodiment, different measures can be adopted to protect the stored data on the terminal device 100 in the face of different emergencies:
[0086] 1. In response to a power outage during the download of the composite algorithm package,
[0087] 1-1) when the current downloaded amount of the composite algorithm package is greater than the first ratio, deleting the downloaded common algorithm package in the composite algorithm package;
[0088] 1-2) When the current downloaded amount of the composite algorithm package is not greater than the first ratio, the downloaded common algorithm package in the composite algorithm package is not deleted; wherein the common algorithm package is an algorithm package currently existing locally;
[0089] 2. In response to a network disconnection during the download of the composite algorithm package,
[0090] 2-1) when the current downloaded amount of the composite algorithm package is greater than the second ratio, decompressing the composite algorithm package and subsequent steps;
[0091] 2-2) When the current downloaded amount of the composite algorithm package is not greater than the second ratio, it is determined that the download of the first algorithm function has failed, wherein, during the process of downloading the target algorithm package, network disconnection does not affect the successfully downloaded target algorithm package.
[0092] It can be understood that the first ratio and the second ratio may be the same or different, and no specific limitation is made herein.
[0093] In addition, during the process of downloading the target algorithm package, a power outage occurs, and after the terminal device 100 is restarted, it is necessary to perform an integrity dependency check on the download process and continue the download process after passing the integrity check.
[0094] Specifically, by traversing the first configuration file 110 and the second configuration file 120 , it is checked whether the downloaded target algorithm package and the first algorithm function have been updated in the first configuration file 110 and the second configuration file 120 .
[0095] Step S130: Based on the downloaded data, recording the function configuration information of the first algorithm function.
[0096] The function configuration information includes first configuration information characterizing a mapping relationship between a first algorithm function and a plurality of target algorithm packages, and the function configuration information is used to locally search for a plurality of target algorithm packages to enable the first algorithm function.
[0097] In some embodiments, the mapping relationship can be characterized as a target algorithm package used to implement the first algorithm function. For example, when detecting a vehicle, only the vehicle algorithm package can be used to implement the vehicle detection algorithm function. At this time, the mapping relationship between the vehicle detection algorithm function and the vehicle algorithm package is a one-to-one relationship. For another example, when it is necessary to detect whether there are animals around the vehicle, it is necessary to use both the vehicle algorithm package and the pet algorithm package to implement the vehicle pet detection algorithm function. At this time, the mapping relationship between the vehicle pet detection algorithm function and the vehicle algorithm package and the pet algorithm package is a one-to-many relationship.
[0098] In some embodiments, after the terminal device 100 downloads each target algorithm package by downloading data, the mapping relationship between each target algorithm package can be determined through the first configuration information, so that the terminal device 100 updates each target algorithm package and the first algorithm function and other information to the first configuration file 110, the second configuration file 120 and the third configuration file 130, so that the terminal device 100 can successfully run the first algorithm function. Specifically, regarding the way in which the terminal device 100 updates the first configuration file 110, the second configuration file 120 and the third configuration file 130, please refer to the following content:
[0099] 1. Update the third configuration file 130: It is known that the package configuration information of each first target algorithm package is recorded in the third configuration file 130, wherein the third configuration file 130 records the package configuration information of each algorithm package currently existing locally in the terminal device 100, the package configuration information includes package information and local usage counts, the local usage counts indicate the number of algorithm functions of the algorithm package currently used in the terminal device 100, and the package information includes at least one of the package identifier and the local storage path of the algorithm package. Therefore, when the first target algorithm package is updated in the third configuration file 130, the local usage counts of each second target algorithm package in the third configuration file 130 need to be updated. Specifically, the first target algorithm package is a target algorithm package that does not currently exist locally in the terminal device 100, that is, the first target algorithm package is a brand-new algorithm package. Therefore, when updating the third configuration file 130, the package configuration information of the first target algorithm package needs to be written into the third configuration file 130, and the local usage count is set to 1; and the other target algorithm packages indicated by the download data already exist in the third configuration file 130, but the versions or some parameters are different. When updating these target algorithm packages, the package configuration information corresponding to these target algorithm packages needs to be deleted, and then the new package configuration information is written into the third configuration file 130, and 1 is added to the previous local usage count.
[0100] 2. Update the second configuration file 120: It is known that the function configuration information of the first algorithm function also includes the second configuration information, and the second configuration information includes the dedicated function configuration of the first algorithm function; and the second configuration information also includes the algorithm alarm linkage content and algorithm rule content of the first algorithm function; the second configuration information is stored in the second configuration file 120, and the second configuration file 120 records the second configuration information of each algorithm function in the terminal device 100. Therefore, updating the second configuration file 120 is to update the dedicated function configuration information of the first algorithm function. Specifically, if the same algorithm function already exists in the terminal device 100, the dedicated function configuration corresponding to the current first algorithm function is stored in different channels of the second configuration file 120, and the algorithm name, law alarm linkage content and algorithm rule content of the first algorithm function are stored at the same time. In addition, the function configuration information of the first algorithm function may also include function descriptive information, restrictive information, etc., which are not specifically limited here.
[0101] 3. Update the first configuration file 110: It is known that the first configuration information is stored in the first configuration file 110. The first configuration file 110 records the first configuration information of each algorithm function in the terminal device 100. The first configuration information includes the function identifier of the first algorithm function and the package identifier of each target algorithm package, wherein the function identifier may be the algorithm name described by "AlgName", and the package identifier may be "AlgRefID". And the first configuration information also includes the algorithm type to which the first algorithm function belongs, and the algorithm type includes at least one of a video algorithm and an audio algorithm, for example, the "Type" in the above-mentioned first configuration file 110. Therefore, by updating the first configuration file 110, information such as the function identifier of the first algorithm function, the package identifier of each target algorithm package, and the algorithm type to which the first algorithm function belongs can be updated to the first configuration file 110.
[0102] Therefore, in this embodiment, on the same terminal device 100, there may be a situation where multiple algorithm functions share one algorithm package, or a situation where multiple algorithm functions share multiple algorithm packages.
[0103] After the first configuration file 110, the second configuration file 120 and the third configuration file 130 are updated, the download of the first algorithm function is also completed accordingly. At this time, the target object can use the first algorithm function on the terminal device 100. Further, when the first algorithm function is a composite algorithm, when the target object enables the first algorithm function, it also involves the enabling order of each target algorithm package under the first algorithm function. Therefore, in order to ensure the normal enabling of the first algorithm function, the dependent package of the first algorithm function, that is, the sub-algorithm package, should be enabled first. For example, the download of the vehicle care algorithm function has been completed on the terminal device 100. The vehicle care algorithm function includes a target object algorithm package, a vehicle algorithm package and a vehicle care algorithm package. The target object algorithm package and the vehicle algorithm package are sub-algorithm packages of the vehicle care algorithm package. Therefore, when the target object enables the vehicle care algorithm function, the terminal device 100 first enables the target object algorithm package and the vehicle algorithm package, and then enables the vehicle care algorithm package, so as to avoid the case where the target object algorithm package and the vehicle algorithm package are not enabled when the vehicle care algorithm package is directly enabled, so that the vehicle care algorithm function cannot be used normally, thereby causing the terminal device 100 to alarm. Among them, the activation order of the target object algorithm package and the vehicle algorithm package can be to enable the target object algorithm package first, and then enable the vehicle algorithm package; or to enable the vehicle algorithm package first, and then enable the target object algorithm package, which is not specifically limited here. In a specific implementation scenario, the terminal device 100 is an IPC camera product, which can support algorithm functions such as target object detection algorithm, vehicle detection algorithm, pet detection algorithm, passenger flow statistics algorithm, and crying detection algorithm. First, the target object selects the target object area detection algorithm as the first algorithm function in the algorithm mall of the IPC camera product to generate a download instruction, and sends the download instruction to the cloud. The download instruction includes the function identifier corresponding to the first algorithm function, that is, the algorithm display name "AlgName". The subsequent steps include the following:
[0104] 1. After receiving the download command, the cloud obtains the algorithm display name "intrusionHuman" according to the "AlgName" carried in the download command;
[0105] 2. After determining the algorithm display name, the cloud checks whether the algorithm has "AlgPackName". If so, it obtains the name of the target algorithm package "Human". If not, it prompts that the target object does not support the first algorithm function.
[0106] 3. Get the algorithm package version "xxx" according to the "Version" carried in the download instruction;
[0107] 4. Check whether there is "DependPack" in the algorithm. If yes, get the composite algorithm version, traverse the composite algorithm, get the information of the sub-algorithm package, package the above information to get the download data, and send it to the IPC camera product; if no, package the above information to get the download data, and send it to the IPC camera product;
[0108] 5. After receiving the downloaded data, the IPC camera product verifies the algorithm version;
[0109] 6. After the version verification is passed, the IPC camera product downloads according to the URL download instruction in the download data;
[0110] 7. When downloading, disable the second target algorithm packages currently enabled by the IPC camera product;
[0111] 8. After downloading, decompress the target algorithm package;
[0112] 9. Send an update message to the algorithm service, and update the first configuration file 110, the second configuration file 120, and the third configuration file 130 through the algorithm service;
[0113] 10. Reinitialize the algorithm package corresponding to the first algorithm function;
[0114] 11. The algorithm service returns and the adding process is completed;
[0115] 12. The number of local usages of the algorithm package corresponding to the first algorithm function is +1.
[0116] In some embodiments, the algorithm function in the terminal device 100 may also be uninstalled. In response to receiving an uninstall instruction for the second algorithm function, the function configuration information of the second algorithm function is deleted; wherein the uninstall instruction is generated by the target object performing an uninstall operation on the second algorithm function; or, the uninstall instruction is generated by the terminal device 100 when it detects that the algorithm package used by the third algorithm function is locally missing when the third algorithm function is enabled, and the second algorithm function is each algorithm function related to the algorithm package that is locally missing in the terminal device 100.
[0117] Specifically, the terminal device 100 stores a third configuration file 130, and the third configuration file 130 records the package configuration information of each algorithm package currently existing locally in the terminal device 100, and the package configuration information includes the local usage count, and the local usage count indicates the number of algorithm functions currently using the algorithm package in the terminal device 100. Therefore, after receiving the uninstall instruction for the second algorithm function, the terminal device 100 updates the local usage count of each algorithm package used by the second algorithm function in the third configuration file 130; in response to the existence of an invalid algorithm package in each algorithm package used by the second algorithm function, the invalid algorithm package is deleted, wherein the invalid algorithm package is an algorithm package whose local usage count after the update is 0.
[0118] In a specific implementation scenario, when the terminal device 100 is an IPC camera product, the target object uninstalls the target object area detection algorithm function in the IPC camera product. The specific steps are as follows:
[0119] 1. After receiving the uninstall instruction generated by the target object performing the uninstall operation on the second algorithm function, the IPC camera product obtains the algorithm name "intrusionHuman" in the third configuration file 130 according to the "AlgName" field carried in the uninstall instruction;
[0120] 2. Traverse the algorithm name "intrusionHuman" in the third configuration file 130. If the algorithm has a "DependPack" field, it means that the algorithm has a sub-dependency package. Use deep recursion to match the sub-dependency package in the third configuration file 130, and reduce the local usage count "refercount" of the sub-algorithm package. If the local usage count is 0 at this time, perform the package-level physical deletion process and continue the deep recursive process.
[0121] 3. After the sub-dependency package "DependPack" is cleaned up, process the algorithm package "AlgPackName" at this level, and then continue to recursively return until all are completed;
[0122] 4. Process the second configuration file 120, send a deletion message to the algorithm service, and execute the DeleteAlg function. After the algorithm service matches "AlgName" in the second configuration file 120, it deletes the algorithm package from the second configuration file 120 and reloads the corresponding algorithm package.
[0123] 5. Process the first configuration file 110 and delete the data corresponding to "AlgName":"intrusionHuman" in the first configuration file 110 to complete the uninstallation of the second algorithm function.
[0124] This application provides an explanation of the algorithm management method using a composite algorithm package, multiple algorithm functions corresponding to one algorithm package, and multiple algorithm functions corresponding to multiple algorithm packages, etc., under the limited storage space of the terminal device. Thereby, the requirement of strong algorithm functions is met while the capacity of the storage space remains unchanged, which is an effective means to reduce costs and increase efficiency. In addition, this application explains the algorithm deployment, and makes detailed explanations from the perspectives of the first configuration file, the second configuration file, the third configuration file, the loading algorithm, the unloading algorithm, and the composite algorithm dependency logic. At the same time, special handling is also made for abnormal situations to ensure the normal use of the terminal device functions. This application also has the characteristics of a concise algorithm function list, a clear algorithm hierarchy architecture, and a flexible algorithm configuration.
[0125] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0126] See also Figure 4 , Figure 4 This is a flowchart of another embodiment of the algorithm management method of the present application. Specifically, it may include the following steps:
[0127] Step S410: the terminal device 100 receives download data of a first algorithm function to be enabled.
[0128] The download data can indicate several target algorithm packages used by the first algorithm function, and the download data includes the first target algorithm package, which is a target algorithm package that does not currently exist locally in the terminal device 100.
[0129] This step is the same as the above step S210 and will not be described again here.
[0130] Step S420: Verify the version of the target algorithm package and obtain a verification result.
[0131] In some embodiments, the function identifier and the first version of the first algorithm function corresponding to the downloaded data can be obtained, and the second version of the algorithm package that has a mapping relationship with the function identifier can be searched from the third configuration file 130 in the terminal device 100, and the first version and the second version are verified to obtain a verification result.
[0132] Step S430: In response to the verification result being that the verification is passed, the first target algorithm package in the downloaded data is loaded locally.
[0133] In some embodiments, when the verification result is that the version verification is passed, a target algorithm package that has a mapping relationship with the function identifier is downloaded.
[0134] Step S440: Update the configuration file based on the downloaded data.
[0135] In some embodiments, after the first target algorithm package in the downloaded data is loaded locally, the first target algorithm package and information such as the first algorithm function are updated to the first configuration file 110, the second configuration file 120, and the third configuration file 130, so that the terminal device 100 can successfully run the first algorithm function. The specific updating method is the same as the above method, and will not be repeated here.
[0136] See also Figure 5 , Figure 5 It is a schematic diagram of the framework of an embodiment of the algorithm management system 500 of the present application. The algorithm management system 500 includes a cloud 510 and a terminal device 520, wherein the cloud 510 is connected in communication with the terminal device 520, wherein the cloud 510 is used to generate download data of the algorithm function to be downloaded by the terminal device 520 and send it to the terminal device 520; the terminal device 520 is used to receive the download data to implement the deployment of the algorithm function.
[0137] See also Figure 6 , Figure 6 It is a framework diagram of an embodiment of the algorithm management device of the present application. The algorithm management device 600 includes a receiving module 610, an acquisition module 620 and an update module 630. The receiving module 610 executes the terminal device to receive the download data of the first algorithm function to be enabled, wherein the download data can indicate several target algorithm packages used by the first algorithm function, and the download data contains the first target algorithm package, which is a target algorithm package that does not currently exist locally in the terminal device. The acquisition module 620 executes to obtain the first target algorithm package in the download data and loads it locally. The update module 630 executes to record the function configuration information of the first algorithm function based on the download data, wherein the function configuration information includes the first configuration information that characterizes the mapping relationship between the first algorithm function and several target algorithm packages, and the function configuration information is used to find several target algorithm packages locally to enable the first algorithm function.
[0138] In some embodiments, the update module 630 executes the first configuration information including the function identifier of the first algorithm function and the package identifier of each target algorithm package; the function configuration information also includes the second configuration information, and the second configuration information includes the dedicated function configuration of the first algorithm function.
[0139] In some embodiments, the function identifier of the update module 630 executing the first algorithm function includes at least one of the name and identification number of the first algorithm function; and / or, the first configuration information also includes the algorithm type to which the first algorithm function belongs, and the algorithm type includes at least one of a video algorithm and an audio algorithm; and / or, the first configuration information is stored in a first configuration file, and the first configuration file records the first configuration information of each algorithm function in the terminal device; and / or, the second configuration information includes the algorithm alarm linkage content and the algorithm rule content of the first algorithm function; and / or, the second configuration information is stored in a second configuration file, and the second configuration file records the second configuration information of each algorithm function in the terminal device.
[0140] In some embodiments, the receiving module 610 executes the target algorithm package currently existing locally in the terminal device as the second target algorithm package; after receiving the download data of the first algorithm function to be enabled, it also includes: recording the package configuration information of each first target algorithm package in a third configuration file, wherein the third configuration file records the package configuration information of each algorithm package currently existing locally in the terminal device, the package configuration information includes package information and local usage count, the local usage count indicates the number of algorithm functions of the algorithm package currently used in the terminal device, the package information includes at least one of the package identifier of the algorithm package and the local storage path; and, updating the local usage count of each second target algorithm package in the third configuration file.
[0141] In some embodiments, the acquisition module 620 executes downloading data including several target algorithm packages; acquiring the first target algorithm package in the downloaded data and loading it locally, including: acquiring several target algorithm packages from the downloaded data; selecting the first target algorithm package from the several target algorithm packages and loading it locally.
[0142] In some embodiments, before the acquisition module 620 acquires several target algorithm packages from the downloaded data, the following steps are performed: acquiring a function identifier and a first version of a first algorithm function corresponding to the downloaded data; searching a configuration file for a second version of the algorithm package that has a mapping relationship with the function identifier; performing version verification based on the first version and the second version, and downloading a target algorithm package that has a mapping relationship with the function identifier if the version verification passes.
[0143] In some embodiments, the receiving module 610 executes the target algorithm package currently existing locally in the terminal device as the second target algorithm package; after receiving the download data of the first algorithm function to be enabled, it also includes: deactivating each second target algorithm package currently enabled by the terminal device; after obtaining several target algorithm packages from the downloaded data, it also includes: reloading each second target algorithm package.
[0144] In some embodiments, the acquisition module 620 executes downloading data including a composite algorithm package that packages several target algorithm packages, and obtains several target algorithm packages from the downloading data, including: decompressing the composite algorithm package to obtain several target algorithm packages; or, the downloading data includes compressed target algorithm packages sent sequentially from the cloud, and the sending order of each target algorithm package is related to the dependency relationship of each target algorithm package; obtaining several target algorithm packages from the downloading data includes: decompressing each target algorithm package in sequence.
[0145] In some embodiments, before the acquisition module 620 decompresses the composite algorithm package to obtain several target algorithm packages, it also includes: in response to a power outage during the downloading of the composite algorithm package, if the current downloaded amount of the composite algorithm package is greater than a first ratio, deleting the downloaded common algorithm package in the composite algorithm package; if the current downloaded amount of the composite algorithm package is not greater than the first ratio, not deleting the downloaded common algorithm package in the composite algorithm package; wherein the common algorithm package is an algorithm package that currently exists locally; in response to a network outage during the downloading of the composite algorithm package, if the current downloaded amount of the composite algorithm package is greater than a second ratio, decompressing the composite algorithm package and subsequent steps; if the current downloaded amount of the composite algorithm package is not greater than the second ratio, determining that the download of the first algorithm function has failed.
[0146] In some embodiments, the update module 630 execution method also includes: in response to receiving an uninstall instruction for the second algorithm function, deleting the function configuration information of the second algorithm function; wherein the uninstall instruction is generated by the target object performing an uninstall operation on the second algorithm function; or, the uninstall instruction is generated by the terminal device when it detects that the algorithm package used by the third algorithm function is locally missing when the third algorithm function is enabled, and the second algorithm function is each algorithm function related to the algorithm package that is locally missing in the terminal device.
[0147] In some embodiments, the update module 630 executes a terminal device that stores a third configuration file, and the third configuration file records package configuration information of each algorithm package currently existing locally in the terminal device, the package configuration information includes a local usage count, and the local usage count indicates the number of algorithm functions currently using the algorithm package in the terminal device; in response to receiving an uninstall instruction for the second algorithm function, the method further includes: updating the local usage count of each algorithm package used by the second algorithm function in the third configuration file; in response to the presence of invalid algorithm packages in the algorithm packages used by the second algorithm function, deleting the invalid algorithm packages, wherein the invalid algorithm package is an algorithm package whose local usage count after update is 0.
[0148] See also Figure 7 , Figure 7: is a schematic diagram of a framework of an embodiment of an electronic device 70 of the present application. The electronic device 70 includes a memory 71 and a processor 72 coupled to each other, and the processor 72 is used to execute program instructions stored in the memory 71 to implement the steps in any of the above algorithm management method embodiments. In a specific implementation scenario, the electronic device 70 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 70 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0149] Specifically, the processor 72 is used to control itself and the memory 71 to implement the steps in any of the above-mentioned algorithm management method embodiments. The processor 72 can also be called a CPU (Central Processing Unit). The processor 72 may be an integrated circuit chip with signal processing capabilities. The processor 72 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 72 can be implemented by an integrated circuit chip.
[0150] See also Figure 8 , Figure 8 The schematic diagram is a schematic diagram of a computer-readable storage medium 80 of the present application. The computer-readable storage medium 80 stores program instructions 801 that can be executed by a processor, and the program instructions 801 are used to implement the steps in any of the above algorithm management method embodiments.
[0151] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0152] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0153] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0154] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0155] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. An algorithm management method, characterized in that: include: The terminal device receives download data of a first algorithm function to be enabled, wherein the download data can indicate several target algorithm packages used by the first algorithm function, and the download data includes a first target algorithm package, which is the target algorithm package that does not currently exist locally on the terminal device; Obtaining the first target algorithm package in the downloaded data and loading it locally; and, Based on the downloaded data, functional configuration information of the first algorithm function is recorded, wherein the functional configuration information includes first configuration information characterizing a mapping relationship between the first algorithm function and the several target algorithm packages, and the functional configuration information is used to locally find the several target algorithm packages to enable the first algorithm function.
2. The method according to claim 1, characterized in that The first configuration information includes a function identifier of the first algorithm function and a package identifier of each of the target algorithm packages; The functional configuration information also includes second configuration information, and the second configuration information includes a dedicated functional configuration of the first algorithm function.
3. The method according to claim 2, characterized in that The function identification of the first algorithm function includes at least one of a name and an identification number of the first algorithm function; And / or, the first configuration information further includes an algorithm type to which the first algorithm function belongs, and the algorithm type includes at least one of a video algorithm and an audio algorithm; And / or, the first configuration information is stored in a first configuration file, and the first configuration file records first configuration information of each algorithm function in the terminal device; And / or, the second configuration information includes algorithm alarm linkage content and algorithm rule content of the first algorithm function; And / or, the second configuration information is stored in a second configuration file, and the second configuration file records the second configuration information of each algorithm function in the terminal device.
4. The method according to claim 1, characterized in that: The target algorithm package currently existing locally on the terminal device is the second target algorithm package; After receiving the download data of the first algorithm function to be enabled, the method further includes: Recording the package configuration information of each of the first target algorithm packages in a third configuration file, wherein the third configuration file records the package configuration information of each algorithm package currently existing locally in the terminal device, the package configuration information includes package information and a local usage count, the local usage count indicates the number of algorithm functions currently using the algorithm package in the terminal device, and the package information includes at least one of a package identifier and a local storage path of the algorithm package; And, update the local usage count of each of the second target algorithm packages in the third configuration file.
5. The method according to claim 1, characterized in that The downloaded data includes the several target algorithm packages; The step of obtaining the first target algorithm package in the downloaded data and loading it locally includes: Acquire the plurality of target algorithm packages from the downloaded data; The first target algorithm package is selected from the plurality of target algorithm packages and loaded locally.
6. The method according to claim 5, characterized in that Before obtaining the plurality of target algorithm packages from the downloaded data, the method further comprises: Obtaining a function identifier and a first version of a first algorithm function corresponding to the downloaded data; Searching the configuration file for a second version of the algorithm package that has a mapping relationship with the function identifier; Version verification is performed based on the first version and the second version, and if the version verification passes, the target algorithm package that has a mapping relationship with the function identifier is downloaded.
7. The method according to claim 5, characterized in that The target algorithm package currently existing locally on the terminal device is the second target algorithm package; After receiving the download data of the first algorithm function to be enabled, the method further includes: Deactivating each of the second target algorithm packages currently enabled by the terminal device; After obtaining the plurality of target algorithm packages from the downloaded data, the method further includes: Reload each of the second target algorithm packages.
8. The method according to claim 5, characterized in that The downloaded data includes a composite algorithm package that packages the plurality of target algorithm packages, and the step of obtaining the plurality of target algorithm packages from the downloaded data includes: Decompressing the composite algorithm package to obtain the plurality of target algorithm packages; Alternatively, the download data includes compressed target algorithm packages sequentially sent by the cloud, and the sending order of the target algorithm packages is related to the dependency relationship between the target algorithm packages; The obtaining the plurality of target algorithm packages from the downloaded data comprises: Decompress the target algorithm packages in sequence.
9. The method according to claim 8, characterized in that Before decompressing the composite algorithm package to obtain the plurality of target algorithm packages, the method further includes: In response to a power outage during the process of downloading the composite algorithm package, if the current downloaded amount of the composite algorithm package is greater than a first ratio, the downloaded common algorithm package in the composite algorithm package is deleted; if the current downloaded amount of the composite algorithm package is not greater than the first ratio, the downloaded common algorithm package in the composite algorithm package is not deleted; wherein the common algorithm package is an algorithm package currently existing locally; In response to a network disconnection during the downloading of the composite algorithm package, when the currently downloaded amount of the composite algorithm package is greater than a second ratio, the decompression of the composite algorithm package and subsequent steps are performed; when the currently downloaded amount of the composite algorithm package is not greater than the second ratio, it is determined that the downloading of the first algorithm function has failed.
10. The method according to claim 1, characterized in that The method further comprises: In response to receiving an uninstall instruction for a second algorithm function, deleting the functional configuration information of the second algorithm function; wherein the uninstall instruction is generated by a target object performing an uninstall operation on the second algorithm function; or, the uninstall instruction is generated by the terminal device when it detects that an algorithm package used by the third algorithm function is locally missing when the third algorithm function is enabled, and the second algorithm function is each algorithm function related to the locally missing algorithm package in the terminal device.
11. The method according to claim 10, characterized in that The terminal device stores a third configuration file, the third configuration file records the package configuration information of each algorithm package currently existing locally in the terminal device, the package configuration information includes a local usage count, and the local usage count indicates the number of algorithm functions currently using the algorithm package in the terminal device; In response to receiving an instruction to uninstall the second algorithm function, the method further includes: Updating the local usage count of each algorithm package used by the second algorithm function in the third configuration file; In response to the presence of an invalid algorithm package in the algorithm packages used by the second algorithm function, the invalid algorithm package is deleted, wherein the invalid algorithm package is an algorithm package whose local usage count after update is 0.
12. A terminal device, characterized in that: include: a first configuration file, wherein the first configuration file records first configuration information of each algorithm function in the terminal device, wherein the first configuration information represents a mapping relationship between a first algorithm function and the plurality of target algorithm packages, and the first algorithm function represents an algorithm function of the terminal device for receiving download data to be enabled; a second configuration file, wherein the second configuration file records second configuration information of each algorithm function in the terminal device, wherein the second configuration information includes a dedicated function configuration of the first algorithm function; A third configuration file, wherein the third configuration file records the package configuration information of each algorithm package currently existing locally on the terminal device, wherein the package configuration information includes package information and a local usage count, the local usage count indicates the number of algorithm functions currently using the algorithm package in the terminal device, and the package information includes at least one of a package identifier of the algorithm package and a local storage path.
13. An algorithm management system, characterized in that: comprising a cloud and the terminal device according to claim 12, wherein the cloud is communicatively connected with the terminal device, wherein: The cloud is used to generate download data of the algorithm function that the terminal device needs to download, and send it to the terminal device; The terminal device is used to receive the downloaded data to implement the deployment of the algorithm function.
14. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the algorithm management method according to any one of claims 1 to 11.
15. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the algorithm management method according to any one of claims 1 to 11 is implemented.