File identification method and device, readable medium, electronic equipment and product

By identifying and filtering interfering variables, we can identify abnormalities in amount variables in financial transactions, solve the problem of capital losses caused by the loss of accuracy in floating-point calculations in JavaScript, and improve the accuracy and efficiency of amount risk identification.

CN118709679AActive Publication Date: 2024-09-27BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410814625.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-27
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

In payment and transaction links in financial scenarios, due to the storage size limit of Number type values ​​in JavaScript, precision loss is prone to occur in floating point calculations, leading to fund losses and reconciliation problems. The existing technology requires scanning of all code nodes. Analysis results in high cost of amount risk investigation and low identification accuracy.

Method used

By obtaining multiple variables in the program file, we determine the target variables that are not related to the amount data, filter out the interference variables, and only identify the amount anomalies for other variables. We use abstract syntax trees and preset semantic recognition models to conduct static code analysis. Identify amount variables that may suffer from loss of accuracy and improve the accuracy and efficiency of identification.

Benefits of technology

It improves the accuracy of identifying target amount variables, reduces the cost of amount risk investigation, avoids scanning and analysis of full amounts of codes, and enhances the accuracy and efficiency of identifying amount anomalies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709679A
    Figure CN118709679A
Patent Text Reader

Abstract

The invention relates to a file identification method and device, a readable medium, electronic equipment and a product. A to-be-identified program file can be obtained, and the program file comprises a plurality of variables; determining a target variable used for representing target data from the multiple variables, wherein the target data is data which needs mathematical operation and is not related to the amount data; and performing amount abnormality identification on other variables except the target variable in the plurality of variables, the amount abnormality identification being used for identifying whether the corresponding variable belongs to a target amount variable, and the amount data represented by the target amount variable having a risk of precision loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a file identification method, device, readable medium, electronic device and product. Background Art

[0002] In the payment and transaction-related links in financial scenarios, the front-end and back-end usually interact with each other. For example, the front-end uses JavaScript to write the interaction logic and receives the amount entered by the user. Based on the JavaScript interaction logic, the amount entered by the user is converted into different coins and then submitted to the back-end for processing.

[0003] Floating-point operations may be involved in the process of denomination conversion. However, due to the limitation of the storage size corresponding to the Number type value in JavaScript, some floating-point operations may result in loss of precision, thus causing asset losses and fund reconciliation problems. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a file identification method, the method comprising:

[0006] Obtaining a program file to be identified, wherein the program file includes a plurality of variables;

[0007] Determining a target variable for representing target data from the plurality of variables, wherein the target data is data that requires mathematical operation and is not related to amount data;

[0008] Amount anomaly identification is performed on other variables among the multiple variables except the target variable, and the amount anomaly identification is used to identify whether the corresponding variable belongs to the target amount variable, and the amount data corresponding to the target amount variable has the risk of precision loss.

[0009] In a second aspect, a file identification device is provided, the device comprising:

[0010] An acquisition module, used for acquiring a program file to be identified, wherein the program file includes a plurality of variables;

[0011] A determination module, used to determine a target variable for representing target data from the plurality of variables, wherein the target data is data that requires mathematical operation and is not related to amount data;

[0012] An identification module is used to identify amount anomalies of other variables among the multiple variables except the target variable. The amount anomaly identification is used to identify whether the corresponding variable belongs to the target amount variable. The amount data corresponding to the target amount variable has the risk of losing precision.

[0013] According to a third aspect, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processing device, the steps of the method described in the first aspect of the present disclosure are implemented.

[0014] In a fourth aspect, an electronic device is provided, including:

[0015] a storage device having a computer program stored thereon;

[0016] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.

[0017] In a fifth aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect of the present disclosure.

[0018] Through the above technical solution, a program file to be identified is obtained, wherein the program file includes multiple variables; a target variable for characterizing target data is determined from the multiple variables, wherein the target data is data that needs to be mathematically operated and is not related to the amount data; and the amount abnormality identification is performed on the other variables except the target variable among the multiple variables, wherein the amount abnormality identification is used to identify whether the corresponding variable belongs to the target amount variable, and the amount data corresponding to the target amount variable has the risk of precision loss. In this way, when the amount abnormality identification is performed on the variables in the program file, the target variable can be filtered. Since the target data represented by the target variable is data that needs to be mathematically operated and is not related to the amount data, the target variable will interfere with the identification of the target amount variable. After filtering out the target variable, the amount abnormality identification is performed on the other variables except the target variable among the multiple variables, which can improve the accuracy of the identification of the target amount variable in the program file. At the same time, it also avoids scanning and analyzing the code nodes of the full amount of program files, thereby reducing the cost of troubleshooting the amount risk.

[0019] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

[0021] Figure 1 The present invention is a flowchart of a file identification method according to an exemplary embodiment.

[0022] Figure 2 is based on Figure 1 The illustrated embodiment shows a flow chart of a file identification method.

[0023] Figure 3 is based on Figure 1 The illustrated embodiment shows a flow chart of a file identification method.

[0024] Figure 4 is based on Figure 1 The illustrated embodiment shows a flow chart of a file identification method.

[0025] Figure 5 The invention is a block diagram of a file identification device according to an exemplary embodiment.

[0026] Figure 6 is based on Figure 5 The illustrated embodiment shows a block diagram of a file identification device.

[0027] Figure 7 is based on Figure 6 The illustrated embodiment shows a block diagram of a file identification device.

[0028] Figure 8 is based on Figure 5 The illustrated embodiment shows a block diagram of a file identification device.

[0029] Fig. 9 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0030] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0031] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0032] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0033] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0034] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0035] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0036] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0037] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0038] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0039] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0040] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0041] The present disclosure is mainly used for the identification of abnormal amount risk in financial scenarios. For example, in the payment and transaction-related links in financial scenarios, the amount entered by the user needs to be converted into yuan, and then submitted to the back-end for processing after being converted into points. In order to complete this conversion, BalanceYuan*100 can be used to convert the input amount BalanceYuan in yuan into an amount in cents. Floating-point operations may be performed in the process of converting yuan, but due to the limitation of the storage size of the value of the numeric type in JavaScript, some floating-point operations may cause precision loss, resulting in capital loss and fund reconciliation problems. For example, the front-end calculates 10000.71*100, but due to the loss of precision, the amount submitted to the back-end becomes 1000070.99999999999. Therefore, it is necessary to identify the risk of the amount variable (i.e., the variable representing the amount data) involved in the JavaScript program file.

[0042] In the related art, AST (Abstract Syntax Tree) is used to perform static code analysis on JavaScript, and the amount risk operation node (i.e., the node corresponding to the variable with the risk of precision loss) is found and then identified and reported. For example, if the corresponding node hits any detection rule such as floating point operation, large number operation or division, the node is determined to be the amount risk operation node, and the node needs to be reported. However, this method requires scanning and analyzing all code nodes, which makes the cost of troubleshooting the amount risk high, and also causes all variables (amount variables / non-amount variables) that hit the detection rules in the code to be identified and reported. In addition to the amount variable, the variables that hit the detection rule may also include other target variables that also need to perform mathematical operations but are not related to the amount data (such as time variables, mathematical variables, etc.). Obviously, this type of target variable will interfere with the identification of the amount variable in the code. Therefore, the existing identification method of the target amount variable (i.e., the variable that represents the amount data with the risk of precision loss) has low accuracy.

[0043] In order to solve the above problems, the present invention provides a file identification method, device, readable medium, electronic device and product. The specific implementation of the present invention is described in detail below with reference to the accompanying drawings.

[0044] Figure 1 is a flowchart of a file identification method according to an exemplary embodiment. Figure 1 As shown, the method comprises the following steps:

[0045] In step S101, a program file to be identified is obtained, wherein the program file includes a plurality of variables.

[0046] The program file here may include the file where the code for the front-end to implement the interaction logic with the back-end in the financial scenario is located. For example, the front-end can write the interaction logic based on JavaScript, then the program file is the program file where the JavaScript code is located. It is understandable that the JavaScript code may include multiple variables, and different variables are used to represent different data or information. The multiple variables may also have multiple variable types, and the variable type may include, for example, an amount variable, a time variable, etc., wherein the amount variable is a variable representing amount data, and the time variable is a variable representing time data.

[0047] In step S102, a target variable for representing target data is determined from the multiple variables, where the target data is data that requires mathematical operation and is not related to amount data.

[0048] The target variable refers to a variable among multiple variables that needs to be mathematically operated but is used to represent non-monetary data. Mathematical operations here include, for example, floating-point operations, large number operations, four arithmetic operations, and unit conversion. Obviously, this type of target variable will interfere with the risk identification of the monetary variable. For example, the target variable may include time variables, mathematical variables, and variables related to CSS (Cascading Style Sheets) attributes.

[0049] In one implementation of this step, multiple first preset variables with the same semantics as the target variable can be pre-set, and then the multiple first preset variables can be used as a whitelist. If it is determined that the current variable (any variable among the multiple variables) in the program file to be identified belongs to the variables in the whitelist, or has the same or similar semantics as the variables in the whitelist, the current variable can be determined as the target variable.

[0050] In step S103, amount anomaly identification is performed on variables other than the target variable among the multiple variables, and the amount anomaly identification is used to identify whether the corresponding variable belongs to the target amount variable, and the amount data corresponding to the target amount variable has the risk of precision loss.

[0051] By adopting the above method, when identifying the amount anomaly of the variables in the program file, the target variable can be filtered. Since the target data represented by the target variable is data that needs to be mathematically calculated and is not related to the amount data, the target variable will interfere with the identification of the target amount variable. After filtering out the target variable, the amount anomaly of other variables except the target variable can be identified in multiple variables, which can improve the accuracy of identifying the target amount variable in the program file. At the same time, it also avoids scanning and analyzing the code nodes of the entire program file, reducing the cost of troubleshooting the amount risk.

[0052] Figure 2 is based on Figure 1 The embodiment shown is a flowchart of a file identification method, such as Figure 2 As shown, the method further comprises the following steps:

[0053] In step S104, the program file is parsed through an abstract syntax tree AST to obtain a target AST corresponding to the program file, wherein the target AST includes variable nodes, and the variable nodes are used to represent variables in the program file.

[0054] Among them, AST is a data structure used to represent the structure of program source code. In JavaScript, AST can be generated by static code parsing of the source code. For example, the generation process of AST can be divided into the following steps: Lexical analysis: decompose the source code into lexical units (tokens), such as identifiers, keywords, operators, etc. Syntactic analysis: organize lexical units into a hierarchical representation, namely AST. The grammatical analyzer can convert lexical units into nodes of the syntax tree according to the grammatical rules of the language, and determine the relationship between the nodes. Semantic analysis: perform semantic checks on the generated AST to verify the legitimacy of the code. In this step, the target AST corresponding to the program file can be generated based on the above steps.

[0055] The target AST may be composed of a series of nodes, each node representing a grammatical structure in the code, and some of the nodes are variable nodes used to represent variables in the code in the program file.

[0056] The present disclosure uses AST technology to statically scan the code of program files in the warehouse, and can analyze the name, type, sub-elements, code functions and other information of each code node.

[0057] In step S105, for each of the variable nodes in the target AST, semantic recognition is performed on the variable name of the variable corresponding to the variable node through a preset semantic recognition model to obtain a semantic recognition result of the variable name.

[0058] The preset semantic recognition model may include, for example, a pre-trained large model (such as BERT, GPT, etc.). That is, in this step, the large model may be used to perform semantic recognition on the variable name corresponding to each variable node.

[0059] The first preset variable name is one or more variable names that are pre-set and have the same semantics as the variable name of the target variable. The semantic recognition result may include a first semantic similarity between each first preset variable name and the variable name of the input model. In addition, the set of first preset variable names can be used as a whitelist. When it is determined that the variable name belongs to a variable name in the whitelist, or is a variable name with a high semantic similarity to a variable name in the whitelist, the variable name is regarded as the variable name of the target variable.

[0060] In a possible implementation of this step, after the variable name corresponding to the variable node to be currently identified is input into a preset semantic recognition model, the first semantic similarity corresponding to the variable name is output through the preset semantic recognition model.

[0061] It can be understood that the first preset variable name needs to be used as a corpus to pre-train the preset semantic recognition model. In this way, after the variable name to be identified is input into the preset semantic recognition model, the model can calculate the first semantic similarity between each first preset variable name and the input variable name.

[0062] Thus, in the process of executing step S102, the target variable can be determined from the multiple variables according to the semantic recognition results corresponding to each variable. In one implementation, for each variable, if the first semantic similarity corresponding to the variable name of the variable is greater than or equal to a first preset similarity threshold (the threshold can be, for example, 80%), the variable can be used as the target variable.

[0063] Through the above method, the target variables contained in multiple variables in the program file can be identified through a large model. Since the target variable will interfere with the risk identification of the amount variable, after identifying the target variable contained in multiple variables, the target variable can be filtered out (which can be called "white list filtering"), thereby filtering out the variables that will interfere with the risk identification of the amount variable, thereby improving the accuracy of identifying the target amount variable in the program file.

[0064] In addition, using a large model for whitelist filtering can increase the amount of non-monetary whitelist data, thereby further improving the accuracy and efficiency of target variable identification.

[0065] In another possible implementation of the present disclosure, the large model can also be used to accurately identify the amount variable included in the program file, where the amount variable refers to a variable representing amount data determined based on semantic recognition (e.g., a variable named money, cent, amount, etc. is the amount variable). For example, an amount variable array can be predefined by initialization, and a plurality of second preset variable names can be stored in the amount variable array, and the second preset variable name is a pre-set variable name for representing amount data; in this way, the semantic similarity (i.e., the second semantic similarity) between the variable name of the input model and each second preset variable name can be calculated by the large model, so as to identify whether the variable name of the input model is the variable name of the amount variable based on the second semantic similarity.

[0066] Therefore, the semantic recognition result also includes the second semantic similarity between the variable name and each second preset variable name. In the process of semantically recognizing the variable name of the variable corresponding to the variable node by the preset semantic recognition model, after the variable name is input into the preset semantic recognition model, the second semantic similarity corresponding to the variable name is output by the preset semantic recognition model. For example, the variable name of the input model is monneey or moneeyy, and the preset semantic recognition model can calculate the second semantic similarity between monneey and the second preset variable name money, and can also calculate the second semantic similarity between moneeyy and the second preset variable name money.

[0067] It can be understood that the second preset variable name also needs to be used as a corpus to pre-train the preset semantic recognition model. In this way, after the variable name to be identified is input into the preset semantic recognition model, the model can calculate the second semantic similarity between each second preset variable name and the input variable name.

[0068] It should be noted that the above-mentioned preset semantic recognition model can calculate the first semantic similarity between the variable name of the input model and each first preset variable name, and can also calculate the second semantic similarity between the variable name of the input model and each second preset variable name. In this way, in the process of pre-training the preset semantic recognition model, the first preset variable name and the second preset variable name can be used together as a corpus for model training. In addition, the preset semantic recognition model can also include two models, for example, it can include model one and model two, wherein model one is a large model obtained by training using multiple first preset variable names as a corpus, and model two is a large model obtained by training using multiple second preset variable names as a corpus. In this way, model one can be used to identify the target variable from multiple variables, and model two can be used to identify the amount variable from multiple variables.

[0069] Considering the lack of unified naming standards for variable names in the code in real application scenarios, it is difficult to grasp all the amount variables in the overall code repository. In order to identify as many amount variables as possible, the present disclosure can use a large model to expand the corpus for model training, and improve the recognition accuracy of the preset semantic recognition model for the amount variables among multiple variables.

[0070] In one implementation, for each preset variable name, the preset variable name can be input into a preset variable name expansion model, and then at least one expanded variable name with the same semantics as the preset variable name can be output through the preset variable name expansion model, and the preset variable name includes a first preset variable name or a second preset variable name; at least one expanded variable name is added to a preset corpus of a preset semantic recognition model, and the preset corpus includes the first preset variable name and / or the second preset variable name.

[0071] Among them, the preset variable name expansion model can also be a pre-set large model.

[0072] For example, assuming that the preset variable name of the input preset variable name expansion model is the second preset variable name (that is, the name of the variable that is preset to represent amount data), and the second preset variable name is amount, then the model can output the same expanded variable name as the second preset variable name amount, including at least one of the following: total_amount total amount, balance_due balance payable, payment_amount payment amount, invoice_total invoice total amount, transaction_amount transaction amount, withdrawal_amount withdrawal amount, deposit_amount deposit amount, loan_principal loan principal. This is just an example and the present disclosure is not limited to this.

[0073] By adopting the above method and using a large model to expand the corpus for training the semantic recognition model, the accuracy of identifying the nature of the variable (i.e., whether it is an amount variable or a variable in the whitelist) and the comprehensiveness of variable identification can be improved, thereby improving the reliability of the amount anomaly identification rules.

[0074] Figure 3 is based on Figure 1 The embodiment shown is a flowchart of a file identification method, such as Figure 3 As shown, step S103 includes the following sub-steps:

[0075] In step S1031, for each of the other variables, the variable type of the other variable is determined according to the second semantic similarity between the variable name of the other variable and the second preset variable name.

[0076] In this step, when the second semantic similarity is greater than or equal to the second preset similarity threshold, the variable type of the other variable can be determined to be the first amount variable; since the preset corpus can include multiple second preset variable names, therefore, in one implementation, if it is determined that the second semantic similarity between the variable name of the other variable and any second preset variable name is greater than or equal to the second preset similarity threshold, the variable type of the other variable can be determined to be the first amount variable. In addition, the second preset similarity threshold can be, for example, 85%, 90%, etc., and the size of the threshold can be arbitrarily set according to actual needs, and the present disclosure does not limit this.

[0077] When the second semantic similarity is less than the second preset similarity threshold, the variable type of the other variable is determined to be a second amount variable; it should be noted that the situation where the second semantic similarity is less than the second preset similarity threshold here refers to the situation where the second semantic similarity between the variable name of the other variable and each second preset variable name is less than the second preset similarity threshold.

[0078] It can be understood that when the second semantic similarity between the variable name of the other variable and the second preset variable name is greater than or equal to the second preset similarity threshold, it can be determined that the variable name of the other variable and the second preset variable name have a high semantic similarity. Since the second preset variable name is a pre-set variable name representing amount data, the variable name of the other variable can also be regarded as a variable name representing amount data. Therefore, the first amount variable represents that the other variable is a variable that is determined to represent amount data. On the contrary, when the second semantic similarity between the variable name of the other variable and the second preset variable name is less than the second preset similarity threshold, it can be determined that the variable name of the other variable and the second preset variable name have a low semantic similarity. At this time, it is impossible to determine whether the other variable is a variable representing amount data, but it can be determined that the variable type of the other variable does not belong to the first amount variable mentioned above, nor to the target variable mentioned above. Therefore, the second amount variable represents that the other variable is any other variable among multiple variables except the target variable and the first amount variable.

[0079] In step S1032, the amounts of the other variables are identified to be abnormal according to the variable type.

[0080] In this step, the target identification rule corresponding to the variable type may be determined; when it is determined that the other variable hits the target identification rule, it is determined that the other variable belongs to the target amount variable.

[0081] That is to say, this step can determine the target identification rule for identifying the amount abnormality of each other variable according to the variable type corresponding to the other variable, and different variable types correspond to different target identification rules, so that the amount abnormality of the other variable can be identified through the target identification rule. For example, when the variable type is the first amount variable, the target identification rule includes at least one of floating point operation, conversion of fractions, and the amount default value; when the variable type is the second amount variable, the target identification rule includes at least one of floating point operation and conversion of fractions.

[0082] Among them, floating-point operation refers to the case where the data represented by the corresponding variable belongs to floating-point operation (such as the data includes decimals), and fraction conversion refers to the data being converted from yuan to cents (such as BalanceYuan*100) or cents to yuan (BalanceYuan / 100). The default amount value is the default amount (such as 0). As mentioned above, if the data represented by a variable needs to be floated and converted, due to the limitation of the storage size of the value of the numeric type in JavaScript, the problem of precision loss will occur during the floating-point operation and fraction conversion process. Therefore, if the data corresponding to an amount variable belongs to the case of floating-point operation and / or fraction conversion, the amount variable belongs to the target amount variable. The default amount value is taken into account in the case that some amount data is reported incorrectly or not collected. If the amount data is directly output to the user as 0, then the amount data will be inconsistent with the actual amount data, which will affect the user experience and cause fund reconciliation problems. Therefore, if the amount data represented by an amount variable is 0, then the amount variable may also belong to the target amount variable.

[0083] In addition, the present disclosure can use different target identification rules for variables of different variable types to identify abnormal amounts of other variables. Taking the abnormal amount identification of one of the other variables as an example, if the variable type of the other variable is the first amount variable, that is, the other variable is determined to be a variable determined to represent the amount data, at this time, it is necessary to focus on checking whether the other variable is a target amount variable (that is, a variable with a risk of precision loss in the amount data). Therefore, in order to improve the accuracy of abnormal amount identification of such variables, the target identification rule can be set to include at least one of floating-point operations, conversion to fractions, and a default amount value. In this way, when it is determined that the first amount variable hits at least one of floating-point operations, conversion to fractions, and a default amount value, it is deemed that the first amount variable hits the target identification rule, and the first amount variable is the target amount variable. If the variable type of the other variable is the second amount variable, it is uncertain whether the other variable represents amount data. Considering that the probability of precision loss in floating-point operations and fractional conversion is high (i.e., the risk level is high), and the risk level corresponding to the default amount value is relatively low, and the false alarm rate is high, therefore, when determining that the variable type of the other variable is the second amount variable, the target identification rule can be set to include floating-point operations and / or fractional conversion, that is, when it is determined that the second amount variable satisfies at least one of floating-point operations and fractional conversion, it is deemed that the second amount variable hits the target identification rule, and the second amount variable is the target amount variable.

[0084] By adopting the above method, amount anomaly identification is performed on amount variables of different variable types based on different target identification rules, which can give play to the advantages of different identification rules and also take into account the accuracy and efficiency of amount anomaly identification.

[0085] Figure 4 is based on Figure 1 The embodiment shown is a flowchart of a file identification method, such as Figure 4 As shown, the method further comprises the following steps:

[0086] In step S106, for at least one of the program files included in each preset file storage unit, abnormal value statistics are performed on the abnormal amount recognition results of the other variables corresponding to the at least one program file to obtain the abnormal amount value corresponding to the preset file storage unit.

[0087] During the actual code development process, program files can be stored in preset file storage units. A preset file storage unit can include one or more program files. For example, the preset file storage unit can be a code repository or a preset code folder, which is not limited in the present disclosure.

[0088] The abnormal value statistics here may include counting which types of target amount variables and the number of occurrences are respectively included in the at least one program file stored in the preset file storage unit. Among them, the types of the target amount variables may include, for example, amount variables belonging to floating-point operations, amount variables belonging to fractional conversion, and amount variables belonging to the amount default value. In one implementation, different weights may also be set for different types of target amount variables (for example, the higher the corresponding risk level, the higher the weight), and then the amount abnormal value corresponding to the preset file storage unit is calculated based on the respective corresponding weights and the number of occurrences of each target amount variable in the current preset file storage unit.

[0089] In step S107, the plurality of preset file storage units are sorted according to the abnormal amount value corresponding to each preset file storage unit.

[0090] For example, multiple preset file storage units can be sorted in descending order according to the abnormal amount value. The higher the abnormal amount value, the higher the risk level of the program file stored in the corresponding preset file storage unit. The developer needs to focus on following up on these program files and repair them if necessary.

[0091] In step S108, the sorting result and the amount abnormality identification result corresponding to each of the preset file storage units are sent to the target terminal.

[0092] The target terminal may be a terminal of a developer who maintains the program file in advance. The amount abnormality identification result may also include the identifier of the preset file storage unit where the target amount variable exists, the specific storage location of the target amount variable in the preset file storage unit, the code line where it is located, the problem point corresponding to the target amount variable, the improvement plan, the identification time, and the person in charge, etc.

[0093] By adopting the above method, the amount risk data can be aggregated based on the identification results of the target amount variables of the program files stored in different preset file storage units, and the risk points under the same file (i.e., a preset file storage unit) can be integrated according to the file information. The aggregation results and the amount abnormality identification results can be reported to the target terminal so that the developers can follow up and repair them in time.

[0094] Figure 5 is a block diagram of a file identification device according to an exemplary embodiment. Figure 5 As shown, the device comprises:

[0095] An acquisition module 501 is used to acquire a program file to be identified, wherein the program file includes a plurality of variables;

[0096] A determination module 502 is used to determine a target variable for representing target data from the plurality of variables, wherein the target data is data that needs to be mathematically operated and is not related to amount data;

[0097] The risk identification module 503 is used to identify amount anomalies of other variables among the multiple variables except the target variable. The amount anomaly identification is used to identify whether the corresponding variable belongs to the target amount variable. The amount data corresponding to the target amount variable has the risk of precision loss.

[0098] Optionally, Figure 6 is based on Figure 5 The block diagram of a file recognition device shown in the embodiment shown in FIG. Figure 6 As shown, the device also includes:

[0099] A program parsing module 504 is used to parse the program file through an abstract syntax tree AST to obtain a target AST corresponding to the program file, wherein the target AST includes variable nodes, and the variable nodes are used to represent variables in the program file;

[0100] The semantic recognition module 505 is used to perform semantic recognition on the variable name of the variable corresponding to each variable node in the target AST through a preset semantic recognition model to obtain a semantic recognition result of the variable name;

[0101] The determination module 502 is used to determine the target variable from the multiple variables according to the semantic recognition results corresponding to each variable.

[0102] Optionally, the semantic recognition result includes a first semantic similarity between the variable name and a first preset variable name, where the first preset variable name is a variable name that is preset and has the same semantics as the variable name of the target variable;

[0103] The semantic recognition module 505 is used to input the variable name into the preset semantic recognition model, and then output the first semantic similarity corresponding to the variable name through the preset semantic recognition model;

[0104] The determination module 502 is configured to, for each of the variables, use the variable as the target variable if the first semantic similarity corresponding to the variable name of the variable is greater than or equal to a first preset similarity threshold.

[0105] Optionally, the semantic recognition result includes a second semantic similarity between the variable name and a second preset variable name, where the second preset variable name is a variable name preset to represent amount data;

[0106] The semantic recognition module 505 is used to input the variable name into the preset semantic recognition model, and then output the second semantic similarity corresponding to the variable name through the preset semantic recognition model;

[0107] The risk identification module 503 is used to determine the variable type of each of the other variables according to the second semantic similarity between the variable name of the other variable and the second preset variable name; and identify the amount anomaly of the other variables according to the variable type.

[0108] Optionally, the risk identification module 503 is used to determine that the variable type of the other variables is a first amount variable when the second semantic similarity is greater than or equal to a second preset similarity threshold; and to determine that the variable type of the other variables is a second amount variable when the second semantic similarity is less than the second preset similarity threshold; wherein the first amount variable represents that the other variable is a determined variable representing amount-type data, and the second amount variable represents that the other variable is any other variable among the multiple variables except the target variable and the first amount variable.

[0109] Optionally, the risk identification module 503 is used to determine a target identification rule corresponding to the variable type; when it is determined that the other variable hits the target identification rule, determine that the other variable belongs to the target amount variable.

[0110] Optionally, when the variable type is the first amount variable, the target identification rule includes at least one of floating-point operations, fractional conversion, and a default amount value; when the variable type is the second amount variable, the target identification rule includes at least one of the floating-point operations and the fractional conversion.

[0111] Optionally, Figure 7 is based on Figure 6 The block diagram of a file recognition device shown in the embodiment shown in FIG. Figure 7 As shown, the device also includes:

[0112] The corpus expansion module 506 is used to, for each preset variable name, input the preset variable name into a preset variable name expansion model, and then output at least one expanded variable name with the same semantics as the preset variable name through the preset variable name expansion model, where the preset variable name includes a first preset variable name or a second preset variable name; and add the at least one expanded variable name to a preset corpus of the preset semantic recognition model, where the preset corpus includes the first preset variable name and / or the second preset variable name.

[0113] Optionally, Figure 8 is based on Figure 5 The block diagram of a file recognition device shown in the embodiment shown in FIG. Figure 8 As shown, the device also includes:

[0114] The recognition result statistics module 507 is used to perform abnormal value statistics on the abnormal amount recognition results of the other variables corresponding to the at least one program file included in each preset file storage unit, and obtain the abnormal amount value corresponding to the preset file storage unit; and sort the plurality of preset file storage units according to the abnormal amount value corresponding to each preset file storage unit;

[0115] The risk reporting module 508 is used to send the sorting result and the amount abnormality identification result corresponding to each of the preset file storage units to the target terminal.

[0116] Reference below Fig. 9 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0117] like Fig. 9 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0118] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Fig. 9 The electronic device 900 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.

[0119] 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 software program. 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 program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0120] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0121] In some embodiments, the client can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0122] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0123] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a program file to be identified, wherein the program file includes multiple variables; determines a target variable used to characterize target data from the multiple variables, wherein the target data is data that requires mathematical operations and is not related to amount data; and performs amount anomaly identification on other variables among the multiple variables except the target variable, wherein the amount anomaly identification is used to identify whether the corresponding variable belongs to a target amount variable, and there is a risk of precision loss in the amount data corresponding to the target amount variable.

[0124] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0126] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, an acquisition module may also be described as a "module for acquiring program files".

[0127] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0128] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0129] According to one or more embodiments of the present disclosure, Example 1 provides a file identification method, including:

[0130] Obtaining a program file to be identified, wherein the program file includes a plurality of variables;

[0131] Determining a target variable for representing target data from the plurality of variables, wherein the target data is data that requires mathematical operation and is not related to amount data;

[0132] Amount anomaly identification is performed on other variables among the multiple variables except the target variable, and the amount anomaly identification is used to identify whether the corresponding variable belongs to the target amount variable, and the amount data corresponding to the target amount variable has the risk of precision loss.

[0133] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, further comprising:

[0134] Parsing the program file through an abstract syntax tree AST to obtain a target AST corresponding to the program file, wherein the target AST includes variable nodes, and the variable nodes are used to represent variables in the program file;

[0135] For each of the variable nodes in the target AST, semantic recognition is performed on the variable name of the variable corresponding to the variable node through a preset semantic recognition model to obtain a semantic recognition result of the variable name;

[0136] Determining a target variable for characterizing target data from the plurality of variables comprises:

[0137] The target variable is determined from the multiple variables according to the semantic recognition results corresponding to each variable.

[0138] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein the semantic recognition result includes a first semantic similarity between the variable name and a first preset variable name, wherein the first preset variable name is a variable name that is preset and has the same semantics as the variable name of the target variable;

[0139] The performing semantic recognition on the variable name of the variable corresponding to the variable node by using a preset semantic recognition model includes:

[0140] After inputting the variable name into the preset semantic recognition model, outputting the first semantic similarity corresponding to the variable name through the preset semantic recognition model;

[0141] Determining the target variable from the multiple variables according to the semantic recognition results corresponding to each variable includes:

[0142] For each of the variables, when the first semantic similarity corresponding to the variable name of the variable is greater than or equal to a first preset similarity threshold, the variable is used as the target variable.

[0143] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 2, wherein the semantic recognition result includes a second semantic similarity between the variable name and a second preset variable name, and the second preset variable name is a variable name preset to represent amount data;

[0144] The performing semantic recognition on the variable name of the variable corresponding to the variable node by using a preset semantic recognition model includes:

[0145] After inputting the variable name into the preset semantic recognition model, outputting the second semantic similarity corresponding to the variable name through the preset semantic recognition model;

[0146] The step of identifying abnormal amounts of other variables among the multiple variables except the target variable includes:

[0147] For each of the other variables, determining the variable type of the other variable according to a second semantic similarity between the variable name of the other variable and the second preset variable name;

[0148] The amount abnormality of the other variables is identified according to the variable type.

[0149] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4, wherein determining the variable type of the other variable according to the second semantic similarity between the variable name of the other variable and the second preset variable name includes:

[0150] When the second semantic similarity is greater than or equal to a second preset similarity threshold, determining that the variable type of the other variable is a first amount variable;

[0151] When the second semantic similarity is less than the second preset similarity threshold, determining the variable type of the other variable to be a second amount variable;

[0152] The first amount variable represents that the other variables are determined variables representing amount data, and the second amount variable represents that the other variables are any other variables among the multiple variables except the target variable and the first amount variable.

[0153] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein the identifying abnormal amount of the other variables according to the variable type includes:

[0154] Determine a target recognition rule corresponding to the variable type;

[0155] When it is determined that the other variable hits the target identification rule, it is determined that the other variable belongs to the target amount variable.

[0156] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, where, when the variable type is the first amount variable, the target identification rule includes at least one of floating point operation, conversion of fractions, and amount default value.

[0157] When the variable type is the second amount variable, the target identification rule includes at least one of the floating point operation and the fraction conversion.

[0158] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 2, wherein the method further includes:

[0159] For each preset variable name, after the preset variable name is input into a preset variable name expansion model, at least one expanded variable name having the same semantics as the preset variable name is output through the preset variable name expansion model, wherein the preset variable name includes a first preset variable name or a second preset variable name;

[0160] The at least one expanded variable name is added to a preset corpus of the preset semantic recognition model, wherein the preset corpus includes the first preset variable name and / or the second preset variable name.

[0161] According to one or more embodiments of the present disclosure, Example 9 provides the method of any one of Examples 1-8, wherein the method further includes:

[0162] For at least one of the program files included in each preset file storage unit, abnormal value statistics are performed on the abnormal amount recognition results of the other variables corresponding to the at least one program file to obtain the abnormal amount value corresponding to the preset file storage unit;

[0163] Sorting the plurality of preset file storage units according to the abnormal amount value corresponding to each preset file storage unit;

[0164] The sorting result and the amount abnormality identification result corresponding to each of the preset file storage units are sent to the target terminal.

[0165] According to one or more embodiments of the present disclosure, Example 10 provides a file identification device, the device comprising:

[0166] An acquisition module, used for acquiring a program file to be identified, wherein the program file includes a plurality of variables;

[0167] A determination module, used to determine a target variable for representing target data from the plurality of variables, wherein the target data is data that requires mathematical operation and is not related to amount data;

[0168] An identification module is used to identify amount anomalies of other variables among the multiple variables except the target variable. The amount anomaly identification is used to identify whether the corresponding variable belongs to the target amount variable. The amount data corresponding to the target amount variable has the risk of losing precision.

[0169] According to one or more embodiments of the present disclosure, Example 11 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-9 when executed by a processing device.

[0170] According to one or more embodiments of the present disclosure, Example 12 provides an electronic device, including:

[0171] a storage device having a computer program stored thereon;

[0172] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-9.

[0173] According to one or more embodiments of the present disclosure, Example 13 provides a computer program product, including a computer program, which implements the steps of any one of the methods of Examples 1-9 when executed by a processor.

[0174] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0175] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0176] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A file identification method, characterized in that: The method comprises: Obtaining a program file to be identified, wherein the program file includes a plurality of variables; Determining a target variable for representing target data from the plurality of variables, wherein the target data is data that requires mathematical operation and is not related to amount data; Amount anomaly identification is performed on other variables among the multiple variables except the target variable, and the amount anomaly identification is used to identify whether the corresponding variable belongs to the target amount variable, and the amount data corresponding to the target amount variable has the risk of precision loss.

2. The method according to claim 1, characterized in that The method further comprises: Parsing the program file through an abstract syntax tree AST to obtain a target AST corresponding to the program file, wherein the target AST includes variable nodes, and the variable nodes are used to represent variables in the program file; For each of the variable nodes in the target AST, semantic recognition is performed on the variable name of the variable corresponding to the variable node through a preset semantic recognition model to obtain a semantic recognition result of the variable name; Determining a target variable for characterizing target data from the plurality of variables comprises: The target variable is determined from the multiple variables according to the semantic recognition results corresponding to each variable.

3. The method according to claim 2, characterized in that The semantic recognition result includes a first semantic similarity between the variable name and a first preset variable name, where the first preset variable name is a variable name that is preset to have the same semantics as the variable name of the target variable; The performing semantic recognition on the variable name of the variable corresponding to the variable node by using a preset semantic recognition model includes: After inputting the variable name into the preset semantic recognition model, outputting the first semantic similarity corresponding to the variable name through the preset semantic recognition model; Determining the target variable from the multiple variables according to the semantic recognition results corresponding to each variable includes: For each of the variables, when the first semantic similarity corresponding to the variable name of the variable is greater than or equal to a first preset similarity threshold, the variable is used as the target variable.

4. The method according to claim 2, characterized in that: The semantic recognition result includes a second semantic similarity between the variable name and a second preset variable name, where the second preset variable name is a preset variable name used to represent amount data; The performing semantic recognition on the variable name of the variable corresponding to the variable node by using a preset semantic recognition model includes: After inputting the variable name into the preset semantic recognition model, outputting the second semantic similarity corresponding to the variable name through the preset semantic recognition model; The step of identifying abnormal amounts of other variables among the multiple variables except the target variable includes: For each of the other variables, determining the variable type of the other variable according to a second semantic similarity between the variable name of the other variable and the second preset variable name; The amount abnormality of the other variables is identified according to the variable type.

5. The method according to claim 4, characterized in that The determining the variable type of the other variable according to the second semantic similarity between the variable name of the other variable and the second preset variable name includes: When the second semantic similarity is greater than or equal to a second preset similarity threshold, determining that the variable type of the other variable is a first amount variable; When the second semantic similarity is less than the second preset similarity threshold, determining the variable type of the other variable to be a second amount variable; The first amount variable represents that the other variables are determined variables representing amount data, and the second amount variable represents that the other variables are any other variables among the multiple variables except the target variable and the first amount variable.

6. The method according to claim 5, characterized in that The identifying of abnormal amounts of the other variables according to the variable type includes: Determine a target recognition rule corresponding to the variable type; When it is determined that the other variable hits the target identification rule, it is determined that the other variable belongs to the target amount variable.

7. The method according to claim 6, characterized in that When the variable type is the first amount variable, the target identification rule includes at least one of floating point operation, conversion into decimal points, and a default amount value. When the variable type is the second amount variable, the target identification rule includes at least one of the floating point operation and the fraction conversion.

8. The method according to claim 2, characterized in that: The method further comprises: For each preset variable name, after the preset variable name is input into a preset variable name expansion model, at least one expanded variable name having the same semantics as the preset variable name is output through the preset variable name expansion model, wherein the preset variable name includes a first preset variable name or a second preset variable name; The at least one expanded variable name is added to a preset corpus of the preset semantic recognition model, wherein the preset corpus includes the first preset variable name and / or the second preset variable name.

9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: For at least one of the program files included in each preset file storage unit, abnormal value statistics are performed on the abnormal amount recognition results of the other variables corresponding to the at least one program file to obtain the abnormal amount value corresponding to the preset file storage unit; Sorting the plurality of preset file storage units according to the abnormal amount value corresponding to each preset file storage unit; The sorting result and the amount abnormality identification result corresponding to each of the preset file storage units are sent to the target terminal.

10. A file recognition device, characterized in that: The device comprises: An acquisition module, used for acquiring a program file to be identified, wherein the program file includes a plurality of variables; A determination module, used to determine a target variable for representing target data from the plurality of variables, wherein the target data is data that requires mathematical operation and is not related to amount data; An identification module is used to identify amount anomalies of other variables among the multiple variables except the target variable. The amount anomaly identification is used to identify whether the corresponding variable belongs to the target amount variable. The amount data corresponding to the target amount variable has the risk of losing precision.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 9 are implemented.

12. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Text information acquisition method and system

    CN113779935A

  • Database migration evaluation method and device, equipment and medium

    CN114911770A

  • Loss reporting type identification method and device, equipment, storage medium and program product

    CN115034873A

  • Digital currency wallet security detection method and apparatus, and electronic device

    CN116738432A

  • Application programming interface to enable frame interpolation

    US20240104689A1