Disclosure of Invention
The application provides a method for developing a function through a packaged page, which can solve the problems that the page development efficiency is too low and quick-maturing iteration cannot be performed on a version in the prior art.
In a first aspect, the present application provides a JavaScript code detection method, including:
and acquiring JavaScript codes, and constructing an abstract syntax tree corresponding to the JavaScript codes. The abstract syntax tree is created by a syntax analyzer. The grammar analyzer refers to a component of a compiler or an interpreter, and is used for grammar checking and constructing a data structure according to variables in the JavaScript code.
Checking rules in JavaScript code are looked up through an automation script. The checking rule refers to a rule for generating an abnormal variable in the detection if statement through the applicable scene, preconditions, standard types and judgment standards of the variable.
And traversing the if statement in the abstract syntax tree to obtain the if statement of the JavaScript code.
And setting identification information for variables in each if statement in the JavaScript code respectively.
And comparing and detecting the variable in each line if statement in the JavaScript code by using the regular expression and the check rule to obtain a detection result.
And if the detection result is successful, returning an array and updating the attribute of the regular expression object and the regular expression object.
Or if the detection result is failure, returning to the empty set and sending out an abnormal notification.
In some possible designs, the obtaining the if statement of the JavaScript code by traversing the if statement in the abstract syntax tree includes:
and traversing all objects of the abstract syntax tree circularly, and if the objects are equal to the if character string through object name judgment and if the matching array contains an if, determining that the JavaScript code contains an if statement. The array is used for storing the state of the JavaScript code. The state includes an attribute of the code.
Searching whether a variable exists in an if statement in the JavaScript code, if so, judging that the if statement contains the variable and identifying the if statement.
In some possible designs, the variable identification information includes at least one of: the method comprises the steps of detecting function names of functions of the mark variable assignment statement of JavaScript, line numbers of the mark variable assignment statement of JavaScript code, file names of source files of the mark variable assignment statement of JavaScript code.
In some possible designs, the exception notification refers to a notification generated by combining a code line number, an exception variable, the exception information, and an exception flag in a fixed format.
In some possible designs, the exception flag refers to a 32-bit binary number for detecting code exceptions, each bit of the binary number representing an exception state conveying each code run.
After the comparison detection is completed, a 32-bit 2-ary number is returned.
If the ith bit is 1, the code of the (i+1) th function is determined to operate normally.
If the ith bit is 0, determining that the code operation of the (i+1) th function is abnormal. And i is an integer of 0 or more and 32 or less.
In some possible designs, the specification categories include at least: naming convention, claim convention, annotation convention, constant convention, bean definition convention, transaction convention, script convention, log convention, exception handling convention, junit convention, error class convention, warning class convention, and hint class convention.
In some possible designs, after the returning the empty set, the method further comprises:
sending out indication information; the instruction information is used for indicating the detection result of each if statement in the JavaScript code. .
In a second aspect, the present application provides an apparatus for detecting JavaScript code, having a function of implementing a method for JavaScript code detection corresponding to the first aspect. The functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions described above, which may be software and/or hardware.
The device for detecting JavaScript code includes:
the input/output module is used for acquiring JavaScript codes;
and the processing module is used for constructing an abstract syntax tree corresponding to the JavaScript code. The abstract syntax tree is created by a syntax analyzer. The grammar analyzer refers to a component of a compiler or an interpreter, and is used for grammar checking and constructing a data structure according to variables in the JavaScript code. Checking rules in JavaScript code are looked up through an automation script. The checking rule refers to a rule for generating an abnormal variable in the detection if statement through the applicable scene, preconditions, standard types and judgment standards of the variable. And traversing the if statement in the abstract syntax tree to obtain the if statement of the JavaScript code. And setting identification information for variables in each if statement in the JavaScript code respectively. Comparing and detecting variables in each row of if sentences in the JavaScript code by using a regular expression and the checking rule to obtain a detection result;
and if the detection result is successful, returning an array through the input/output module and updating the attribute of the regular expression object and the regular expression object;
or if the detection result is failure, returning to an empty set and sending out an abnormal notification through the input/output module.
In some possible designs, the processing module is further to:
and traversing all objects of the abstract syntax tree circularly, and if the objects are equal to the if character string through object name judgment and if the matching array contains an if, determining that the JavaScript code contains an if statement. The array is used for storing the state of the JavaScript code. The state includes an attribute of the code.
Searching whether a variable exists in an if statement in the JavaScript code, if so, judging that the if statement contains the variable and identifying the if statement.
In some possible designs, the variable identification information includes at least one of: the method comprises the steps of detecting function names of functions of the mark variable assignment statement of JavaScript, line numbers of the mark variable assignment statement of JavaScript code, file names of source files of the mark variable assignment statement of JavaScript code.
In some possible designs, the exception notification refers to a notification generated by combining a code line number, an exception variable, the exception information, and an exception flag in a fixed format.
In some possible designs, the exception flag refers to a 32-bit binary number for detecting code exceptions, each bit of the binary number representing an exception state conveying each code run.
The processing module is further configured to:
after the comparison detection is completed, a 32-bit 2-ary number is returned.
If the ith bit is 1, the code of the (i+1) th function is determined to operate normally.
If the ith bit is 0, determining that the code operation of the (i+1) th function is abnormal. And i is an integer of 0 or more and 32 or less.
In some possible designs, the specification categories include at least: naming convention, claim convention, annotation convention, constant convention, bean definition convention, transaction convention, script convention, log convention, exception handling convention, junit convention, error class convention, warning class convention, and hint class convention.
In some possible designs, the processing module is also used to
Sending out indication information; the instruction information is used for indicating the detection result of each if statement in the JavaScript code.
In yet another aspect, the present application provides a computer device, which includes at least one connected processor, a memory, and an input/output unit, where the memory is configured to store program code, and the processor is configured to invoke the program code in the memory to perform the method described in the above aspects.
In yet another aspect, the application provides a computer storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of the above aspects.
In the existing mechanism, when there are a plurality of or in the if statement, if the previous judgment statement is satisfied, the JavaScript parsing engine mechanism does not continue to parse the following conditional statement. The application provides a method for detecting variable information when an if code is abnormal. The method is characterized in that an abstract syntax tree is traversed, abnormal variables in an if sentence are found, the variables in the if sentence are identified, and if the identified variables are judged to be abnormal through a regular expression and an inspection rule, the abnormal variables are sent to relevant developers. The problem that if statement variables in JavaScript codes are undefined is solved, error reporting prompt is carried out on an developer, and the robustness of the codes is guaranteed.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those listed or explicitly listed or inherent to such process, method, article, or apparatus, but may include other steps or modules that may not be listed or inherent to such process, method, article, or apparatus, the partitioning of such modules by the present application may be by one logical partitioning, and may be implemented by other means, such as a plurality of modules may be combined or integrated in another system, or some features may be omitted, or not implemented.
The application provides a JavaScript code detection method, a JavaScript code detection device, javaScript code detection equipment and a storage medium, which can be used for detecting abnormal variables of if sentences in JavaScript codes.
In order to solve the technical problems, the application mainly provides the following technical scheme:
the application provides a method for detecting variable information when an if code is abnormal. The method comprises the steps of obtaining JavaScript codes and constructing abstract syntax trees corresponding to the JavaScript codes; searching checking rules in the JavaScript code through an automatic script; traversing an if statement in the abstract syntax tree to obtain an if statement of the JavaScript code; respectively setting identification information for variables in each if statement in the JavaScript code; comparing and detecting variables in each row of if sentences in the JavaScript code by using a regular expression and a checking rule to obtain a detection result; if the detection result is failure, returning to the empty set and sending out an abnormal notification.
Referring to fig. 1, the following illustrates a JavaScript code detection method according to the present application, where the method includes:
101. and acquiring JavaScript codes, and constructing an abstract syntax tree corresponding to the JavaScript codes. The JavaScript is an transliteration script language, is a dynamic, prototype-based language, and is built-in with support types. Its interpreter, called JavaScript engine, is an integral part of the browser, which JavaScript is a scripting language for clients and is used on hypertext markup language (Hyper Text Markup Language, HTML) web pages to add dynamic functionality to the HTML web pages. Consists of ECMAScript, document object model and browser object model. The ECMAScript describes the JavaScript syntax and basic object. The document object model describes a method and interface for processing web page content. The browser object model describes a method and interface for interacting with a browser. The JavaScript is used to include embedding dynamic text in HTML pages, responding to browser events, reading and writing HTML elements, validating data before it is submitted to the server, detecting browser information for guests, controlling Cookies, and server-side programming based on node. Js technology. The Cookies are one way in which a server or script may maintain information on a client workstation under the HTTP protocol. Cookies are small text files saved by a Web server on a user's browser, which may contain information about the user. The Web site can access Cookie information whenever the user links to the server.
For example, when a website is accessed, the website stores a small text file on your machine, the Cookie records information such as your user ID, password, browsed web page, stay time, etc., and when the website is accessed again, the website reads the Cookie to obtain your relevant information, so that corresponding actions can be performed, such as displaying your slogan on the page, or allowing you to log in directly without inputting ID, password, etc. The "set/view file" may be selected in the "regular" tab of the "tools/Internet options" of the IE to view all cookies saved into the computer. These files are typically named in the user@domain format, with user being your local user name.
The abstract syntax tree is created by a syntax analyzer. The grammar analyzer refers to a component of a compiler or an interpreter, and is used for grammar checking and constructing a data structure according to variables in the JavaScript code. The data structure refers to a collection of data elements that have one or more specific relationships with each other. The abstract Syntax tree (Abstract Syntax Tree, AST), or simply Syntax tree (syncax tree), is an abstract representation of the source code Syntax structure. It represents the syntax structure of a programming language in the form of a tree, each node on the tree representing a structure in the source code.
Abstract syntax trees are widely used as an intermediate representation form of programs in various fields such as program analysis. A variety of source processing tools, such as a source browser, an intelligent editor, and a language translator, may be conveniently implemented using an abstract syntax tree. The code may be parsed by the abstract syntax tree.
102. Checking rules in JavaScript code are looked up through an automation script.
The checking rule refers to a rule for generating an abnormal variable in the detection if statement through the applicable scene, preconditions, standard types and judgment standards of the variable.
The check rule refers to a rule for detecting an abnormal variable in an if statement.
And traversing the if statement in the abstract syntax tree to obtain the if statement of the JavaScript code.
Traversing the abstract syntax tree by a depth-first method. The initial state for a given G is that all vertices have not been visited. For example, if a vertex v is selected as the initial departure point in G, the depth-first traversal may be defined as follows: firstly, accessing a departure point v and marking the departure point v as accessed; each adjacency point w of v is then searched in turn starting from v. If w has not been visited, then proceeding depth-first traversal with w as new departure point until all vertices in the graph with path to source point v have been visited. If there are still non-visited vertices in the graph at this time, the above process is repeated with an alternative non-visited vertex as a new source point until all vertices in the graph have been visited.
104. And setting identification information for variables in each if statement in the JavaScript code respectively.
The variables include at least global or local variables. The Local Variable refers to a Variable inside a function, the scope of the Local Variable is limited to the inside of the function, the Local Variable is invalid after leaving the function, and errors are reported when the Local Variable is reused. Global Variable (Global Variable) refers to a Variable defined outside of all functions whose scope is by default the whole program, i.e. all source files. The source file refers to a code file written in storage assembly language or a high-level language.
105. And comparing and detecting the variable in each line if statement in the JavaScript code by using the regular expression and the check rule to obtain a detection result.
The regular expression refers to a regular expression (Regular Expression, regex) for retrieving and replacing text conforming to the rules. Regular expressions refer to a logical formula of string operations, and a "regular string" is formed by using specific characters defined in advance and combinations of the specific characters, and is used for expressing a filtering logic for the string. The following objects can be achieved by regular expressions:
1. whether a given string conforms to the filtering logic of a regular expression.
2. The specific part that we want can be obtained from the string by regular expression.
106. And if the detection result is successful, returning an array and updating the attribute of the regular expression object and the regular expression object.
Or if the detection result is failure, returning to an empty set (NULL) and sending out an abnormal notification.
The regular expression is a logic formula for operating the character string and the special characters, namely, a "regular character string" is formed by a plurality of specific characters defined in advance and the combination of the specific characters, and the "regular character string" is used for expressing a filtering logic for the character string. A regular expression is a text pattern that describes one or more strings to be matched when searching text.
Taking an analysis array as an example, the definition structure is in a [ subscript variable name ] format, and when the subscript variable name ] target variable is not judged in a value range before use. According to the inspection rules, [ subscript variable name ] satisfies the following format:
[ beginning with letters or underlines beginning with the second digit consisting of letters, underlines, numbers ]
For example, scanning vEveryKom index code sentence, according to the format of index variable name and through regular expression, index character string meets the word rule of "first second digit of letter or underline is formed by letter, underline, number, etc., and also meets the rule of symbol following it, so the segmented index variable is index.
After the comparison detection is finished, the abnormal information of the variables is stored in a database and summarized, and the file information of the tandem assembly is presented by using a monitoring log. The anomaly information of the recorded variables includes at least: at least one of checking path, code name to be checked, error line number and error description. And counting and displaying information of the monitoring log through a visual chart. The visual chart includes at least a bar chart, a histogram, a line chart, and a pie chart. The visual chart is selected by selecting the visual chart type, and any visual chart or a plurality of visual charts can be saved and displayed. The integral statistical report function is added, and the variable anomaly problem easily occurring in the JavaScript code is fed back more intuitively.
In the above embodiment, the abstract syntax tree is traversed to find out the abnormal variable in the if statement, identify the variable in the if statement, and if the identified variable is abnormal according to the regular expression and the inspection rule, send an abnormality notification to the relevant developer. The problem that if statement variables in JavaScript codes are undefined is solved, error reporting prompt is carried out on an developer, and the robustness of the codes is guaranteed. The robustness refers to the processing power of the software for input situations outside of the specification requirements. A robust system has the capability of judging that an input outside the specification requirements does not meet the specification requirements and has a reasonable processing mode.
In some embodiments, the obtaining the if statement of the JavaScript code by traversing the if statement in the abstract syntax tree comprises:
and traversing all objects of the abstract syntax tree circularly, and if the objects are equal to the if character string through object name judgment and if the matching array contains an if, determining that the JavaScript code contains an if statement. The array is used for storing the state of the JavaScript code. The state includes an attribute of the code.
Searching whether a variable exists in an if statement in the JavaScript code, if so, judging that the if statement contains the variable and identifying the if statement.
In the embodiment, the method can search the if statement in the JavaScript code and identify the code containing the if statement.
In some embodiments, the variable identification information includes at least one of: the method comprises the steps of detecting function names of functions of the mark variable assignment statement of JavaScript, line numbers of the mark variable assignment statement of JavaScript code, file names of source files of the mark variable assignment statement of JavaScript code.
In the above embodiment, the identification information can better find that an abnormality exists in a variable, for example, a sinx function x variable indicated as 101 st line in the source program file. For example, if the undefined problem exists in the A variable in the code line number 110, the variable flag information is 32768, and if the fixed format is error X flag information-X abnormal information exists in the X-th code line number, the abnormal information is reminded of the undefined problem in the A variable in the error 32768-110.
In some embodiments, the exception notification is a notification generated by combining a code line number, an exception variable, the exception information, and an exception flag in a fixed format.
In the above embodiment, when the abnormality code is determined, the abnormality notification may be generated based on the abnormality code, the abnormality information, and the abnormality data, so that the developer is notified based on the abnormality notification.
For example, when detecting that there are three variables x, y and z in the code line number 555, respectively, where the variables are undefined, the variable is repeatedly defined, and the local variable is used in the global domain, the variable flag information is 32768, 12668 and 654, respectively, if the fixed format is error XX flag information-there is XX abnormal information in the XX line number, the abnormal information is reminded that there is undefined problem for the x variable in the 32768-555 th line.
And after the exception processing of the x variable is completed, detecting again, wherein the exception information is reminded that the y variable in the error 12668-555 th row has the problem of repeated variable definition.
After the exception processing of the x variable and the y variable is completed, the exception information is reminded that the z variable in the error 654-555 th row has the problem of using the local variable in the global domain.
In some embodiments, the exception flag refers to a 32-bit binary number for detecting code exceptions, where each bit of the binary number represents an exception state that conveys each code run.
After the comparison detection is completed, a 32-bit 2-ary number is returned.
If the ith bit is 1, the code of the (i+1) th function is determined to operate normally.
If the ith bit is 0, determining that the code operation of the (i+1) th function is abnormal. And i is an integer of 0 or more and 32 or less.
In the above embodiment, taking the variable type definition error as an example, the 0 th bit of the 2 nd number represents the variable type definition error. After executing the whole flow, returning a 32-bit 2-system number to detect the execution state of each function, if the 0 th bit is 1, the variable type definition is correct, and if the 0 th bit is 0, the variable type definition is wrong, and judging whether the variable type definition has a problem or not by the method.
In some embodiments, the specification categories include at least: naming convention, claim convention, annotation convention, constant convention, bean definition convention, transaction convention, script convention, log convention, exception handling convention, junit convention, error class convention, warning class convention, and hint class convention.
In the above embodiment, the above specifications establish the inspection rule of the variables. Such as duplicate definitions of variables, non-initialization of variables, non-use of character variable types, and non-definition of variables, etc. The naming specification refers to naming functions, naming variables and naming files, and consistency rules are the most important of naming management; comprising the following steps: all lower cases of project names, all lower cases of package names, all upper cases of class names, variable names, all lower cases of method names and all upper cases of constant names; the naming convention further includes: names can only consist of letters, numbers, underlining, $symbols, cannot start with numbers, names cannot use keywords in JAVA, and it is not always allowed that chinese and pinyin naming occur. The annotation specifications include copyright annotations, class annotations (Class), constructor annotations (Constructor), methods annotations (Methods), code Block annotations (Block), single sentence annotations, and field name annotations. The bean definition specification includes the means of operation that the class must use public decoration, must guarantee a common non-parametric constructor, contain attributes. The Junit specification includes: naming definition specification of test class, naming definition specification of test case, package name definition specification of test program and naming specification of variable.
The variable names of the test program are all in a case-by-case mixed mode, the first letter of the first word is lowercase, and the first letter of the following word is uppercase. For example: maxValue, setMobileBind and GetMobilebind et al. When the name is inconsistent with the rule, if the first letter of max of maxValue in maxValue is not capitalized, searching out max according to the checking rule and changing the max into maxValue.
In some embodiments, after the returning the empty set, the method further comprises:
sending out indication information; the instruction information is used for indicating the detection result of each if statement in the JavaScript code.
In the above embodiment, the variable information indicating the abnormality and the responsible person for the abnormality may be used to realize that different abnormality information is transferred to different responsible persons. For example, the responsibility of the variable information of the first abnormality is A, the responsibility of the variable information of the second abnormality is B, the contact information of A is configured with the variable information of the first abnormality through configuration, and the contact information of B is configured with the variable information of the second abnormality through configuration, so that the association of the variable information of the first abnormality, the contact information of A and the contact information of B with the variable information of the second abnormality are completed, and when a task is in error, the abnormal task is processed more efficiently by indicating who knows the responsibility of the specific task error.
A schematic structural diagram of an apparatus 20 for detecting JavaScript code as shown in fig. 2 is applicable to JavaScript code detection. The device for detecting JavaScript codes in the embodiment of the application can realize the steps corresponding to the method for detecting JavaScript codes executed in the embodiment corresponding to fig. 1. The function implemented by the device 20 for detecting JavaScript codes may be implemented by hardware, or may be implemented by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above, which may be software and/or hardware. The means for detecting JavaScript code may include an input/output module 201 and a processing module 202, and the functional implementation of the processing module 202 and the input/output module 201 may refer to the operations performed in the embodiment corresponding to fig. 1, which are not described herein. The input-output module 201 may be used to control the input, output and acquisition operations of the input-output module 201.
In some embodiments, the input-output module 201 may be configured to obtain JavaScript code.
The processing module 202 may be configured to construct an abstract syntax tree corresponding to the JavaScript code. The abstract syntax tree is created by a syntax analyzer. The grammar analyzer refers to a component of a compiler or an interpreter, and is used for grammar checking and constructing a data structure according to variables in the JavaScript code. Checking rules in JavaScript code are looked up through an automation script. The checking rule refers to a rule for generating an abnormal variable in the detection if statement through the applicable scene, preconditions, standard types and judgment standards of the variable. And traversing the if statement in the abstract syntax tree to obtain the if statement of the JavaScript code. And setting identification information for variables in each if statement in the JavaScript code respectively. And comparing and detecting the variable in each line if statement in the JavaScript code by using the regular expression and the check rule to obtain a detection result.
If the detection result is successful, an array is returned through the input/output module 201 and the attribute of the regular expression object and the regular expression object are updated.
Or if the detection result is failure, returning to the empty set and sending out an abnormal notification through the input/output module 201.
In some embodiments, the processing module 202 is further configured to:
and traversing all objects of the abstract syntax tree circularly, and if the objects are equal to the if character string through object name judgment and if the matching array contains an if, determining that the JavaScript code contains an if statement. The array is used for storing the state of the JavaScript code. The state includes an attribute of the code.
Searching whether a variable exists in an if statement in the JavaScript code, if so, judging that the if statement contains the variable and identifying the if statement.
In some embodiments, the variable identification information includes at least one of: the method comprises the steps of detecting function names of functions of the mark variable assignment statement of JavaScript, line numbers of the mark variable assignment statement of JavaScript code, file names of source files of the mark variable assignment statement of JavaScript code.
In some embodiments, the exception notification is a notification generated by combining a code line number, an exception variable, the exception information, and an exception flag in a fixed format.
In some embodiments, the exception flag refers to a 32-bit binary number for detecting code exceptions, where each bit of the binary number represents an exception state that conveys each code run.
The processing module 202 is further configured to:
after the comparison detection is completed, a 32-bit 2-ary number is returned.
If the ith bit is 1, the code of the (i+1) th function is determined to operate normally.
If the ith bit is 0, determining that the code operation of the (i+1) th function is abnormal. And i is an integer of 0 or more and 32 or less.
In some embodiments, the specification categories include at least: naming convention, claim convention, annotation convention, constant convention, bean definition convention, transaction convention, script convention, log convention, exception handling convention, junit convention, error class convention, warning class convention, and hint class convention.
In some embodiments, the processing module 202 is further configured to:
sending out indication information; the instruction information is used for indicating the detection result of each if statement in the JavaScript code.
The creation means in the embodiment of the present application are described above from the point of view of modularized functional entities, and the following describes a computer device from the point of view of hardware, as shown in fig. 3, which includes: a processor, a memory, an input output unit (which may also be a transceiver, not identified in fig. 3) and a computer program stored in the memory and executable on the processor. For example, the computer program may be a program corresponding to the JavaScript code detection method in the embodiment corresponding to fig. 1. For example, when the computer device implements the function of the apparatus for detecting JavaScript code 20 shown in fig. 2, the processor implements each step in the method for detecting JavaScript code performed by the apparatus for detecting JavaScript code 20 in the embodiment corresponding to fig. 2 described above when executing the computer program. Alternatively, the processor may implement the functions of each module in the apparatus 20 for detecting JavaScript code according to the embodiment corresponding to fig. 2 when executing the computer program. For another example, the computer program may be a program corresponding to the JavaScript code detection method in the embodiment corresponding to fig. 1.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that is a control center of the computer device, connecting various parts of the overall computer device using various interfaces and lines.
The memory may be used to store the computer program and/or modules, and the processor may implement various functions of the computer device by running or executing the computer program and/or modules stored in the memory, and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, video data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
The input-output unit may be replaced by a receiver and a transmitter, and may be the same or different physical entities. Are the same physical entities and may be collectively referred to as input/output units. The input and output may be a transceiver.
The memory may be integrated in the processor or may be provided separately from the processor.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM), comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server or a network device, etc.) to perform the method according to the embodiments of the present application.
While the embodiments of the present application have been described above with reference to the drawings, the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many modifications may be made thereto by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the appended claims, which are to be accorded the full scope of the present application as defined by the following description and drawings, or by any equivalent structures or equivalent flow changes, or by direct or indirect application to other relevant technical fields.