Algorithm resource configuration method, device, electronic device and storage medium

By identifying and eliminating redundant resources in the algorithm resource package in video processing and configuring target algorithm resources, the inefficiency and redundancy overhead problems caused by repeated execution of resources in the prior art are solved, and more efficient video processing is achieved.

CN114911514BActive Publication Date: 2025-02-11BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110183973.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-10
Publication Date
2025-02-11
Estimated Expiration
2041-02-10

AI Technical Summary

Technical Problem

In the video processing process, the prior art has duplicate algorithm resources in the algorithm resource package, resulting in duplicate execution of resources, which is inefficient and has problems of redundant overhead.

Method used

By obtaining at least two original algorithm resource packages, determining the type of each algorithm resource and its initial dependencies, identifying the algorithm resources with duplicate types and determining redundant resources according to preset rules, and configuring the target algorithm resources to avoid duplicate calls.

Benefits of technology

It reduces the overhead caused by redundant operation of algorithm resources and improves the efficiency of video processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911514B_ABST
    Figure CN114911514B_ABST
Patent Text Reader

Abstract

The present disclosure provides a configuration method, device, electronic device and storage medium for algorithm resources, and relates to the field of data processing technology. The method includes: obtaining at least two original algorithm resource packages, each of which includes at least one algorithm resource; determining the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources; determining the algorithm resources of repeated types in at least two original algorithm resource packages, and determining the redundant algorithm resources in the algorithm resources of repeated types according to preset rules; using the other algorithm resources in at least two original algorithm resource packages except the redundant algorithm resources as the target algorithm resources, combining the initial dependency relationship between the algorithm resources in the original algorithm resource packages, determining the dependency relationship between the target algorithm resources; configuring the target algorithm resources according to the dependency relationship between the target algorithm resources. The present disclosure can reduce the overhead generated by the redundant operation of algorithm resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a configuration method, device, electronic device and storage medium for algorithm resources. Background Art

[0002] In recent years, with the development of video technology, videos have become more and more interesting, and video processing has become increasingly important.

[0003] The process of processing the video can be described as follows: the terminal obtains an algorithm resource package containing algorithm resources required by the terminal from the server, and the terminal processes the video according to the received algorithm resource package to obtain a processed video.

[0004] Since different algorithm resource packages may contain duplicate algorithm resources, if the terminal executes the algorithm resources in each algorithm resource package once, the duplicate algorithm resources will be executed repeatedly, resulting in low video processing efficiency and redundant overhead. Summary of the invention

[0005] Embodiments of the present invention provide a method, device, electronic device, and storage medium for configuring algorithm resources that overcome the above problems or at least partially solve the above problems.

[0006] In a first aspect, a method for configuring algorithm resources is provided, the method comprising:

[0007] Acquire at least two original algorithm resource packages, each of which includes at least one algorithm resource;

[0008] Determine the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between algorithm resources;

[0009] Determine algorithm resources of duplicate types in at least two original algorithm resource packages, and determine redundant algorithm resources in the algorithm resources of duplicate types according to a preset rule;

[0010] Taking other algorithm resources except redundant algorithm resources in at least two original algorithm resource packages as target algorithm resources, and determining the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource packages;

[0011] Configure target algorithm resources based on the dependencies between target algorithm resources.

[0012] In a second aspect, a device for configuring algorithm resources is provided, including:

[0013] An algorithm resource package acquisition module, used to acquire at least two original algorithm resource packages, each of which includes at least one algorithm resource;

[0014] An information determination module, used to determine the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources;

[0015] A redundant resource determination module, used to determine algorithm resources of repeated types in at least two original algorithm resource packages, and to determine redundant algorithm resources in the algorithm resources of repeated types according to preset rules;

[0016] A dependency updating module, used to take other algorithm resources except redundant algorithm resources in at least two original algorithm resource packages as target algorithm resources, and determine the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource packages;

[0017] The configuration module is used to configure the target algorithm resources according to the dependencies between the target algorithm resources.

[0018] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method provided in the first aspect are implemented.

[0019] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect.

[0020] In a fifth aspect, an embodiment of the present invention provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. When a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the computer device executes the steps of implementing the method provided in the first aspect.

[0021] The algorithm resource configuration method, device, electronic device and storage medium provided by the embodiments of the present disclosure obtain at least two original algorithm resource packages, determine the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources, determine redundant algorithm resources from algorithm resources of repeated types, thereby avoiding repeated calls of algorithm resources of the same type, and use the algorithm resources other than the redundant algorithm resources in the original algorithm resource package as target algorithm resources, and determine the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource package; configure the target algorithm resources according to the dependency relationship between the target algorithm resources, which can reduce the overhead generated by redundant operation of algorithm resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for describing the embodiments of the present disclosure are briefly introduced below.

[0023] Figure 1 A schematic diagram of an application scenario of the algorithm resource configuration method provided in an embodiment of the present disclosure;

[0024] Figure 2 A flowchart of a method for configuring algorithm resources provided in an embodiment of the present disclosure;

[0025] Figure 3 A schematic diagram of two original algorithm resource packages provided in an embodiment of the present disclosure;

[0026] Figure 4 A schematic diagram of a target directed graph provided by an embodiment of the present disclosure;

[0027] Figure 5 A schematic diagram of the structure of a device for configuring algorithm resources provided in an embodiment of the present disclosure;

[0028] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present disclosure, and cannot be interpreted as limiting the present invention.

[0030] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "an" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0031] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.

[0032] The algorithm resource configuration method, device, electronic device and computer-readable storage medium provided in the present disclosure are intended to solve the above technical problems in the prior art.

[0033] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0034] See also Figure 1 , Figure 1 The following is a schematic diagram of an application scenario of the configuration method of algorithm resources provided in an embodiment of the present disclosure. The application scenario is introduced by taking the configuration method of algorithm resources applied to a terminal device as an example. The application scenario includes a terminal device 100, which can be a smart terminal such as a smart phone, a computer, a personal digital assistant (PDA), a tablet computer, a wearable electronic device, a smart home device, etc.

[0035] At least one video or video clip can be stored in the terminal device 100. In order to facilitate the processing of the video in the terminal device 100 (for example, adding special effects to the video), the corresponding algorithm resources can be called, and the terminal device 100 can configure the algorithm resources to complete the processing of the video.

[0036] When the algorithm resources need to be configured, the terminal device 100 can obtain the algorithm resource package corresponding to the video to be processed, see Figure 1 As shown in the database 200, the terminal device 100 can obtain algorithm resource package 1 and algorithm resource package 2, wherein algorithm resource package 1 includes algorithm resources A1-A4, and algorithm resource package 2 includes algorithm resources A1, A2, and A5. When processing the video, algorithm resources A1-A5 are needed, wherein A1-A5 can be understood as algorithm resources and have corresponding algorithm types.

[0037] Figure 1 The arrows shown in can represent the dependency relationships between the algorithm resources in the algorithm resource package.

[0038] When processing a video, when calling one or some algorithm resources, this or these algorithm resources may also need to call other algorithm resources or rely on the output of other algorithm resources to complete the corresponding processing. This calling relationship can be called a dependency relationship.

[0039] It can be understood that two algorithm resources can be connected through the dependency relationship between the algorithm resources, and multiple algorithm resources connected through the dependency relationship can all be regarded as algorithm resources with dependency relationships.

[0040] For example, algorithm resource A1 in database 200 needs to call algorithm resource A2, so algorithm resource A1 has a dependency relationship with algorithm resource A2.

[0041] The terminal device 100 can be based on the dependency relationship, for example Figure 1 The arrows in 200 in the figure determine the algorithm resources with dependency relationships, thereby further determining which algorithm resources depend on other algorithm resources, and which algorithm resources are dependent on, and so on.

[0042] Figure 1 300 is used to represent the configuration process of the original algorithm resource package. The algorithm resources of repeated types in algorithm resource package 1 and algorithm resource package 2 are A1 and A2. The redundant algorithm resources in the algorithm resources of repeated types are determined by preset rules to include one A1. Therefore, the target algorithm resources determined from algorithm resource package 1 and algorithm resource package 2 include: 1 A1, 2 and A2, 1 A3, 1 A4 and 1 A5.

[0043] In algorithm resource package 1, algorithm resource A1 needs to call algorithm resource A2, algorithm resource A2 needs to call algorithm resource A3, and algorithm resource A3 needs to call algorithm resource A4. In algorithm resource package 2, algorithm resource A1 needs to call algorithm resource A2, and algorithm resource A2 needs to call algorithm resource A5, so the dependency relationship of the target algorithm resources is determined as follows: algorithm resource A1 calls two algorithm resources A2 respectively, two algorithm resources A2 call algorithm resource A3 together, algorithm resource A3 calls algorithm resource A4, and algorithm resource A4 calls algorithm resource A5.

[0044] Therefore, the terminal device 100 configures the target algorithm resources according to the dependency relationship of the target algorithm resources, and then processes the video using the configured target algorithm resources to obtain the processed video.

[0045] It should be noted that the algorithm resources in the embodiments of the present disclosure may include various algorithm resources, such as algorithm resources for video processing and algorithm resources required for running electronic games. The electronic games mentioned in the embodiments of the present disclosure may include games run by executing applications on terminal devices, and the corresponding algorithm resources may include algorithm resources that need to be called when running the game, such as algorithm resources for processing role models, textures, actions, skills, sound effects, etc. in the game. It should be understood by those skilled in the art that the present disclosure does not limit the types of algorithm resources, etc.

[0046] Figure 2A flow chart of a method for configuring algorithm resources provided in an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the method includes:

[0047] S101. Obtain at least two original algorithm resource packages, each of which includes at least one algorithm resource.

[0048] The disclosed embodiments are applicable to a scenario where at least two original algorithm resource packages are obtained, each of which includes at least one algorithm resource. In the field of video processing, the algorithm resources can be used to process videos.

[0049] After obtaining multiple algorithm resource packages, the prior art usually directly uses the algorithm resources in each algorithm resource package to process the video, but this has the problem of repeated use of the same type of algorithm resources. In order to overcome this problem, the present disclosure further determines the redundant resources in the algorithm resource packages of repeated types in these algorithm resource packages after obtaining the algorithm resource packages, and then deletes the redundant resources, thereby preparing for the subsequent streamlining of algorithm resources.

[0050] S102: Determine the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources.

[0051] For an algorithm resource package, the types of algorithm resources and the initial dependencies between algorithm resources can be determined in advance based on the functions that the algorithm resource package can realize and the functions of each algorithm resource in the algorithm resource package. The initial dependencies are the dependencies that are predetermined among the algorithm resources in an algorithm resource package.

[0052] Figure 3 A schematic diagram of two original algorithm resource packages provided in the embodiment of the present disclosure, such as Figure 3 As shown, the original algorithm resource package 1 includes 8 algorithm resources A to H, and the original algorithm resource package 2 includes 10 algorithm resources A to H, K and L. The arrows connecting the algorithm resources in the figure indicate that the algorithm resources have dependencies. For example, in the original algorithm resource package 2, there is a connection between algorithm resource C and algorithm resource G, indicating that algorithm resource C and algorithm resource G have dependencies.

[0053] It should be noted that the dependencies are determined based on the algorithm resource package. Different algorithm resource packages may determine different dependencies. Figure 3 For example, the algorithm resource E in the original algorithm resource package 1 has a dependency relationship only with the algorithm resource D, but the algorithm resource E in the original algorithm resource package 2 has a dependency relationship with both the algorithm resources D and L. It can be seen that for different algorithm resource packages, the dependency relationships between the algorithm resources in the algorithm resource package may be different.

[0054] S103: Determine algorithm resources of repeated types in at least two original algorithm resource packages, and determine redundant algorithm resources in the algorithm resources of repeated types according to a preset rule.

[0055] by Figure 3 For example, the algorithm resources of the same type in the original algorithm resource packages 1 and 2 include A, B, C, D, E, F, G, and H. If both original algorithm resource packages are executed once, it is obvious that these algorithm resource packages of the same type will be executed twice. Therefore, after determining the algorithm resources of the same type, the present disclosure can determine the redundant algorithm resources in the algorithm resources of the same type according to preset rules.

[0056] In this disclosure, the number of redundant algorithm resources is not limited. Figure 3 For example, algorithm resource D belongs to the repeated type of algorithm resources in two algorithm resource packages. One of the algorithm resources D can be used as a redundant resource, or neither of the two algorithm resources D can be used as redundant resources. That is to say, if the number of repeated algorithm resources of a certain type is m, then the number of redundant algorithm resources can be 0 or m-1.

[0057] S104: Use other algorithm resources except redundant algorithm resources in at least two original algorithm resource packages as target algorithm resources, and determine the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource packages.

[0058] by Figure 3 Taking as an example, according to the preset rules, the redundant resources finally determined from the two original algorithm resource packages include: 1 A, 1 B, 1 C, 1 F, 1 G, and 1 H. That is to say, the target algorithm resources in the two original algorithm resource packages include 1 algorithm resource A, 1 algorithm resource B, 1 algorithm resource C, 2 algorithm resources D, 2 algorithm resources E, 1 algorithm resource F, 1 algorithm resource G, 1 algorithm resource H, 1 algorithm resource K, and 1 algorithm resource L.

[0059] After the target algorithm resources are determined, the dependencies between the target algorithm resources can be determined in combination with the initial dependencies between the algorithm resources in the original algorithm resource package. For example, if there is a dependency relationship between algorithm resource A and algorithm resource B in the original algorithm resource package, then after being determined as the target algorithm resource, the dependency relationship between algorithm resource A and algorithm resource B remains unchanged; if there is a dependency relationship between algorithm resource B and algorithm resource D in the original algorithm resource package, and the target algorithm resource includes two algorithm resources D, when the dependency relationship between algorithm resource B and algorithm resource D is redetermined, only the dependency relationship between algorithm resource B and one of the algorithm resources D is further retained according to the preset update rule; if there is a dependency relationship between algorithm resource C and algorithm resource D in the original algorithm resource package, and the target algorithm resource includes two algorithm resources D, when the dependency relationship between algorithm resource C and algorithm resource D is redetermined, the dependency relationship between algorithm resource C and both algorithm resources D is retained; if there is a dependency relationship between algorithm resource D and E in the original algorithm resource package, and the target algorithm resource includes two algorithm resources D (D1 and D2) and two E (E1 and E2), then a dependency relationship can be established between D1 and E1, and a dependency relationship can be established between algorithm resource D2 and algorithm resource E2.

[0060] It can be seen that according to the embodiment of the present disclosure, when determining the dependency relationship between target algorithm resources, the dependency relationship between the target algorithm resources is determined based on the original dependency relationship and the corresponding rules preset for each target algorithm resource.

[0061] S105. Configure target algorithm resources according to dependencies between target algorithm resources.

[0062] After determining the dependencies between target algorithm resources, you can configure the target algorithm resources based on the dependencies. Figure 3 For example, first, the algorithm resource H can be configured, and then the configured algorithm resource H is used to configure the algorithm resources F and G that have a dependency relationship with the algorithm resource H, and then the configured F and G are used to configure the first algorithm resource E (E1), the second algorithm resource E (E2) and the algorithm resource C, and the configured algorithm resource E1 is used to configure the first algorithm resource D (D1), and the configured algorithm resource E2 is used to configure the second algorithm resource D (D2) and the algorithm resource L, and then the configured algorithm resource D1 is used to configure the algorithm resources B and C, and then the configured algorithm resources B and C are used to configure the algorithm resource A, and the configured algorithm resource L is used to configure the algorithm resource K, and then the configuration of all target algorithm resources is completed. Taking the application of algorithm resources to process videos as an example, all configured target algorithm resources are run on the video to obtain the processed video.

[0063] The algorithm resource configuration method disclosed in the present invention obtains at least two original algorithm resource packages, determines the type of each algorithm resource in the original algorithm resource packages and the initial dependency relationship between the algorithm resources, determines redundant algorithm resources from algorithm resources of repeated types, thereby avoiding repeated calls of algorithm resources of the same type, and uses the algorithm resources other than the redundant algorithm resources in the original algorithm resource package as target algorithm resources, and determines the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource package; configures the target algorithm resources according to the dependency relationship between the target algorithm resources, which can reduce the overhead generated by redundant operation of algorithm resources.

[0064] Based on the above embodiments, as an optional embodiment, other algorithm resources except redundant algorithm resources in at least two original algorithm resource packages are used as target algorithm resources, and then the method further includes: packaging the target algorithm resources into the same new algorithm resource package.

[0065] It should be noted that after the target algorithm resources are configured, although the target algorithm resources can be run in sequence from the two original algorithm resource packages according to the configured target algorithm resources, there is a problem of cumbersome calling from the original algorithm resource packages. If the target algorithm resources are needed later, two original algorithm resource packages still need to be obtained, which requires more storage space. Therefore, after determining the target algorithm resources, the embodiment of the present disclosure can also package the target algorithm resources into the same new algorithm resource package and configure the target algorithm resources in the new algorithm resource package. When the video needs to be processed accordingly later, the new algorithm resource package can be directly called, which not only saves time and improves operating efficiency, but also saves storage space.

[0066] by Figure 3 Taking the configuration results of the two original algorithm resource packages in as an example, the new algorithm resource package includes 1 algorithm resource A, 1 algorithm resource B, 1 algorithm resource C, 2 algorithm resources D, 2 algorithm resources E, 1 algorithm resource F, 1 algorithm resource G, 1 algorithm resource H, 1 algorithm resource K and 1 algorithm resource L.

[0067] By packaging algorithm resources in the form of resource sets, the number of algorithm resources finally obtained is controllable, and the number of algorithm resources packaged in resource sets is far less than the sum of the algorithm resources in all original algorithm resource packages, which can avoid calling errors and redundant operation of algorithm resources.

[0068] Based on the above embodiments, as an optional embodiment, determining algorithm resources of repeated types in at least two original algorithm resource packages, and determining redundant algorithm resources in the algorithm resources of repeated types according to preset rules, further comprising:

[0069] For each original algorithm resource package, a directed graph corresponding to the original algorithm resource package is generated according to the initial dependency relationship between the algorithm resources in the original algorithm resource package; wherein each node in the directed graph is used to represent the algorithm resource in the original algorithm resource package, and the directed graph includes the topological relationship between the nodes, and the topological relationship between the nodes is used to represent the initial dependency relationship between the algorithm resources.

[0070] The directed graph corresponding to the original algorithm resource package of this disclosure can be found in Figure 3 ,like Figure 3 As shown, each algorithm resource package corresponds to a directed graph, and each algorithm resource is represented by a circular node in the directed graph. Figure 3 The topological relationship between nodes is represented by arrows. The topological relationship is used to represent the initial dependency between algorithm resources. For example, in Figure 3 In the example, algorithm resource A depends on algorithm resource B. When algorithm resource A is called, algorithm resource B also needs to be called according to the original dependency relationship.

[0071] Based on the above embodiments, as an optional embodiment, the embodiment of the present disclosure combines the initial dependency relationship between the algorithm resources in the original algorithm resource package to determine the dependency relationship between the target algorithm resources, including:

[0072] S201, determining a target node representing a target algorithm resource in a directed graph corresponding to each original algorithm resource package;

[0073] S202, topologically sorting the target nodes according to the nodes connected to the target nodes in the corresponding directed graphs to obtain a target topological sequence;

[0074] by Figure 3 For example:

[0075] The nodes connected to the target node A in the directed graph corresponding to the original algorithm resource package 1 are B and C. The nodes connected to the target node A in the directed graph corresponding to the original algorithm resource package 2 are B and C. The result 1 of topological sorting is: A, B; the result 2 is: A, C.

[0076] The nodes connected to the target node B in the directed graph corresponding to the original algorithm resource packages 1 and 2 are all D. According to the preset rules, it is determined that the target algorithm resources include two algorithm resources of type D. Further, according to the preset update rules, only the dependency relationship between B and one of the nodes of type D is retained for the target node B. Based on the above result 1, the sorting is continued to obtain result 3: A, B, D1; where D1 represents the node corresponding to one of the algorithm resources of type D.

[0077] The nodes connected to the directed graph corresponding to the target node C in the original algorithm resource packages 1 and 2 are both D and G. Taking node D as an example, considering that the target algorithm resource includes two algorithm resources of type D, the target node C retains the dependency relationship with the two nodes of type D, and continues to sort on the basis of result 2 to obtain result 4: A, C, D1 and result 5: A, C, D2; where D2 represents the node corresponding to another algorithm resource of type D.

[0078] The nodes connected to the directed graph corresponding to the target node D in the original algorithm resource packages 1 and 2 are all E. Considering that the target algorithm resources include two algorithm resources of type E, D1 maintains a dependency relationship with E1, and D2 maintains a dependency relationship with E2, so as to continue sorting on the basis of result 3 and obtain result 6: A, B, D1, E1. Continue sorting on the basis of result 4 and obtain result 7: A, C, D1, E1. Continue sorting on the basis of result 5 and obtain result 8: A, C, D2, E2.

[0079] Similarly, the other target algorithm resources in the original algorithm resource packages 1 and 2 are sorted, and finally the Figure 3 The target topology sequence of the embodiment is:

[0080] A, B, D1, E1, F, H;

[0081] A, C, D1, E1, F, H;

[0082] A, C, D2, E2, F, H;

[0083] A, C, G, H;

[0084] K,L,E2,F,H.

[0085] S203. Determine the dependency relationship between target algorithm resources according to the target topology sequence.

[0086] With the above Figure 3 Taking the target topology sequence of the embodiment as an example, algorithm resource A has a dependency relationship with algorithm resource B and algorithm resource C; algorithm resource B has a dependency relationship with one of the algorithm resources D (D1); algorithm resource C has a dependency relationship with two algorithm resources D and algorithm resource G; algorithm resource D1 has a dependency relationship with one of the algorithm resources E (E1); algorithm resource D2 has a dependency relationship with another algorithm resource E (E2); algorithm resource E1 has a dependency relationship with algorithm resource F; algorithm resource E2 has a dependency relationship with algorithm resource F; algorithm resource K has a dependency relationship with algorithm resource L; algorithm resource L has a dependency relationship with algorithm resource E2; algorithm resource F has a dependency relationship with algorithm resource H; algorithm resource G has a dependency relationship with algorithm resource H.

[0087] Based on the above embodiments, as an optional embodiment, in order to avoid repeated analysis of target algorithm resources when the algorithm resources are used subsequently, the present disclosure further includes: generating a target directed graph according to the target topological sequence;

[0088] The target directed graph includes target nodes and topological relationships between target nodes, and the topological relationships between target nodes are used to characterize the dependency relationships between target algorithm resources.

[0089] See also Figure 4 , Figure 4 A schematic diagram of a target directed graph provided by an embodiment of the present disclosure, Figure 4 The target directed graph shown is based on Figure 3 The target algorithm resources are generated by determining the two original algorithm resource packages shown. Figure 4 D1 in the figure represents an algorithm resource package of type D, and D2 represents another algorithm resource package of type D. Similarly, E1 represents an algorithm resource package of type E, and E2 represents another algorithm resource package of type E. That is to say, although algorithm resources D and E are algorithm resources of repeated types, there are no redundant algorithm resources in algorithm resources D and E. Figure 4 The dependency relationship between target algorithm resources is clearly recorded in the form of a directed graph. After the target algorithm resources are packaged into a new algorithm resource package, when the new algorithm resource package is subsequently used with other algorithm resource packages, the directed graph of the new algorithm resource package has been pre-generated, which can reduce the workload of configuring algorithm resources and improve work efficiency.

[0090] Based on the above embodiments, as an optional embodiment, determining redundant algorithm resources in algorithm resources of repeated types according to a preset rule includes:

[0091] S301, obtaining preset rules;

[0092] Since the dependencies between algorithm resources of the same type in different algorithm resource packages may be different, and the dependencies between algorithm resources of different types in the same algorithm resource package must be different, the present disclosure can set corresponding preset rules for each algorithm resource, so as to more flexibly determine redundant algorithm resources.

[0093] S302: If the preset rule includes merging algorithm resources of the same type that have the same initial dependency, at least one algorithm resource among the algorithm resources of the same type is determined as a reserved algorithm resource, and the other algorithm resources among the algorithm resources of the same type except the reserved algorithm resource are regarded as redundant algorithm resources;

[0094] S303: If the preset rule includes not merging algorithm resources of the same type that have the same initial dependency, it is determined that there are no redundant algorithm resources among the algorithm resources of the same type.

[0095] Based on the above embodiments, as an optional embodiment, the original algorithm resource package also includes type information and dependency information, the type information includes the type of each algorithm resource in the original algorithm resource package; the dependency information includes the initial dependency between the algorithm resources in the original algorithm resource package.

[0096] by Figure 3 For example, the dependency information recorded in the original algorithm resource package 1 includes that there is a dependency between algorithm resource A and algorithm resource B, there is a dependency between algorithm resource A and algorithm resource C, there is a dependency between algorithm resource B and algorithm resource D, there is a dependency between algorithm resource C and algorithm resource D, there is a dependency between algorithm resource C and algorithm resource G, there is a dependency between algorithm resource D and algorithm resource E, there is a dependency between algorithm resource E and algorithm resource F, there is a dependency between algorithm resource F and algorithm resource H, and there is a dependency between algorithm resource G and algorithm resource H. By recording the dependency information in the algorithm resource package, the embodiment of the present disclosure enables the dependency of each algorithm resource to be quickly determined according to the dependency information when the algorithm resources are subsequently configured, so as to prepare for the subsequent streamlining of algorithm resources, facilitate the re-determination of new dependencies of each algorithm resource, and reduce the overhead generated by the redundant operation of algorithm resources.

[0097] The present disclosure provides a configuration device for algorithm resources, such as Figure 5 As shown, the device may include: an algorithm resource package acquisition module 101, an information determination module 102, a redundant resource determination module 103, a dependency update module 104 and a configuration module 105. Specifically:

[0098] The algorithm resource package acquisition module 101 is used to acquire at least two original algorithm resource packages, each of which includes at least one algorithm resource;

[0099] An information determination module 102 is used to determine the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources;

[0100] The redundant resource determination module 103 is used to determine the algorithm resources of repeated types in at least two original algorithm resource packages, and determine the redundant algorithm resources in the algorithm resources of repeated types according to a preset rule;

[0101] The dependency updating module 104 is used to take the other algorithm resources except the redundant algorithm resources in at least two original algorithm resource packages as target algorithm resources, and determine the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource packages;

[0102] The configuration module 105 is used to configure the target algorithm resources according to the dependencies between the target algorithm resources.

[0103] The algorithm resource configuration device provided in the embodiment of the present invention specifically executes the above method embodiment process. For details, please refer to the content of the above algorithm resource configuration method embodiment, which will not be repeated here. The algorithm resource configuration device provided in the embodiment of the present invention obtains at least two original algorithm resource packages, determines the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between algorithm resources, determines redundant algorithm resources from algorithm resources of repeated types, thereby avoiding repeated calls of algorithm resources of the same type, and uses other algorithm resources in the original algorithm resource package except the redundant algorithm resources as target algorithm resources, and determines the dependency relationship between target algorithm resources in combination with the initial dependency relationship between algorithm resources in the original algorithm resource package; configures the target algorithm resources according to the dependency relationship between target algorithm resources, which can reduce the overhead generated by redundant operation of algorithm resources.

[0104] Based on the above embodiments, as an optional embodiment, the configuration device further includes:

[0105] The packaging module is used to package the target algorithm resources into the same new algorithm resource package after taking the other algorithm resources except the redundant algorithm resources in at least two original algorithm resource packages as the target algorithm resources.

[0106] Based on the above embodiments, as an optional embodiment, the configuration device further includes:

[0107] A directed graph generation module is used to generate a directed graph corresponding to each original algorithm resource package according to the initial dependency relationship between the algorithm resources in the original algorithm resource package before determining the algorithm resources of the same type in at least two original algorithm resource packages;

[0108] Each node in the directed graph is used to represent the algorithm resource in the original algorithm resource package. The directed graph includes the topological relationship between the nodes. The topological relationship between the nodes is used to represent the initial dependency relationship between the algorithm resources.

[0109] Based on the above embodiments, as an optional embodiment, the dependency updating module includes:

[0110] A target node determination unit, used to determine a target node representing a target algorithm resource in a directed graph corresponding to each original algorithm resource package;

[0111] A sorting unit, used to topologically sort the target nodes according to the nodes connected to the target nodes in the corresponding directed graphs, to obtain a target topological sequence;

[0112] The dependency determination unit is used to determine the dependency between target algorithm resources according to the target topology sequence.

[0113] Based on the above embodiments, as an optional embodiment, the configuration device further includes:

[0114] A target directed graph building module is used to generate a target directed graph according to a target topological sequence;

[0115] The target directed graph includes target nodes and topological relationships between target nodes, and the topological relationships between target nodes are used to characterize the dependency relationships between target algorithm resources.

[0116] Based on the above embodiments, as an optional embodiment, the redundant resource determination module includes:

[0117] A preset rule determination unit, used to obtain the preset rule;

[0118] A first judgment unit is configured to determine, if the preset rule includes merging algorithm resources of the same type that are repeated and have the same initial dependency, at least one algorithm resource among the algorithm resources of the same type that are repeated is a reserved algorithm resource, and to regard the other algorithm resources among the algorithm resources of the same type that are repeated except for the reserved algorithm resource as redundant algorithm resources;

[0119] The second judgment unit is used to determine that there are no redundant algorithm resources in the repeated algorithm resources if the preset rule includes not merging repeated algorithm resources of the same type with the same initial dependency.

[0120] Based on the above embodiments, as an optional embodiment, the original algorithm resource package also includes type information and dependency information, the type information includes the type of each algorithm resource in the original algorithm resource package; the dependency information includes the initial dependency between the algorithm resources in the original algorithm resource package.

[0121] An electronic device is provided in an embodiment of the present disclosure, and the electronic device includes: a memory and a processor; at least one program, stored in the memory, and used to obtain at least two original algorithm resource packages when executed by the processor, each original algorithm resource package including at least one algorithm resource; determine the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources; determine the algorithm resources of repeated types in at least two original algorithm resource packages, and determine the redundant algorithm resources in the algorithm resources of repeated types according to preset rules; use the other algorithm resources in at least two original algorithm resource packages except the redundant algorithm resources as target algorithm resources, and determine the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource packages; configure the target algorithm resources according to the dependency relationship between the target algorithm resources. Compared with the prior art, the present invention can achieve the following: by obtaining at least two original algorithm resource packages, determining the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources, determining redundant algorithm resources from algorithm resources of repeated types, thereby avoiding repeated calls of algorithm resources of the same type, taking the algorithm resources other than the redundant algorithm resources in the original algorithm resource package as target algorithm resources, and determining the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource package; configuring the target algorithm resources according to the dependency relationship between the target algorithm resources, which can reduce the overhead generated by redundant operation of algorithm resources.

[0122] In an alternative embodiment, an electronic device is provided, such as Figure 6 As shown, Figure 6 The electronic device 600 shown includes: a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 606 or a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0123] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 606 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0124] The disclosed embodiment provides a computer-readable storage medium, which stores a computer program, and when the computer is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment. Compared with the prior art, by obtaining at least two original algorithm resource packages, determining the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources, determining redundant algorithm resources from the algorithm resources with repeated types, thereby avoiding the same type of algorithm resources from being repeatedly called, taking the other algorithm resources in the original algorithm resource package except the redundant algorithm resources as the target algorithm resources, and combining the initial dependency relationship between the algorithm resources in the original algorithm resource package to determine the dependency relationship between the target algorithm resources; configuring the target algorithm resources according to the dependency relationship between the target algorithm resources, it is possible to reduce the overhead generated by the redundant operation of the algorithm resources.

[0125] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer program product. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program product can be downloaded and installed from the network through the communication device 609, or installed from the storage device 606, or installed from the ROM 602. When the computer program product is executed by the processing device 601, the above-mentioned functions defined in the configuration method of the algorithm resources of the embodiment of the present disclosure are executed.

[0126] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0127] The above are only some embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for configuring algorithm resources, characterized in that: include: Acquire at least two original algorithm resource packages, each of which includes at least one algorithm resource; Determine the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources; wherein the initial dependency relationship is determined according to the original algorithm resource package; Determine algorithm resources of repeated types in the at least two original algorithm resource packages, and determine redundant algorithm resources in the algorithm resources of repeated types according to a preset rule; Taking the other algorithm resources in the at least two original algorithm resource packages except the redundant algorithm resources as target algorithm resources, and determining the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource packages; The target algorithm resources are configured according to the dependencies between the target algorithm resources.

2. The method for configuring algorithm resources according to claim 1, characterized in that: The method further comprises: taking the other algorithm resources in the at least two original algorithm resource packages except the redundant algorithm resources as target algorithm resources; The target algorithm resources are packaged into the same new algorithm resource package.

3. The method for configuring algorithm resources according to claim 1, characterized in that: The determining of the algorithm resources of the repeated type in the at least two original algorithm resource packages, and determining redundant algorithm resources in the algorithm resources of the repeated type according to a preset rule, further comprises: For each original algorithm resource package, generating a directed graph corresponding to the original algorithm resource package according to the initial dependency relationship between the algorithm resources in the original algorithm resource package; Each node in the directed graph is used to represent the algorithm resource in the original algorithm resource package, and the directed graph includes the topological relationship between the nodes, and the topological relationship between the nodes is used to represent the initial dependency relationship between the algorithm resources.

4. The method for configuring algorithm resources according to claim 3, characterized in that: The determining the dependency relationship between the target algorithm resources by combining the initial dependency relationship between the algorithm resources in the original algorithm resource package includes: Determine a target node corresponding to the target algorithm resource in the directed graph corresponding to each original algorithm resource package; According to the nodes connected to the target nodes in the directed graphs corresponding to the target nodes, topologically sorting the target nodes to obtain a target topological sequence; Dependencies between target algorithm resources are determined according to the target topology sequence.

5. The method for configuring algorithm resources according to claim 4, characterized in that: The method further comprises: Generate a target directed graph according to the target topological sequence; The target directed graph includes target nodes and topological relationships between the target nodes, and the topological relationships between the target nodes are used to characterize the dependency relationships between the target algorithm resources.

6. The method for configuring algorithm resources according to claim 1, characterized in that: The determining, according to a preset rule, redundant algorithm resources among the algorithm resources of the repeated type includes: Obtaining the preset rule; If the preset rule includes merging algorithm resources of the same type that are repeated and have the same initial dependency, at least one of the algorithm resources of the same type is determined to be a reserved algorithm resource, and the other algorithm resources of the algorithm resources of the same type except the reserved algorithm resource are regarded as redundant algorithm resources; If the preset rule includes not merging algorithm resources of the same type that have the same initial dependency, it is determined that there are no redundant algorithm resources among the algorithm resources of the same type that have been repeated.

7. The method for configuring algorithm resources according to claim 1, characterized in that: The original algorithm resource package also includes type information and dependency information. The type information includes the type of each algorithm resource in the original algorithm resource package; the dependency information includes the initial dependency between the algorithm resources in the original algorithm resource package.

8. A device for configuring algorithm resources, characterized in that: include: An algorithm resource package acquisition module, used to acquire at least two original algorithm resource packages, each of which includes at least one algorithm resource; An information determination module, used to determine the type of each algorithm resource in the original algorithm resource package and the initial dependency relationship between the algorithm resources; wherein the initial dependency relationship is determined according to the original algorithm resource package; A redundant resource determination module, used to determine algorithm resources of repeated types in the at least two original algorithm resource packages, and determine redundant algorithm resources in the algorithm resources of repeated types according to preset rules; A dependency updating module, used to take the other algorithm resources in the at least two original algorithm resource packages except the redundant algorithm resources as target algorithm resources, and determine the dependency relationship between the target algorithm resources in combination with the initial dependency relationship between the algorithm resources in the original algorithm resource packages; A configuration module is used to configure the target algorithm resources according to the dependencies between the target algorithm resources.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the algorithm resource configuration method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the steps of the algorithm resource configuration method as claimed in any one of claims 1 to 7.

11. A computer program product, characterized in that It includes computer instructions, which, when executed by a processor, implement the configuration method of the algorithm resources as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Resource-bundle obtaining method and device, equipment and computer readable storage medium

    CN108536463A

  • A method and device for detecting a BGP abnormal event

    CN109040143A