A variable processing method and electronic device for algorithm dimension measurement

By deleting the duplicate variables in the variable list of the camera's camera algorithm, generating a second variable list, and storing its status information, the problem of large storage space occupied by electronic devices when taking pictures is solved, and the user experience is improved.

CN118446880BActive Publication Date: 2025-03-14SHANGHAI GLORY SMART TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311147648.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2025-03-14
Estimated Expiration
2043-09-06

AI Technical Summary

Technical Problem

When taking pictures at the camera, electronic devices need to save each frame of pictures and their operation logs of the photo algorithm, resulting in a large storage space occupies and affecting the user experience.

Method used

By obtaining the first variable list corresponding to multiple algorithms required to run the application, deleting the same variables in the list, generating a second variable list, and storing the status information of each variable in the second variable list when the application is running.

Benefits of technology

The memory space occupied by saving pictures and taking pictures of the algorithm to measure the state information of key variables is reduced, and the user experience on the electronic device user side is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118446880B_ABST
    Figure CN118446880B_ABST
Patent Text Reader

Abstract

The present application provides a variable processing method and electronic device for algorithm dimensioning, which are applied to the field of terminal technology. The method includes: obtaining N first variable lists required to run the application. Each first variable list corresponds to an algorithm, and a first variable list includes multiple variables, N≥2, and N is an integer. When the i-th first variable list and the j-th first variable list have the same first variable, the first variable is deleted in the j-th first variable list, N≥j≥1, N≥i≥1 and i is an integer, j is an integer, i≠j, and N second variable lists are obtained, and the variables in the j-th second variable list are the variable lists after the j-th first variable list deletes the first variable. By deleting the same variables in the N first variable lists, the embodiment of the present application can greatly reduce the number of variables in the variable list, thereby improving the user experience on the user side of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a variable processing method and electronic device for algorithm dimensioning. Background Art

[0002] When the camera takes a picture, the electronic device must save each frame of the picture and the running log of the camera algorithm for each frame of the picture. Developers can locate the cause of the problem in the camera operation process based on the running log of the camera algorithm for each frame of the picture. At present, the running log of the camera algorithm mainly stores the status information corresponding to the key variables measured by the camera algorithm, such as the number of faces, the orientation of faces, and the exposure value. However, when the camera takes a picture, many camera algorithms are involved, and each camera algorithm involves many key variables. Therefore, when the camera takes a picture, the electronic device needs to provide a large storage space to save each frame of the picture and the state information corresponding to the key variables measured by the camera algorithm for each frame of the picture. For example, when the mobile phone camera takes a picture, there are 25 camera algorithms, involving a total of 272 key variables. Therefore, when the mobile phone camera takes a picture, the mobile phone needs to provide a large storage space to save each frame of the picture and the state information of the 272 key variables corresponding to each frame of the picture. From the user side of the electronic device, the user sees that the storage of each frame of the picture by the electronic device when taking a picture will occupy a large memory space, and the user experience is poor. Summary of the invention

[0003] The present application provides a variable processing method for algorithm measurement and an electronic device, which are used to reduce the memory space occupied by saving each frame of the picture and the state information corresponding to the key variables of the photography algorithm measurement for each frame of the picture, thereby improving the user experience on the user side of the electronic device to a certain extent.

[0004] In order to achieve the above objectives, this application adopts the following technical solutions:

[0005] In the first aspect, an embodiment of the present application provides a variable processing method for algorithm dimensioning. Obtain N first variable lists corresponding to N algorithms required to run the application. Among them, 1 algorithm corresponds to 1 first variable list, and 1 first variable list includes multiple variables, N≥2, and N is an integer. When the i-th first variable list and the j-th first variable list have the same first variable, delete the first variable in the j-th first variable list, N≥j≥1, N≥i≥1 and i is an integer, j is an integer, i≠j, and obtain N second variable lists, and the variables in the j-th second variable list are the variable lists after the j-th first variable list deletes the first variable. When the application is running, the status information corresponding to each variable in the N second variable lists is stored.

[0006] When the application level is a mobile phone camera, since the variables in the variable list are extracted by the algorithm provider based on experience, there are many duplicate variables between the variable lists. For example, the same variable, the number of faces, exists in the variable lists of multiple algorithms corresponding to camera photography. Storing all the same variables in the storage space will cause a waste of space resources in the storage space. The embodiment of the present application can greatly reduce the number of variables in the variable list by deleting the same variables in the N first variable lists, thereby reducing the memory space occupied by saving each frame of the picture and the state information corresponding to the key variables of the camera algorithm for measuring each frame of the picture when the application is running, thereby improving the user experience of the electronic device user side to a certain extent.

[0007] In an optional implementation, multiple variables in N first variable lists are used to construct an algorithm flow decision tree, the root node of the algorithm flow decision tree is the node corresponding to the application, each subnode in the algorithm flow number corresponds to one of the N algorithms, and each leaf node in the algorithm flow number corresponds to one variable in the N first variable lists. From the leaf node corresponding to the i-th sub-algorithm and the leaf node corresponding to the j-th sub-algorithm of the algorithm flow decision tree, the first leaf node with the same name and the same function is matched, and the first leaf node is determined as the same first variable in the i-th first variable list and the j-th first variable list. Delete the first variable in the j-th first variable list. The embodiment of the present application processes the variables measured by the algorithm dimension through the algorithm flow decision tree, which has a faster running speed than directly calling the first variable list corresponding to each algorithm, and the method of obtaining the same variable is more accurate and reliable.

[0008] Optionally, according to the algorithm codes corresponding to N algorithms, determine the frequency of occurrence of each variable in the zth first variable list in the N first variable lists in the zth algorithm; N≥z≥1 determine the importance level of each variable in the zth first variable list according to the frequency of occurrence of the variable, and the importance level is positively correlated with the frequency of occurrence of the variable; determine the importance level of each variable in the N first variable lists in turn; structure each variable in the N first variable lists to obtain variable structured data; construct an algorithm process decision tree according to the variable structured data and the importance level of each variable in the N first variable lists; the node attributes of the leaf nodes in the algorithm process decision tree include at least the variable name corresponding to the leaf node, the variable function attribute, and the importance level of the variable.

[0009] Optionally, the first leaf node corresponding to the jth algorithm subnode in the algorithm process decision tree is pruned to delete the first variable in the jth first variable list to obtain the jth second variable list; the importance level of the first leaf node corresponding to the i-th algorithm subnode is higher than the importance level of the first leaf node corresponding to the j-th algorithm subnode. It can be seen that the embodiment of the present application considers the importance level of the variable in the algorithm when deleting, so that the key variables obtained for algorithm dimension measurement are more representative and can more accurately locate the algorithm that causes the problem.

[0010] In another optional implementation, from multiple variables in the N second variable lists, variable names whose field length of the variable name exceeds the preset length threshold are determined; when the field length of the variable name of the mth variable exceeds the preset length threshold, the variable name of the mth variable is compressed, where m≥1, and m is an integer. By simplifying the variable names, on the one hand, the field length of the variable names can be reduced, thereby reducing the memory occupied by the variable names, and on the other hand, the variable names of the algorithm measurement can be prevented from being attacked, causing the algorithm to be unable to be used normally, thereby increasing the confidentiality of the algorithm measurement. Optionally, obtain the algorithm code of the pth algorithm, N≥p≥1, and p is an integer; cluster the variables in the second variable list of the pth algorithm according to the algorithm code to obtain k clusters, k≥2, and k is an integer; and determine the frequency of occurrence of the variables in the second variable list of the pth algorithm; obtain the frequency of problems with the variables in the second variable list of the pth algorithm; based on the frequency of occurrence of each variable in each cluster and the frequency of problems with each variable, select 1 sample variable from each cluster to obtain k sample variables; use the k sample variables as the variables in the second variable list corresponding to the pth algorithm. By clustering and selecting sample variables, the variables measured by each algorithm can be further streamlined, and the algorithm where the problem occurs can be more accurately located.

[0011] Optionally, when the algorithm code is equally divided into a first execution stage, a second execution stage and a third execution stage according to the execution order, the algorithm code runs in the first execution stage, the second execution stage, and the third execution stage, clustering the variables in the first execution stage of the p-th algorithm to obtain a first cluster; clustering the variables in the second execution stage of the p-th algorithm to obtain a second cluster; clustering the variables in the second execution stage of the p-th algorithm to obtain a third cluster.

[0012] Optionally, obtain a first weight coefficient for the frequency of variable occurrence and a second weight coefficient for the frequency of variable problem occurrence; determine the sum of each variable in each cluster based on the product of the first weight coefficient and the frequency of variable occurrence and the sum of the product of the second weight coefficient and the frequency of variable problem occurrence; select the variable with the largest sum from each cluster as the sample variable to obtain k sample variables.

[0013] In another optional implementation, when a problem occurs during the operation of an application, the status information corresponding to each variable in the N second variable lists sent by the electronic device is received; the status information corresponding to each variable in the N second variable lists is respectively input into a pre-built classification model to obtain the frequency of occurrence of each algorithm submodule in the N algorithms; the abnormal probability of each algorithm submodule in the N algorithms is determined based on the frequency of occurrence of each algorithm submodule in the N algorithms and the total number of variables in the N second variable lists; the algorithm module that causes the problem is located based on the abnormal probability of each algorithm submodule in the N algorithms. Through the classification model, the efficiency of abnormal analysis by developers can be accelerated.

[0014] Optionally, a classification model is constructed by pre-acquiring multiple abnormal variables and abnormal problems corresponding to each abnormal variable, and the classification model outputs an algorithm submodule that generates abnormal problems.

[0015] In a second aspect, the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory being coupled to the processor;

[0016] The memory stores a program, and when the program is executed by the processor, the electronic device executes any method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0018] Figure 2 A flow chart of a variable processing method for algorithm dimension measurement provided in an embodiment of the present application;

[0019] Figure 3 A simplified schematic diagram of the memory size of a frame image provided in an embodiment of the present application;

[0020] Figure 4 A flowchart of a method for processing algorithm measurement variables based on an algorithm process decision tree provided in an embodiment of the present application;

[0021] Figure 5 A schematic diagram of an algorithm process decision tree;

[0022] Figure 6 A decision tree based on algorithm A and algorithm B provided in an embodiment of the present application;

[0023] Figure 7 A flow chart of a variable processing method for simplified algorithm dimensioning provided in an embodiment of the present application;

[0024] Figure 8 A schematic diagram of a graph structure clustering method provided in an embodiment of the present application;

[0025] Fig. 9 A flowchart of a method for viewing abnormal variables measured by an algorithm;

[0026] Fig.10 is a schematic structural diagram of an electronic device 100;

[0027] Fig.11 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.

[0029] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0030] At present, when an electronic device takes photos with a camera on the front end (user side), photo problems may occur, such as overexposure of the picture. In order to solve the problems that occur when taking photos with the camera, users may feed back the photo problems to the back end of the electronic device (also known as the development end), and the developers will analyze and handle the photo problems. In order to locate the cause of the problem when taking photos with the camera, the developer needs to retrieve the running log of the photo taking algorithm for each frame of the picture. Therefore, when the electronic device takes each frame of the picture, it must save each frame of the picture and save the running log of the photo taking algorithm for each frame of the picture. At present, the photo taking algorithm running log mainly stores the status corresponding to the key variables measured by the photo taking algorithm, such as the number of faces status information, face orientation status information, and exposure value status information.

[0031] However, when a camera takes each frame of an image, many photo algorithms are involved. For example, when a mobile phone camera takes each frame of an image, 25 photo algorithms are involved. Each photo algorithm involves many key variables. Therefore, when an electronic device camera takes each frame of an image, the electronic device needs to provide a large storage space to save each frame of the image and the state information corresponding to the key variables measured by the photo algorithm for each frame of the image. From the user side of the electronic device, the user sees that each frame of the image stored in the electronic device will take up a large memory space, and the user experience is poor.

[0032] In view of the above problems, an embodiment of the present application provides a variable processing method for algorithm dimensioning, which is used to reduce the memory space occupied by saving each frame of the picture and the state information corresponding to the key variables of the shooting algorithm dimensioning of each frame of the picture, thereby improving the user experience.

[0033] The following is a detailed description of the variable processing method of the algorithm dimension measurement provided in the embodiment of the present application.

[0034] First, the application scenarios of the embodiments of the present application are introduced.

[0035] See also Figure 1 , is a schematic diagram of an application scenario provided by an embodiment of the present application. After the camera takes each frame of picture, the electronic device saves each frame of picture. Figure 1 (a) in the figure is a schematic diagram of the save interface for saving pictures. In the save interface, users can share, edit, collect, and delete pictures. In addition, users can also click on the picture content view space of the saved picture to obtain Figure 1 The picture content viewing interface shown in (b) in the figure. The picture content viewing interface displays picture information, such as the picture name "IMG_20230701_14410", and the picture also displays the focal length when it was shot and the picture memory "2928×3904 6.09MB". It is understandable that for users, if the picture occupies a large amount of memory, the electronic device needs to provide a large storage space to save a frame of the picture. In this way, the electronic device can save fewer pictures, and the user experience will be poor.

[0036] The image memory includes two parts, one part is the memory of each frame of the image, and the other part is the key variables of the camera algorithm measurement for taking each frame of the image. In order to reduce the image memory, the embodiment of the present application provides a variable processing method for the camera algorithm measurement.

[0037] The following describes in detail the variable processing method for measuring the photographing algorithm provided in the embodiment of the present application, taking two algorithms involved in the photographing algorithm, Algorithm A and Algorithm B, as examples.

[0038] As shown in Table 1, it is a schematic diagram of variable information of Algorithm A and Algorithm B. Among them, in the photo-taking algorithm, Algorithm A is executed first, and then Algorithm B is executed.

[0039] Algorithm A and Algorithm B both save variables in the form of variable lists. The specific variable lists include variable names, variable functional attributes, and the format of the state information corresponding to the variables. The formats of the state information include integer int, floating point float, string char, unsigned string unsigned char, unsigned integer unsigned int, etc. As shown in Table 1, it will not be discussed here.

[0040] Table 1 Variable list of algorithm A and algorithm B

[0041]

[0042] Algorithm A includes 16 variables, namely, the algorithm build version number buildinfo, width width, height height, number of faces faceNum, first face rectangle faceRect, current image angle rotation, sensor used in current scene, sensor name cameraName, bayer domain pixel RGB distribution format bayerPattern. It also includes the gain value iso of each frame, the maximum number of frames is 10, the exposure value expo of each frame, the maximum number of frames is 10, and the color temperature value color_temperature of each frame, the maximum number of frames is 10. In addition, it also includes the value r_gain of max(Rmax, Gmax, Bmax) / Rmax in the automatic white balance (Auto WhiteBalance, awb) of each frame, the value g_gain of max(Rmax, Gmax, Bmax) / Gmax in the automatic white balance (Auto WhiteBalance, awb) of each frame, the value b_gain of max(Rmax, Gmax, Bmax) / Bmax in the automatic white balance (Auto WhiteBalance, awb) of each frame, the black level value balck_level of each frame, and reservedRawHdr. Among them, max(Rmax, Gmax, Bmax) is the maximum value of Rmax, Gmax, and Bmax.

[0043] Algorithm B includes 11 variables, namely algorithm type and version Version, width width, height height, number of faces faceNum, number of bytes occupied by each pixel stride, color space color_space, first face rectangle faceRect, face angle face_angle, image field of view fov, zoom ratio zoom_ratio and reservedData.

[0044] In combination with the above Table 1, based on various embodiments, the variable processing method of the algorithm dimension measurement provided in the embodiment of the present application is described in detail.

[0045] Example 1 See Figure 2 , is a flow chart of a variable processing method for algorithm dimension measurement provided in an embodiment of the present application. The method specifically includes the following steps:

[0046] S201: The development end of the electronic device obtains N first variable lists corresponding to N algorithms required to run the application.

[0047] The development end of the electronic device is for developers of the electronic device. Developers can modify applications, such as camera algorithms, through the development end of the electronic device.

[0048] In an embodiment of the present application, N algorithms are required to run the application, where N ≥ 2 and N is an integer. Each algorithm exists in the form of a variable list on the electronic device. That is, N algorithms correspond to N first variable lists. Among them, the first variable list includes multiple variables. In an embodiment of the present application, the first variable list is a variable list formed by key variables of algorithm dimensioning based on the experience of developers. As shown in Table 1 above, the 16 variables included in the first variable list of algorithm A and the 11 variables included in the first variable list of algorithm B all belong to the first variable list. It can be understood that among the N first variable lists corresponding to N algorithms, the same variables may exist between different first variable lists. For example, algorithm A and algorithm B have the same variable face number faceNum. These identical variables will cause unnecessary waste of storage space.

[0049] In an optional implementation, in order to reduce the memory size on the user side, the development end of the electronic device automatically obtains N first variable lists corresponding to the N algorithms required to run the application, streamlines the N first variable lists, reduces the number of key variables, and thereby reduces the memory size on the user side.

[0050] In another optional implementation, when the user side of the electronic device reports a problem, such as when the memory of each frame of an image captured by a camera is too large, the development side of the electronic device first obtains N first variable lists corresponding to the N algorithms required by the application, and simplifies the N first variable lists.

[0051] The embodiment of the present application can also trigger the development end of the electronic device to obtain N first variable lists in other situations where the memory size of the user side needs to be reduced. This application is not specifically limited.

[0052] S202: The development end of the electronic device determines the same variables in the N first variable lists.

[0053] The development end of the electronic device determines the same variables in N first variable lists, wherein the same variables may be variables with the same name and attributes in each first variable list, or may be variables with the same name and attributes in different first variable lists.

[0054] When the same variables are variables with the same name and attributes in each first variable list, for example, there are three same variables in one first variable list, any two variables can be deleted from the three same variables. When the same variables are variables with the same name and attributes in different first variable lists, step S303 is executed. S203: The development end of the electronic device deletes the variables in the jth first variable list that are the same as the i-th first variable list, and obtains N second variable lists.

[0055] In the embodiment of the present application, after the same variables in the N first variable lists are determined, the same variables are simplified. The specific processing method is:

[0056] When the j-th first variable list and the i-th first variable list have the same first variable, the first variable is deleted from the j-th first variable list. Wherein, N≥j≥1, N≥i≥1 and i is an integer, j is an integer, and i≠j. For example, the first variable list corresponding to algorithm A and the first variable list corresponding to algorithm B have the same variables, specifically the number of faces faceNum and the first face rectangular frame faceRect. The number of faces faceNum and the first face rectangular frame faceRect in the first variable list corresponding to algorithm B can be deleted. The number of faces faceNum and the first face rectangular frame faceRect in the first variable list corresponding to algorithm A can also be deleted. The embodiment of the present application does not specifically limit the first variable list of deleted variables. It is worth noting that the above deletion of the first variable in the j-th first variable list is only a schematic representation, used to indicate the deletion of one first variable and the retention of one first variable.

[0057] Furthermore, considering the execution order of algorithms in the application, the first variable in the algorithm executed first is generally more important than the first variable in the algorithm executed later. Therefore, in order to enable developers to better locate the cause of the problem, the first variable in the algorithm executed later can be deleted. If the N algorithms are multiple algorithms arranged in the order of execution when the application is running, the algorithms arranged in front are executed first and the algorithms arranged in the back are executed later, then j>i. The same processing is performed on the N first variable lists to obtain N second variable lists. Among them, the second variable list is the variable list after deleting the same variables from the first variable list.

[0058] It can be seen from this that, relative to the N first variable lists, the N second variable lists delete the same variables, i.e., the space occupied by the variable fields of the algorithm dimension measurement is reduced. Therefore, the memory space occupied by the state information corresponding to the algorithm dimension measurement variables stored in the storage space of the electronic device is reduced.

[0059] In addition, since the N second variable lists do not contain the same variables, the redundancy problem of the variables saved by the entire photo-taking algorithm is avoided. It is understandable that when there is redundancy in the algorithm-dimensional variables stored in the storage space of the electronic device, such as a problem with the number of faces, there are two algorithms corresponding to the cause of the problem, namely, algorithm A and algorithm B. It is difficult for developers to manually determine whether there is a problem with algorithm A or algorithm B, that is, it is difficult for developers to quickly locate the cause of the problem. In the embodiment of the present application, there is no redundancy in the algorithm-dimensional variables. For example, when there is a problem with the number of faces, the only algorithm corresponding to the cause of the problem is algorithm A, and developers can quickly locate the cause of the problem.

[0060] In addition, for the N second variable lists, the variable name in each second variable list is a developer-defined structure format, such as the custom width is the RAWHDRANC_EXIF_INFO.width structure format. The field occupied by the name is long, which will also cause a large memory space.

[0061] To further reduce the memory occupied by the variables measured by the algorithm, the embodiment of the present application can also simplify the variable names. Specifically, when the field length of the variable name in the N second variable lists exceeds the preset length threshold, the variable name can be compressed to simplify the variable name.

[0062] Exemplary description: Assume that the preset length threshold is 10. Since the field length of the variable RAWHDRANC_EXIF_INFO.width is 25, which exceeds the preset length threshold, the variable RAWHDRANC_EXIF_INFO.width is compressed to INFOwidth.

[0063] Optionally, the embodiments of the present application may compress the variable name based on a variety of rules. For example, the first n digits of the variable name are retained. For example, for RAWHDRANC_EXIF_INFO.width, the first 5 digits are retained, and the variable name becomes RAWHD. For example, it can be based on retaining the first n different letters. For example, the variable name is RAWWWWHDRANC, and the first 4 different letters are retained, and the resulting variable name is RAWH. The embodiments of the present application may also compress the variable name in other ways, such as encryption algorithms.

[0064] From this, we can see that by simplifying the variable names, on the one hand, the field length of the variable names can be reduced, thereby reducing the memory occupied by the variable names. On the other hand, the variable names of the algorithm maintenance and testing can be prevented from being attacked, causing the algorithm to be unable to be used normally, thereby increasing the confidentiality of the algorithm maintenance and testing.

[0065] S204: The development end of the electronic device replaces the N first variable lists in the storage space of the electronic device with N second variable lists.

[0066] After the development end deletes the same variables, the N first variable lists in the electronic device storage space can be automatically replaced with N second variable lists. Or after the development end deletes the same variables, it prompts the developer whether to replace the N first variable lists in the electronic device storage space with N second variable lists. The developer confirms and then triggers the electronic device development end to replace the N first variable lists with N second variable lists. The embodiments of the present application can also complete the replacement in other ways, which is not specifically limited in this application.

[0067] like Figure 3 As shown, a simplified schematic diagram of the frame image memory size provided by an embodiment of the present application. After the electronic device deletes the same variables in different variable lists, the memory size of each frame image obtained on the user side. It can be seen that when the user side of the electronic device runs the application, the electronic device storage space stores the state information corresponding to each variable in the N second variable lists. Exemplary explanation: When the application is a camera, when the user side of the electronic device executes the camera to take pictures, the image memory size of the electronic device to save each frame of the image is significantly reduced.

[0068] In summary, the variable processing method of algorithm dimension measurement provided by the embodiment of the present application, when the application level is a mobile phone camera, because the variables in the variable list are extracted by the algorithm provider based on experience, there are many repeated variables between the variable lists. For example, the same variable, the number of faces, exists in the variable lists of multiple algorithms corresponding to camera photography. Storing all the same variables in the storage space will cause a waste of space resources of the storage space. The embodiment of the present application can greatly reduce the number of variables in the variable list by deleting the same variables in the N first variable lists, thereby reducing the memory space occupied by saving each frame of the picture and the state information corresponding to the key variables of the camera algorithm dimension measurement of each frame of the picture when the application is running, thereby improving the user experience of the electronic device user side to a certain extent.

[0069] Embodiment 2 Since each algorithm is independent when the application is running, if each algorithm is directly called to obtain the same variables by traversing the first variable list, the running speed is slow and the same variables are easily missed. Therefore, in order to quickly and accurately determine the same variables in the N first variable lists, the embodiment of the present application can determine the same variables by constructing an algorithm flow decision tree. Figure 4 , which is a flow chart of a method for processing variables in algorithm dimensioning based on an algorithm process decision tree provided in an embodiment of the present application.

[0070] S401: The electronic device development end obtains N first variable lists corresponding to N algorithms required to run the application program. Step S401 is the same as step S201 and will not be described again here.

[0071] S402: The development end of the electronic device uses multiple variables in the N first variable lists to construct an algorithm process decision tree based on the implementation processes of the N algorithms.

[0072] The algorithm process decision tree includes a root node, child nodes, and leaf nodes. The root node is the node corresponding to the application. The child node is the node corresponding to the algorithm. One algorithm corresponds to one child node, and N algorithms include N child nodes. The leaf node is the node corresponding to each variable in the N first variable lists, and one leaf node corresponds to one variable. Exemplary description: When the application is running, N algorithms are involved, namely Algorithm 1, Algorithm 2, ..., Algorithm N. The multiple variables corresponding to Algorithm 1 are x11, x12, ..., x1n1. The multiple variables corresponding to Algorithm 2 are x21, x22, ..., x2n1. .... The multiple variables corresponding to Algorithm N are xN1, xN2, ..., xNnN. Thus, we get the following Figure 5 A schematic diagram of an algorithm flow decision tree is shown. Wherein, n1, n2, ... nN can be the same number or different numbers, which is not specifically limited in this application.

[0073] The node attributes in the algorithm process decision tree include the variable name and the variable's functional attributes. The functional attributes are used to represent the function of the variable. For example, the variable faceNum shown in Table 1 has the functional attribute of the number of faces.

[0074] Optionally, the node attributes in the algorithm process decision tree may also include the importance level of each variable in the N first variable lists corresponding to the N algorithms. The importance level of a variable indicates the importance of the variable in the algorithm corresponding to the variable. The higher the importance, the higher the importance level. Among them, importance level i is lower than importance level i+1. The development end of the electronic device can determine which algorithm to delete the same variable in based on the importance level of the variable. For example, the importance level of variable A in algorithm 1 is level 1, and the importance level of variable A in algorithm 2 is level 5. At this time, the development end of the electronic device can delete variable A in algorithm 1. It can be understood that the higher the importance level of a variable in an algorithm, the more important the variable is in the algorithm. In this way, the algorithm that causes the problem can be better located.

[0075] Specifically, the development end of the electronic device can determine the frequency of occurrence of each variable in the N first variable lists according to the algorithm codes corresponding to the N algorithms. According to the frequency of occurrence of the variable, the development end of the electronic device determines the importance level of each variable in the N first variable lists. Among them, the importance level is positively correlated with the frequency of occurrence of the variable. The higher the frequency of occurrence of the variable, the higher the importance level. Since the more frequent the variable appears in the algorithm code, the more times the variable is used, and in the algorithm, the higher the importance level of the variable. Therefore, using the frequency of occurrence of the variable, the importance level of the variable can be determined more accurately.

[0076] Then the development end of the electronic device performs structured processing on each variable in the N first variable lists to obtain variable structured data. The purpose of the structured processing is to format each variable in the same data format to facilitate the construction of an algorithm process decision tree based on the knowledge graph. The embodiment of the present application can construct an algorithm process decision tree based on the variable structured data and the importance level of each variable in the N first variable lists, based on the line of sight of N algorithms, using the knowledge graph algorithm. The leaf nodes also include the importance level of the variables.

[0077] S403: The development end of the electronic device matches leaf nodes with the same name and the same functional attributes from leaf nodes of the algorithm process decision tree to obtain the same variables in the N first variable lists.

[0078] In an embodiment of the present application, the development end of the electronic device matches the leaf nodes with the same name and the same functional attributes from the leaf nodes of the algorithm process decision tree, and obtains the same variables in N first variable lists. Specifically: when the multiple leaf nodes corresponding to the i-th algorithm sub-node and the multiple leaf nodes corresponding to the j-th algorithm sub-node have the same first leaf, it is determined that the i-th first variable list and the j-th first variable list have the same first variable. Optionally, the development end of the electronic device marks the leaf nodes with the same name and the same functional attributes. Optionally, the development end of the electronic device connects the leaf nodes with the same name and the same functional attributes. In order to better illustrate the source of the leaf nodes, it can be represented by a line segment carrying an arrow, and the arrow is a leaf node with a high importance level executing the same leaf node with a low importance level.

[0079] Example description: See Figure 6 , is a process decision tree based on Algorithm A and Algorithm B provided in the embodiment of the present application. For Algorithm A and Algorithm B shown in Table 1, the algorithm process decision tree is constructed, such as Figure 6 As shown in (a) in . Figure 6The algorithm decision process of (a) matches the leaf nodes with the same name and the same functional attributes as faceNum and faceRect. According to the importance level of the leaf nodes, the dashed lines with arrows are used to indicate that the two algorithms have the same leaf nodes.

[0080] The embodiments of the present application may also match the same leaf nodes from the decision numbers of the algorithm process in other ways, which are not specifically limited in the present application.

[0081] S404: The development end of the electronic device prunes the same leaf nodes in the algorithm process decision tree.

[0082] When the development end of the electronic device determines that multiple leaf nodes corresponding to the i-th algorithm sub-node and multiple leaf nodes corresponding to the j-th algorithm sub-node have the same first leaf node, the first leaf node corresponding to the j-th algorithm sub-node in the algorithm process decision tree is trimmed.

[0083] Optionally, the trimming method can be determined according to the order in which the algorithms appear when the application is running. On the other hand, the trimming can also be determined according to the following importance levels.

[0084] Method 1: The electronic device development end can delete the leaf nodes of the algorithm process decision tree according to the importance level and label of the nodes in the leaf nodes.

[0085] Method 2: The electronic device developer directly deletes the leaf node at the end of the arrow in the algorithm decision process. Figure 6 The algorithm flow decision tree shown in (a) in the figure is obtained by directly deleting the leaf nodes faceNum and faceRect in algorithm B from the algorithm flow decision tree. Figure 6 The pruned algorithm flow decision tree shown in (b).

[0086] The embodiments of the present application may also prune the same leaf nodes in the decision number of the algorithm process by other methods. The present application does not specifically limit the method of pruning the same leaf nodes.

[0087] It can be seen that the pruned algorithm process decision tree does not contain the same leaf nodes.

[0088] S405: The development end of the electronic device outputs the trimmed N second variable lists.

[0089] In actual use, when the development end of the electronic device constructs the algorithm process decision tree, it is necessary to predefine the global mapping of input and output nodes. The global mapping of input and output nodes refers to the mapping relationship between the input variables and the positions of the nodes in the algorithm process decision number, and the mapping relationship between the positions of the nodes in the algorithm process decision number and the output variables. It can be understood that the variables in the N first variable lists are placed at the corresponding nodes in the algorithm process decision tree according to the global mapping of global input and output nodes. The pruned algorithm decision process number is based on the input and output global mapping to obtain the pruned N second variable lists.

[0090] Afterwards, the variable names in the N second variable lists are simplified. For details, refer to the simplification method described in step S303, which will not be discussed here.

[0091] Embodiment 3 In addition, in order to further simplify the variables measured by each algorithm and more accurately locate the algorithm where the problem occurs, the present application performs clustering processing on the simplified N second variable lists.

[0092] See also Figure 7 , is a flow chart of a variable processing method for simplified algorithm dimension measurement provided in an embodiment of the present application. The method specifically includes:

[0093] S701: The development end of the electronic device obtains the algorithm code and the algorithm flow chart.

[0094] After the development end of the electronic device obtains the N second variable lists, the development end of the electronic device obtains the algorithm codes and algorithm flow charts of the N algorithms. The development end of the electronic device processes the algorithm code and algorithm flow chart of each algorithm separately.

[0095] Optionally, in order to better process the algorithm code and the algorithm flowchart, structured data processing is first performed on all variable data involved in the algorithm code and the algorithm flowchart.

[0096] S702: The development end of the electronic device clusters the variables in the second variable list of the p-th algorithm according to the algorithm flow of the p-th algorithm to obtain k clusters.

[0097] Wherein, N≥p≥1, and p is an integer.

[0098] Optionally, the flowchart of each algorithm in the N algorithms is divided into three stages according to the execution order, namely the first execution stage, the second execution stage, and the third execution stage. In an embodiment of the present application, the variables in the second variable list of the pth algorithm cluster the variables located in the first execution stage to obtain the first cluster, cluster the variables located in the second execution stage to obtain the second cluster, and cluster the variables located in the third execution stage to obtain the third cluster. Optionally, if the same variable in the algorithm flowchart is located in different stages, the present application will use the position of priority as the basis for clustering. For example, variable y appears in the first execution stage and also appears in the second execution stage. Variable A is regarded as a variable located in the first execution stage and clustered.

[0099] Example description: See Figure 8 , is a schematic diagram of a graph structure clustering method provided in an embodiment of the present application. For the pth algorithm, clustering is performed according to the execution stage to obtain a first cluster 801, a second cluster 802, and a third cluster 803. In addition, the embodiment of the present application can also perform clustering based on the frequency of each variable appearing in the algorithm code, and the specific clustering method is not specifically limited in this application.

[0100] S703: The development end of the electronic device determines the frequency of occurrence of each variable in the second variable list of the p-th algorithm according to the algorithm code of the p-th algorithm.

[0101] Since the algorithm code involves the number of occurrences of each variable, the development end of the electronic device determines the frequency of occurrence of each variable in the second variable list of the pth algorithm based on the algorithm codes of the pth algorithms.

[0102] Exemplary description: Assume that the variables in the second variable list of the pth algorithm are xp1, xp2, and xp3. Among them, xp1, xp2, and xp3 are only used to represent multiple different variables in the second variable list, and the number 3 is only a schematic representation. The specific number of variables can be adjusted as needed. According to the number of occurrences of the variables in the algorithm code of the pth algorithm, the frequency of occurrence of xp1 is determined to be a1, the frequency of occurrence of xp2 is a2, and the frequency of occurrence of xp3 is a3. Among them, a1, a2, and a3 are all integers greater than or equal to 1, and a1, a2, and a3 may be the same or different.

[0103] S704: Obtain the frequency of each variable in the second variable list of the pth algorithm having problems. The development end of the electronic device can obtain the frequency of each variable in the second variable list of the pth algorithm having problems from a log pre-stored with the number of variable problem occurrences based on a crawler algorithm.

[0104] In addition, the development end of the electronic device can also determine the frequency of each variable in the second variable list having problems based on the developer's records. The embodiment of the present application can also obtain the frequency of each variable having problems by other means, which is not specifically limited in the present application.

[0105] Exemplary description: Take the variables in the second variable list of the pth algorithm as xp1, xp2, and xp3 as an example. Determine the frequency of problems with xp1 as m1, the frequency of problems with xp2 as m2, and the frequency of problems with xp3 as m3. Among them, m1, m2, and m3 are all integers greater than or equal to 1, and m1, m2, and m3 can be the same or different.

[0106] S705: The development end of the electronic device selects k sample variables from each cluster according to the frequency of occurrence of each variable and the frequency of problems with each variable.

[0107] The development end of the electronic device can screen out variables with high frequency of occurrence and high frequency of variable problems as sample variables. It can be understood that the sample variable is a representative variable in the pth algorithm.

[0108] Optionally, the development end of the electronic device pre-inputs a first weight coefficient q1 of the frequency of occurrence of the variable and a second weight coefficient 1-q1 of the frequency of problem occurrence of the variable, wherein 1>q1>0.

[0109] In the embodiment of the present application, the sum of the product of the first weight coefficient and the frequency of occurrence of the variable and the product of the second weight coefficient and the frequency of occurrence of the variable problem can be used as a screening basis to screen the variable with the largest sum from each cluster as a sample variable.

[0110] Exemplary description: For the example of steps S703 and S704, the sum of xp1 is: S1 = q1 × a1 + (1-q1) × m1, the sum of xp2 is: S2 = q1 × a2 + (1-q1) × m2, and the sum of xp3 is: S3 = q1 × a3 + (1-q1) × m3. Filter out the variable with the largest sum from S1, S2 and S3 as the sample variable.

[0111] It can be seen that the embodiments of the present application can obtain more representative sample variables based on the frequency of occurrence and the importance of the frequency of problem occurrence.

[0112] S706: The development end of the electronic device replaces the variables in the second variable list of the pth algorithm with k sample variables. For the second variable list of the pth algorithm, the replaced second variable list only contains k sample variables, and each sample variable is more helpful for problem location. This can solve the problem of inaccurate variables caused by human decision-making problems.

[0113] S707: The development end of the electronic device determines whether p is equal to N. If so, execute S708; otherwise, take p+1 as p and execute S702.

[0114] In the embodiment of the present application, if p is less than N, that is, the pth algorithm does not belong to the last algorithm, step S702 can be re-executed with p+1 as p. Thus, the variables in the second variable list of each algorithm in the N algorithms are all sample variables, thereby greatly reducing the number of variables for algorithm dimension measurement and greatly reducing the memory occupied by storing the variables for algorithm dimension measurement.

[0115] S708: The development end of the electronic device replaces the N first variable lists in the storage space of the electronic device with the streamlined N second variable lists.

[0116] The simplified N second variable lists refer to the variables in the N second variable lists being all sample variables. In addition, the simplified variables in the embodiment of the present application can be carried out in conjunction with a machine learning algorithm. In this way, the speed of simplifying the N second variable lists can be further improved.

[0117] In the embodiment of the present application, a method for viewing abnormal variables is also provided. Fig. 9 , is a flow chart of a method for checking abnormal variables measured by an algorithm. The method specifically includes:

[0118] S901: When a problem occurs during the running of the application, the state information corresponding to each algorithm measurement variable of the N algorithms is obtained.

[0119] For example, when a mobile phone takes a photo and problems such as overexposure occur, the user reports the problem, and the development end of the electronic device obtains the corresponding state information of the dimension measurement variables of each of the N algorithms.

[0120] S902: Based on the pre-built machine learning classification model, classify the states corresponding to the dimension measurement variables of each algorithm in the N algorithms, obtain the abnormal probability of each algorithm dimension measurement abnormal module, and output it.

[0121] By inputting the state information corresponding to each algorithm measurement variable in the N algorithms into the pre-built machine learning classification model, the frequency of occurrence of each algorithm submodule in the N algorithms can be obtained. It is understandable that the development end of the electronic device divides each algorithm into multiple modules, and one function represents a module.

[0122] The development end of the electronic device determines the abnormal probability of each algorithm submodule according to the frequency of occurrence of each algorithm submodule and the total number of variables in the N second variable lists. It can be understood that if the abnormal probability of an algorithm submodule is the highest, the algorithm submodule is the algorithm module where the problem occurs, and the algorithm submodule can be processed.

[0123] Among them, the classification model of machine learning is constructed as follows: based on the correspondence between abnormal variables and related problems accumulated from previous experience, a classification model of machine learning is constructed. In this way, the efficiency of abnormal analysis by developers can be accelerated. It is worth noting that the application provided in the embodiment of the present application can be a camera, or it can be a field maintenance for algorithm measurement of various types of files, such as a document editing algorithm for document editing. Its specific implementation method is the same as the field maintenance of the camera photography algorithm measurement, which will not be discussed here.

[0124] The variable processing method of algorithm dimension measurement provided in the embodiment of the present application can be applied to the types of electronic devices, which can be electronic devices with a development end and an application end, such as laptops, tablet computers, and mobile phones.

[0125] Fig.10 A schematic structural diagram of an electronic device 100 is shown.

[0126] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 140, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 170, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0127] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0128] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0129] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0130] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system. In an embodiment of the present application, the processor obtains N first variable lists corresponding to N algorithms required to run the application. Among them, one algorithm corresponds to one first variable list, and one first variable list includes multiple variables, N≥2, and N is an integer. Determine the same variables in the N first variable lists. When the i-th first variable list and the j-th first variable list have the same first variable, delete the first variable in the j-th first variable list, N≥j≥1, N≥i≥1 and i is an integer, j is an integer, i≠j, and obtain N second variable lists, and the variables in the j-th second variable list are the variable lists after deleting the first variable from the j-th first variable list. When the application is running, the state information corresponding to each variable in the N second variable lists is stored in the storage space of the electronic device.

[0131] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0132] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0133] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0134] The electronic device 100 can realize the shooting function through an image signal processor (ISP), a camera 193, a video codec, a GPU, a display screen 194 and an application processor.

[0135] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0136] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1. The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.

[0137] Fig.11 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0138] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0139] The application layer can include a series of application packages.

[0140] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0141] like Fig.11As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0142] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0143] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text notification icon may include a view for displaying text and a view for displaying pictures.

[0144] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0145] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0146] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc. Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.

[0147] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0148] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0149] The system library can include multiple functional modules. For example: machine learning algorithm, knowledge graph algorithm, etc. The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0150] The technical solution of this embodiment, in essence, 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, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, etc., various media that can store program codes.

[0151] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A variable processing method for algorithm dimension measurement, characterized in that: The method comprises: Obtain N first variable lists required to run the application, each of the first variable lists corresponds to one algorithm, each of the first variable lists includes multiple variables, and N is greater than or equal to 2, and N is an integer; When the i-th first variable list and the j-th first variable list have the same first variable, the first variable is deleted from the j-th first variable list, N≥j≥1, N≥i≥1 and i is an integer, j is an integer, i≠j, and N second variable lists are obtained, and the variables in the j-th second variable list are the variable list after deleting the first variable from the j-th first variable list; When the application is running, the state information corresponding to each variable in the N second variable lists is stored.

2. The method according to claim 1, characterized in that: When the i-th first variable list and the j-th first variable list have the same first variable, deleting the first variable in the j-th first variable list comprises: Using multiple variables in the N first variable lists, construct an algorithm flow decision tree, wherein the root node of the algorithm flow decision tree is a node corresponding to the application program, each child node in the algorithm flow number corresponds to one of the N algorithms, and each leaf node in the algorithm flow number corresponds to one variable in the N first variable lists; Matching a first leaf node with the same name and function from a leaf node corresponding to the i-th algorithm subnode and a leaf node corresponding to the j-th algorithm subnode of the algorithm flow decision tree, and determining the first leaf node as the same first variable in the i-th first variable list and the j-th first variable list; Delete the first variable from the j-th first variable list.

3. The method according to claim 2, characterized in that: The method of constructing an algorithm process decision tree by using multiple variables in the N first variable lists includes: Determine, according to the algorithm codes corresponding to the N algorithms, the frequency of each variable in the zth first variable list of the N first variable lists appearing in the zth algorithm; wherein N≥z≥1, and z is an integer; Determine the importance level of each variable in the zth first variable list according to the frequency of occurrence of the variable, wherein the importance level is positively correlated with the frequency of occurrence of the variable; Determine the importance level of each variable in the N first variable lists in turn; Performing structured processing on each variable in the N first variable lists to obtain variable structured data; The algorithm process decision tree is constructed according to the variable structured data and the importance level of each variable in the N first variable lists; the node attributes of the leaf nodes in the algorithm process decision tree include at least the variable name corresponding to the leaf node, the variable function attribute, and the importance level of the variable.

4. The method according to claim 2, characterized in that: Deleting the first variable from the j-th first variable list includes: The first leaf node corresponding to the j-th algorithm sub-node in the algorithm process decision tree is pruned to delete the first variable in the j-th first variable list and obtain the j-th second variable list; the importance level of the first leaf node corresponding to the i-th algorithm sub-node is higher than the importance level of the first leaf node corresponding to the j-th algorithm sub-node.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine, from among the plurality of variables in the N second variable lists, variable names whose field lengths of the variable names exceed a preset length threshold; When the field length of the variable name of the mth variable exceeds a preset length threshold, the variable name of the mth variable is compressed, where m≥1 and m is an integer.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Obtaining an algorithm code of a p-th algorithm, where N≥p≥1, and p is an integer; Clustering the variables in the second variable list of the pth algorithm according to the algorithm code to obtain k clusters, where k ≥ 2 and k is an integer; and determining the frequency of occurrence of the variables in the second variable list of the pth algorithm; Obtaining the frequency of problems with variables in the second variable list of the pth algorithm; According to the frequency of occurrence of each variable in each cluster and the frequency of problems with each variable, one sample variable is selected from each cluster to obtain k sample variables; The k sample variables are used as variables in a second variable list corresponding to the p-th algorithm.

7. The method according to claim 6, characterized in that: When the algorithm code is equally divided into a first execution stage, a second execution stage and a third execution stage according to the execution order, the execution order of the algorithm code is the first execution stage, the second execution stage, and the third execution stage, clustering the variables corresponding to the pth algorithm to obtain k clusters includes: Clustering the variables in the first execution stage of the p-th algorithm to obtain a first cluster; clustering the variables in the second execution stage of the p-th algorithm to obtain a second cluster; and clustering the variables in the second execution stage of the p-th algorithm to obtain a third cluster.

8. The method according to claim 6, characterized in that: According to the frequency of occurrence of each variable in each cluster and the frequency of problems with each variable, one sample variable is screened out from each cluster to obtain k sample variables, including: Obtaining a first weight coefficient of the frequency of occurrence of the variable and a second weight coefficient of the frequency of problem occurrence of the variable; Determine the sum of each variable in each of the clusters according to the product of the first weight coefficient and the frequency of occurrence of the variable and the sum of the product of the second weight coefficient and the frequency of occurrence of the variable problem; The variable with the largest sum value is selected from each of the clusters as the sample variable to obtain the k sample variables.

9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When a problem occurs in the running of the application, status information corresponding to each variable in the N second variable lists sent by the electronic device is received; Inputting the state information corresponding to each variable in the N second variable lists into the pre-built classification model respectively to obtain the occurrence frequency of each algorithm submodule in the N algorithms; Determine the abnormal probability of each algorithm submodule in the N algorithms according to the occurrence frequency of each algorithm submodule in the N algorithms and the total number of variables in the N second variable lists; According to the abnormal probability of each algorithm submodule in the N algorithms, the algorithm module that generates the problem is located.

10. The method according to claim 9, characterized in that: The method for constructing the classification model includes: The classification model is constructed by pre-acquiring a plurality of abnormal variables and abnormal problems corresponding to each abnormal variable, and the classification model outputs an algorithm submodule for generating abnormal problems.

11. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is coupled to the processor; The memory stores a program, and when the program is executed by the processor, the electronic device executes the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method, apparatus and storage medium for performing retention analysis

    CN109408559A

  • Image storage method and device, computer equipment and storage medium

    CN116309004A