CN112181837A - Information processing method, information processing device and terminal equipment - Google Patents

Information processing method, information processing device and terminal equipment Download PDF

Info

Publication number
CN112181837A
CN112181837A CN202011056901.4A CN202011056901A CN112181837A CN 112181837 A CN112181837 A CN 112181837A CN 202011056901 A CN202011056901 A CN 202011056901A CN 112181837 A CN112181837 A CN 112181837A
Authority
CN
China
Prior art keywords
validity
function
file
executed
code file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011056901.4A
Other languages
Chinese (zh)
Inventor
刘均
舒海文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202011056901.4A priority Critical patent/CN112181837A/en
Publication of CN112181837A publication Critical patent/CN112181837A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/51Source to source

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides an information processing method, which comprises the following steps: when a configuration file is converted into a code file, if an effectiveness identifier exists in the configuration file, an effectiveness judgment function is set in the converted code file according to the effectiveness identifier, wherein the effectiveness identifier is used for indicating whether a specified operation is executed in the configuration file, and the effectiveness judgment function is used for judging whether the specified operation is executed in the code file; and when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, wherein the target identifier is used for identifying the specified operation. By the method and the device, the problem that at present, the validity identification defined in the configuration file such as the OTX cannot be called and executed in the code file, so that the function or operation associated with the validity identification cannot be realized in the code file can be solved.

Description

Information processing method, information processing device and terminal equipment
Technical Field
The present application belongs to the field of information processing technologies, and in particular, relates to an information processing method, an information processing apparatus, and a terminal device.
Background
In an application scenario such as the field of vehicle diagnosis, some developers consider configuring specific functions, processes, and the like in application software in specific types of files (for simplicity of description, in the following description, a specific type of file capable of configuring information of the specific functions, processes, and the like is referred to as a configuration file). For example, the vehicle diagnostic function may be configured in an Open Test sequence Exchange format (OTX) file for use in developing vehicle diagnostic software. However, since the configuration file often does not have a corresponding compiler, the configuration file needs to be converted into a code file capable of being compiled.
However, some functions in the configuration file cannot be realized in the code file due to a large difference between the reference standard of the structure, the terminology, the specific writing way of the specific functions, and the like of the configuration file and the writing way of the code file.
For example, in an OTX type configuration file, functions and operations such as Action nodes, Group nodes and Procedures need to be activated or frozen by a term named Validity (Validity) defined in the configuration file, wherein the term named Validity (Validity) can be used as a Validity identifier. Since the validity flag defined in the configuration file is not in a hard-coded format, the validity flag defined in the configuration file cannot be called and executed in the code file, so that associated functions such as Action nodes, Group nodes, and Procedures cannot be implemented in the code file.
Disclosure of Invention
In view of this, embodiments of the present application provide an information processing method, an information processing apparatus, and a terminal device, which can solve the problem that at present, a validity flag defined in a configuration file, such as OTX, cannot be called and executed in a code file, so that a function or an operation associated with the validity flag cannot be implemented in the code file.
A first aspect of an embodiment of the present application provides an information processing method, including:
when a configuration file is converted into a code file, if an effectiveness identifier exists in the configuration file, an effectiveness judgment function is set in the converted code file according to the effectiveness identifier, wherein the effectiveness identifier is used for indicating whether a specified operation is executed in the configuration file, and the effectiveness judgment function is used for judging whether the specified operation is executed in the code file;
and when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, wherein the target identifier is used for identifying the specified operation.
Optionally, the function name of the validity judgment function is a preset attribute name of the validity identifier;
when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, including:
and when the code file is executed, if the target identification is detected, calling the validity judging function through the function name of the validity judging function so as to determine whether to execute the specified operation.
Optionally, the configuration file is an open test sequence exchange format OTX file, and the validity flag is a boolean variable.
Optionally, when the code file is executed, if a target identifier is detected, the validity judgment function is called to determine whether to execute the specified operation, where the method includes:
when the code file is executed, if a target identifier is detected, calling the validity judgment function to obtain judgment information returned by the validity judgment function, wherein the judgment information is a Boolean variable;
and determining whether to execute the specified operation according to the judgment information.
Optionally, the code file includes a source file and a header file;
when the configuration file is converted into the code file, if the validity identification exists in the configuration file, setting a validity judgment function in the converted code file according to the validity identification, wherein the validity judgment function comprises the following steps:
when a configuration file is converted into a code file, if an effectiveness identification exists in the configuration file, declaring the effectiveness judgment function in a header file obtained by conversion according to the effectiveness identification, and defining the function content of the effectiveness judgment function in a source file obtained by conversion;
when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, including:
and when the code file is executed, if the target identification is detected, calling the validity judging function according to the function content of the validity judging function in the source file to determine whether to execute the specified operation.
Optionally, when the code file is executed, if a target identifier is detected, the validity judgment function is called to determine whether to execute the specified operation, where the method includes:
when the code file is executed, if the target identifier is detected, generating a conditional statement about the validity judging function and the target identifier, wherein a conditional part of the conditional statement is determined based on judging information returned by the validity judging function, and a part to be executed of the conditional statement is determined based on the specified operation;
executing the conditional statement to determine whether to perform the specified operation.
A second aspect of an embodiment of the present application provides an information processing apparatus, including:
the system comprises a setting module, a code file conversion module and a judging module, wherein the setting module is used for setting a validity judging function in a converted code file according to a validity identification when the configuration file is converted into the code file, the validity identification is used for indicating whether a specified operation is executed in the configuration file, and the validity judging function is used for judging whether the specified operation is executed in the code file;
and the calling module is used for calling the validity judging function to determine whether to execute the specified operation if a target identifier is detected when the code file is executed, wherein the target identifier is used for identifying the specified operation.
Optionally, the function name of the validity judgment function is a preset attribute name of the validity identifier;
the calling module is specifically configured to:
and when the code file is executed, if the target identification is detected, calling the validity judging function through the function name of the validity judging function so as to determine whether to execute the specified operation.
Optionally, the configuration file is an open test sequence exchange format OTX file, and the validity flag is a boolean variable.
Optionally, the calling module specifically includes:
the calling unit is used for calling the validity judging function to obtain judging information returned by the validity judging function if a target identifier is detected when the code file is executed, wherein the judging information is a Boolean variable;
and the determining unit is used for determining whether to execute the specified operation according to the judgment information.
Optionally, the code file includes a source file and a header file;
the setting module is specifically configured to:
when a configuration file is converted into a code file, if an effectiveness identification exists in the configuration file, declaring the effectiveness judgment function in a header file obtained by conversion according to the effectiveness identification, and defining the function content of the effectiveness judgment function in a source file obtained by conversion;
the calling module is specifically configured to:
and when the code file is executed, if the target identification is detected, calling the validity judging function according to the function content of the validity judging function in the source file to determine whether to execute the specified operation.
Optionally, the calling module specifically includes:
a generating unit, configured to generate a conditional statement regarding the validity judging function and the target identifier if the target identifier is detected when the code file is executed, where a conditional part of the conditional statement is determined based on judgment information returned by the validity judging function, and a part to be executed of the conditional statement is determined based on the specifying operation;
and the execution unit is used for executing the conditional statement to determine whether to execute the specified operation.
A third aspect of embodiments of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method as described above.
Compared with the prior art, the embodiment of the application has the advantages that: in the embodiment of the application, when a configuration file is converted into a code file, if an validity identifier exists in the configuration file, a validity judgment function is set in the converted code file according to the validity identifier, wherein the validity identifier is used for indicating whether a specified operation is executed in the configuration file, and the validity judgment function is used for judging whether the specified operation is executed in the code file; at this time, the validity judging function may be executed when the code file is compiled, and the function of the validity flag may be implemented in the code file. Then, when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, wherein the target identifier is used for identifying the specified operation; at this time, whether the specified operation is executed or not can be conveniently determined by calling the validity judgment function, so that the corresponding function in the corresponding configuration file can be efficiently and conveniently realized in the code file, that is, the function of the specified operation associated with the target identifier is activated or frozen through the validity identifier.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating an implementation of an information processing method according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of another information processing method provided in the second embodiment of the present application;
FIG. 3 is a schematic diagram of an information processing apparatus according to a third embodiment of the present application;
fig. 4 is a schematic diagram of a terminal device according to a fourth embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In an application scenario such as the field of vehicle diagnosis, functions and flows such as vehicle diagnostic functions may be configured in an Open Test sequence Exchange format (OTX) file for subsequent application development. However, since the configuration file often does not have a corresponding compiler, the configuration file needs to be converted into a code file capable of being compiled.
However, some functions in the configuration file cannot be realized in the code file due to a large difference between the reference standard of the structure, the terminology, the specific writing way of the specific functions, and the like of the configuration file and the writing way of the code file.
For example, the inventor finds that in a configuration file of an OTX type or the like, functions, operations, and the like, such as Action nodes, Group nodes, and Procedures, need to be activated or frozen by a term named Validity (Validity) defined in the configuration file, wherein the term named Validity (Validity) can be used as a Validity flag. Since the validity flag defined in the configuration file is not in a hard-coded format, the validity flag defined in the configuration file cannot be called and executed in the code file, so that associated functions such as Action nodes, Group nodes, and Procedures cannot be implemented in the code file.
By the embodiment of the application, whether the specified operation associated with the validity identifier is executed or not can be conveniently determined by calling the validity judgment function in the code file, so that the corresponding function in the corresponding configuration file can be efficiently and conveniently realized in the code file, namely, the function of the specified operation associated with the target identifier is activated or frozen through the validity identifier.
The execution main body of the information processing method provided by the embodiment of the application can be terminal equipment. Illustratively, the terminal device may be a server, a desktop computer, a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), or the like. The embodiment of the present application does not set any limit to the specific type of the terminal device.
Specifically, in order to explain the technical means described in the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic flow chart of an implementation of an information processing method according to an embodiment of the present application, where the information processing method shown in fig. 1 may include the following steps:
step S101, when a configuration file is converted into a code file, if an validity identifier exists in the configuration file, a validity judgment function is set in the converted code file according to the validity identifier, wherein the validity identifier is used for indicating whether a specified operation is executed in the configuration file, and the validity judgment function is used for judging whether the specified operation is executed in the code file.
In this embodiment of the application, the configuration file may be a specific type of file capable of configuring information such as a specific function and a flow. The specific functions and processes configured in the configuration file may be determined based on specific application scenarios. For example, in the field of vehicle diagnostics, vehicle diagnostic function information may be included in the configuration file.
The file type, structure, terminology, specific writing mode of specific functions and other referenced standards of the configuration file can be determined according to actual scene requirements. For example, in some examples, the configuration file may be an Open Test sequence Exchange format (OTX) file. The OTX file can be written based on an OTX language. The OTX language is a high-level programming language and can be applied to the fields of automobile diagnosis and the like. The OTX language may be defined according to the ISO13209 series of standards. The OTX file may sample an Extensible Markup Language (EML) format.
It will be appreciated that the configuration file may also be a file written based on user-defined criteria or other criteria. The specific type of configuration file is not limited herein.
Since the configuration file often does not have a corresponding compiler, the configuration file needs to be converted into a code file capable of being compiled. The code file may be a file written based on a programming language such as C + +, Java, and the like, and the code file is subsequently compiled in application software such as automobile diagnostic software to implement the functions in the corresponding configuration file.
In this embodiment of the application, the validity flag may be used to indicate whether a specified operation is executed in the configuration file. The naming and specific form of the validity flag may be determined based on the configuration of the configuration file.
For example, if the configuration file is an OTX file, the Validity flag may be the term Validity defined in the standard corresponding to the OTX file. The Validity in the OTX file may specifically be a boolean variable (i.e. a value of the boolean type), or a complex expression. Whether a certain function or operation (i.e., the designated operation) in the OTX file is executed or not can be determined through the true and false information represented by the Validity, and the method is often used in terms of Action nodes, Group nodes, Procedures and the like in the OTX.
An application example of Validity of the OTX file is given below.
<?xml version="1.0"encoding="UTF-8"?>
<otx id="Otx202004091032478329225"name="validity"package="package">
<validities>
<validityid="Validity202004091033397209227"name="v1"visibility="PUBLIC">
<realisation value="false"xsi:type="BooleanLiteral"/>
</validity>
<validity id="Validity202004091034044279228"name="v2"visibility="PUBLIC">
<realisationxsi:type="IsEqual">
<term value="1"xsi:type="ns:IntegerLiteral"xmlns:ns="http://iso.org/OTX/1.0.0"/>
<term value="1"xsi:type="ns:IntegerLiteral"xmlns:ns="http://iso.org/OTX/1.0.0"/>
</realisation>
</validity>
</validities>
</otx>
In this embodiment of the application, the validity judgment function may implement the function of the validity flag in the code file, that is, whether the specified operation is executed or not may be judged by calling the validity judgment function.
Currently, in a configuration file of an OTX type or the like, the validity flag is not in a hard-coded format, and therefore, the validity flag in the configuration file does not change with the change of context data during the running process of a corresponding application program such as automobile diagnostic software. Thus, the validity defined in the configuration file cannot be directly translated into the code file.
In the embodiment of the present application, if the configuration file has the validity flag, a validity judgment function may be set in the converted code file according to the validity flag, so that the validity judgment function can implement the function of the validity flag. In this case, the validity determination function may return determination information for validity after being called, such as a boolean value indicating true or a boolean value indicating false.
Step S102, when the code file is executed, if a target identifier is detected, the validity judgment function is called to determine whether to execute the specified operation, wherein the target identifier is used for identifying the specified operation.
In the embodiment of the present application, the code file may be a file written based on a programming language such as C + +, Java, or the like. Therefore, by compiling the code file, an executable file can be obtained to be loaded and executed by a specified operating system.
In this embodiment of the application, the target identifier may be used to identify the specified operation, for example, the target identifier may be a name of the predefined specified operation, and may be a predefined specified node at which the specified operation may be executed.
For example, in an OTX file, terms such as Action node, Group node, and Procedures may respectively correspond to predefined operations.
The judgment information returned by the validity judgment function can be obtained by calling the validity judgment function, and the judgment information returned by the validity judgment function can be a boolean variable with null parameters. That is, the judgment information returned by the validity judgment function is a value indicated as true or a value indicated as false.
In the embodiment of the application, if the target identifier is detected, the validity judgment function is called to determine whether to execute the specified operation, at this time, the validity judgment function can perform validity judgment according to data obtained by current operation, so that the judgment information of the validity judgment function can change along with the change of the context in the execution process of the code file, namely, real-time data updating is realized, and the problem that the data cannot be updated in real time due to the fact that the setting form of the validity identifier in the configuration file cannot change along with the change of the context in the execution process is solved.
In addition, in the embodiment of the application, the judgment information returned by the validity judgment function can be obtained directly by calling the validity judgment function, a complex conversion process is not needed, a binding technology such as a pointer is not needed, and the implementation mode is relatively direct and convenient and is easy to implement.
It can be seen that, in the embodiment of the present application, when a configuration file is converted into a code file, if an validity flag exists in the configuration file, a validity judgment function is set in the converted code file according to the validity flag, where the validity flag is used to indicate whether a specified operation is executed in the configuration file, and the validity judgment function is used to judge whether the specified operation is executed in the code file; at this time, the validity judging function may be executed when the code file is compiled, and the function of the validity flag may be implemented in the code file. Then, when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, wherein the target identifier is used for identifying the specified operation; at this time, whether the specified operation is executed or not can be conveniently determined by calling the validity judgment function, so that the corresponding function in the corresponding configuration file can be efficiently and conveniently realized in the code file, that is, the function of the specified operation associated with the target identifier is activated or frozen through the validity identifier.
In some embodiments, the function name of the validity judgment function is a preset attribute name of the validity identifier;
when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, including:
and when the code file is executed, if the target identification is detected, calling the validity judging function through the function name of the validity judging function so as to determine whether to execute the specified operation.
In the configuration file, the target identifier may be associated with the validity of the target identifier by the preset attribute name of the corresponding validity identifier, and therefore, in the code file, the function name of the validity judgment function may be set as the preset attribute name of the validity identifier, so that in the code file, the target identifier may be associated with the validity judgment function conveniently according to the configuration information in the configuration file, and thus, when the target identifier is detected, the validity judgment function may be called by the function name of the validity judgment function to determine whether to execute the specified operation.
At this time, the validity judgment function in the code file can be conveniently defined and can be conveniently associated with the target identifier and called.
In some embodiments, the configuration file is an open test sequence exchange format OTX file and the validity flag is a boolean variable.
The boolean variable may represent a YES value or a NO value, or a true value or a false value, and at this time, the validity flag may determine whether a specified operation in the corresponding OTX file is executed through the output true value or false value.
In some embodiments, when the code file is executed, if a target identifier is detected, the invoking the validity judgment function to determine whether to execute the specified operation includes:
when the code file is executed, if a target identifier is detected, calling the validity judgment function to obtain judgment information returned by the validity judgment function, wherein the judgment information is a Boolean variable;
and determining whether to execute the specified operation according to the judgment information.
In the embodiment of the application, the information type of the judgment information returned by the validity judgment function is consistent with the information type of the validity identification, so that the steps of information conversion in the code file are reduced, and the subsequent operation is executed based on the content in the configuration file when the code file is executed.
In some embodiments, the code file includes a source file and a header file;
when the configuration file is converted into the code file, if the validity identification exists in the configuration file, setting a validity judgment function in the converted code file according to the validity identification, wherein the validity judgment function comprises the following steps:
when a configuration file is converted into a code file, if an effectiveness identification exists in the configuration file, declaring the effectiveness judgment function in a header file obtained by conversion according to the effectiveness identification, and defining the function content of the effectiveness judgment function in a source file obtained by conversion;
when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, including:
and when the code file is executed, if the target identification is detected, calling the validity judging function according to the function content of the validity judging function in the source file to determine whether to execute the specified operation.
In the embodiment of the present application, the code file may be a file written based on a programming language such as C + +, Java, and the like, and the code file is subsequently compiled in application software such as automobile diagnostic software, so as to implement the function in the corresponding configuration file.
For example, the code file may be a C + + program file, in this case, a header file of the C + + program file may be a header file with a suffix of.h, where the h file includes contents such as a function declaration, a macro definition, and a structure definition. The source file of the C + + program file may be a source file suffixed with cpp, where the cpp file includes function implementation, variable definition, and the like.
Therefore, when the configuration file is converted into the code file, if the configuration file has the validity identifier, the validity judgment function is declared in the header file obtained by conversion according to the validity identifier, and the function content of the validity judgment function is defined in the source file obtained by conversion, so that the validity judgment function can be called in the subsequent execution process of the code file.
In some embodiments, when the code file is executed, if a target identifier is detected, the invoking the validity judgment function to determine whether to execute the specified operation includes:
step S201, when the code file is executed, if the target identifier is detected, generating a conditional statement related to the validity judgment function and the target identifier, wherein a condition part of the conditional statement is determined based on judgment information returned by the validity judgment function, and a part to be executed of the conditional statement is determined based on the specified operation;
step S202, executing the conditional statement to determine whether to execute the specified operation.
For example, the conditional statement may be an If conditional statement, where a condition part of the If conditional statement is determined based on the judgment information returned by the validity judgment function, and a part to be executed in the If conditional statement may be the specified operation.
An exemplary implementation of the present application is described below as a specific example.
For example, the validity flag is a boolean variable output for a voltage V1 less than 10V, and if the validity flag is true, the corresponding specified operation is to display information of "voltage value is low". Then, the validity determination function may be used to determine whether the voltage V1 is less than 10V. In the If conditional statement, the conditional part may be to execute a part to be executed in the If conditional statement, that is, to execute the specified operation displaying the information of "lower voltage value", If the validity judgment function is called and the judgment information of the validity judgment function is obtained as true.
In the embodiment of the application, the call of the validity judgment function can be efficiently and reasonably completed through the conditional statement, and whether the specified operation is executed or not is determined, so that when the code file is executed, the function which is required to be realized through the validity identification in the configuration file can be realized, namely, the specified operation associated with the target identification is activated or frozen.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 3 is a schematic diagram of an information processing apparatus according to a third embodiment of the present application. For convenience of explanation, only portions related to the embodiments of the present application are shown.
The information processing apparatus 3 includes:
a setting module 301, configured to, when a configuration file is converted into a code file, set a validity judgment function in the converted code file according to a validity flag if the configuration file has the validity flag, where the validity flag is used to indicate whether a specified operation is executed in the configuration file, and the validity judgment function is used to judge whether the specified operation is executed in the code file;
a calling module 302, configured to, when the code file is executed, if a target identifier is detected, call the validity judgment function to determine whether to execute the specified operation, where the target identifier is used to identify the specified operation.
Optionally, the function name of the validity judgment function is a preset attribute name of the validity identifier;
the invoking module 302 is specifically configured to:
and when the code file is executed, if the target identification is detected, calling the validity judging function through the function name of the validity judging function so as to determine whether to execute the specified operation.
Optionally, the configuration file is an open test sequence exchange format OTX file, and the validity flag is a boolean variable.
Optionally, the invoking module 302 specifically includes:
the calling unit is used for calling the validity judging function to obtain judging information returned by the validity judging function if a target identifier is detected when the code file is executed, wherein the judging information is a Boolean variable;
and the determining unit is used for determining whether to execute the specified operation according to the judgment information.
Optionally, the code file includes a source file and a header file;
the setting module 301 is specifically configured to:
when a configuration file is converted into a code file, if an effectiveness identification exists in the configuration file, declaring the effectiveness judgment function in a header file obtained by conversion according to the effectiveness identification, and defining the function content of the effectiveness judgment function in a source file obtained by conversion;
the invoking module 302 is specifically configured to:
and when the code file is executed, if the target identification is detected, calling the validity judging function according to the function content of the validity judging function in the source file to determine whether to execute the specified operation.
Optionally, the invoking module 302 specifically includes:
a generating unit, configured to generate a conditional statement regarding the validity judging function and the target identifier if the target identifier is detected when the code file is executed, where a conditional part of the conditional statement is determined based on judgment information returned by the validity judging function, and a part to be executed of the conditional statement is determined based on the specifying operation;
and the execution unit is used for executing the conditional statement to determine whether to execute the specified operation.
In the embodiment of the application, when a configuration file is converted into a code file, if an validity identifier exists in the configuration file, a validity judgment function is set in the converted code file according to the validity identifier, wherein the validity identifier is used for indicating whether a specified operation is executed in the configuration file, and the validity judgment function is used for judging whether the specified operation is executed in the code file; at this time, the validity judging function may be executed when the code file is compiled, and the function of the validity flag may be implemented in the code file. Then, when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, wherein the target identifier is used for identifying the specified operation; at this time, whether the specified operation is executed or not can be conveniently determined by calling the validity judgment function, so that the corresponding function in the corresponding configuration file can be efficiently and conveniently realized in the code file, that is, the function of the specified operation associated with the target identifier is activated or frozen through the validity identifier.
Fig. 4 is a schematic diagram of a terminal device according to a fourth embodiment of the present application. As shown in fig. 4, the terminal device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42 stored in said memory 41 and executable on said processor 40. The processor 40 implements the steps in the above-described respective information processing method embodiments, such as steps 101 to 102 shown in fig. 1, when executing the computer program 42. Alternatively, the processor 40, when executing the computer program 42, implements the functions of each module/unit in each device embodiment described above, for example, the functions of the modules 301 to 302 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 42 in the terminal device 4. For example, the computer program 42 may be divided into a setting module and a calling module, and the specific functions of the modules are as follows:
the system comprises a setting module, a code file conversion module and a judging module, wherein the setting module is used for setting a validity judging function in a converted code file according to a validity identification when the configuration file is converted into the code file, the validity identification is used for indicating whether a specified operation is executed in the configuration file, and the validity judging function is used for judging whether the specified operation is executed in the code file;
and the calling module is used for calling the validity judging function to determine whether to execute the specified operation if a target identifier is detected when the code file is executed, wherein the target identifier is used for identifying the specified operation.
In the embodiment of the application, when a configuration file is converted into a code file, if an validity identifier exists in the configuration file, a validity judgment function is set in the converted code file according to the validity identifier, wherein the validity identifier is used for indicating whether a specified operation is executed in the configuration file, and the validity judgment function is used for judging whether the specified operation is executed in the code file; at this time, the validity judging function may be executed when the code file is compiled, and the function of the validity flag may be implemented in the code file. Then, when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, wherein the target identifier is used for identifying the specified operation; at this time, whether the specified operation is executed or not can be conveniently determined by calling the validity judgment function, so that the corresponding function in the corresponding configuration file can be efficiently and conveniently realized in the code file, that is, the function of the specified operation associated with the target identifier is activated or frozen through the validity identifier.
The terminal device 4 may be a vehicle-mounted device, a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of a terminal device 4 and does not constitute a limitation of terminal device 4 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing the computer program and other programs and data required by the terminal device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a terminal device, enables the terminal device to implement the steps in the above method embodiments when executed.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. . Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. An information processing method characterized by comprising:
when a configuration file is converted into a code file, if an effectiveness identifier exists in the configuration file, an effectiveness judgment function is set in the converted code file according to the effectiveness identifier, wherein the effectiveness identifier is used for indicating whether a specified operation is executed in the configuration file, and the effectiveness judgment function is used for judging whether the specified operation is executed in the code file;
and when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, wherein the target identifier is used for identifying the specified operation.
2. The information processing method according to claim 1, wherein a function name of the validity judgment function is a preset attribute name of the validity flag;
when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, including:
and when the code file is executed, if the target identification is detected, calling the validity judging function through the function name of the validity judging function so as to determine whether to execute the specified operation.
3. The information processing method according to claim 1, wherein the configuration file is an open test sequence exchange format OTX file, and the validity flag is a boolean variable.
4. The information processing method according to claim 3, wherein, when the code file is executed, if the target identifier is detected, the calling the validity judgment function to determine whether to execute the specified operation includes:
when the code file is executed, if a target identifier is detected, calling the validity judgment function to obtain judgment information returned by the validity judgment function, wherein the judgment information is a Boolean variable;
and determining whether to execute the specified operation according to the judgment information.
5. The information processing method according to claim 1, wherein the code file includes a source file and a header file;
when the configuration file is converted into the code file, if the validity identification exists in the configuration file, setting a validity judgment function in the converted code file according to the validity identification, wherein the validity judgment function comprises the following steps:
when a configuration file is converted into a code file, if an effectiveness identification exists in the configuration file, declaring the effectiveness judgment function in a header file obtained by conversion according to the effectiveness identification, and defining the function content of the effectiveness judgment function in a source file obtained by conversion;
when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation, including:
and when the code file is executed, if the target identification is detected, calling the validity judging function according to the function content of the validity judging function in the source file to determine whether to execute the specified operation.
6. The information processing method according to any one of claims 1 to 5, wherein, when the code file is executed, if a target identifier is detected, calling the validity judgment function to determine whether to execute the specified operation includes:
when the code file is executed, if the target identifier is detected, generating a conditional statement about the validity judging function and the target identifier, wherein a conditional part of the conditional statement is determined based on judging information returned by the validity judging function, and a part to be executed of the conditional statement is determined based on the specified operation;
executing the conditional statement to determine whether to perform the specified operation.
7. An information processing apparatus characterized by comprising:
the system comprises a setting module, a code file conversion module and a judging module, wherein the setting module is used for setting a validity judging function in a converted code file according to a validity identification when the configuration file is converted into the code file, the validity identification is used for indicating whether a specified operation is executed in the configuration file, and the validity judging function is used for judging whether the specified operation is executed in the code file;
and the calling module is used for calling the validity judging function to determine whether to execute the specified operation if a target identifier is detected when the code file is executed, wherein the target identifier is used for identifying the specified operation.
8. The information processing apparatus according to claim 7, wherein the calling module includes:
a generating unit, configured to generate a conditional statement regarding the validity judging function and the target identifier if the target identifier is detected when the code file is executed, where a conditional part of the conditional statement is determined based on judgment information returned by the validity judging function, and a part to be executed of the conditional statement is determined based on the specifying operation;
and the execution unit is used for executing the conditional statement to determine whether to execute the specified operation.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202011056901.4A 2020-09-30 2020-09-30 Information processing method, information processing device and terminal equipment Pending CN112181837A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011056901.4A CN112181837A (en) 2020-09-30 2020-09-30 Information processing method, information processing device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011056901.4A CN112181837A (en) 2020-09-30 2020-09-30 Information processing method, information processing device and terminal equipment

Publications (1)

Publication Number Publication Date
CN112181837A true CN112181837A (en) 2021-01-05

Family

ID=73947068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011056901.4A Pending CN112181837A (en) 2020-09-30 2020-09-30 Information processing method, information processing device and terminal equipment

Country Status (1)

Country Link
CN (1) CN112181837A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959210A (en) * 2018-07-09 2018-12-07 网易(杭州)网络有限公司 A kind of method and device of file conversion
US20200050556A1 (en) * 2018-08-10 2020-02-13 Micron Technology, Inc. Data validity tracking in a non-volatile memory
US20200073643A1 (en) * 2018-08-28 2020-03-05 Red Hat, Inc. Direct function call substitution using preprocessor
CN111142848A (en) * 2018-11-05 2020-05-12 深圳Tcl新技术有限公司 Software program compiling method, software program executing method and software program compiling device
CN111694572A (en) * 2020-05-27 2020-09-22 平安普惠企业管理有限公司 Code format conversion method, device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959210A (en) * 2018-07-09 2018-12-07 网易(杭州)网络有限公司 A kind of method and device of file conversion
US20200050556A1 (en) * 2018-08-10 2020-02-13 Micron Technology, Inc. Data validity tracking in a non-volatile memory
US20200073643A1 (en) * 2018-08-28 2020-03-05 Red Hat, Inc. Direct function call substitution using preprocessor
CN111142848A (en) * 2018-11-05 2020-05-12 深圳Tcl新技术有限公司 Software program compiling method, software program executing method and software program compiling device
CN111694572A (en) * 2020-05-27 2020-09-22 平安普惠企业管理有限公司 Code format conversion method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吕吕 王琥: "《C++进阶心法》", 30 April 2019 *
周兆熊: "Linux下配置文件读取操作流程及其C代码实现", 《HTTP://BLOG.CSDN.NET/ZHOUZHAOXIONG1227/ARTICLE/DETAILS/45563263#COMMENTS》 *

Similar Documents

Publication Publication Date Title
CN111552267B (en) Vehicle diagnosis method and device and vehicle diagnosis equipment
CN110502357B (en) Stack backtracking method, device, medium and equipment
CN108701044B (en) Interface switching method, system, equipment and computer readable storage medium
CN110865852B (en) Webpage component loading method and device, electronic equipment and storage medium
CN110601880A (en) Cloud platform, service processing method, command interface and computer equipment
CN111638983A (en) Interface calling method, interface calling device and terminal equipment
CN111767056A (en) Source code compiling method, executable file running method and terminal equipment
CN112631649A (en) Intelligent contract management method, device, terminal equipment and medium
CN110765067A (en) Data processing method and device
CN114579107A (en) Data processing method, device, equipment and medium
CN112147983A (en) Vehicle diagnosis method and device, electronic equipment and storage medium
CN114895935A (en) Method and device for flashing vehicle ECU, electronic equipment and storage medium
CN111709016B (en) Method and system for protecting basic medical insurance settlement data
CN110674050B (en) Memory out-of-range detection method and device, electronic equipment and computer storage medium
CN111414152B (en) Method, system, readable medium and electronic device for realizing business logic
CN116861040A (en) Method, device, equipment and storage medium for generating blood-edge relation diagram among scripts
CN112799763A (en) Function management method, management device, terminal equipment and readable storage medium
CN110188071B (en) Data processing method and device, electronic equipment and computer readable medium
CN112181837A (en) Information processing method, information processing device and terminal equipment
CN109324838B (en) Execution method and execution device of single chip microcomputer program and terminal
CN112379967B (en) Simulator detection method, device, equipment and medium
CN113760237A (en) Compiling address updating method and device, terminal equipment and readable storage medium
CN111796865B (en) Byte code file modification method, device, terminal equipment and medium
CN114219091A (en) Network model reasoning acceleration method, device, equipment and storage medium
CN112181839B (en) Information processing method, information processing device and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210105