CN112181839A - 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
CN112181839A
CN112181839A CN202011061443.3A CN202011061443A CN112181839A CN 112181839 A CN112181839 A CN 112181839A CN 202011061443 A CN202011061443 A CN 202011061443A CN 112181839 A CN112181839 A CN 112181839A
Authority
CN
China
Prior art keywords
file
information
import
name
specified
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.)
Granted
Application number
CN202011061443.3A
Other languages
Chinese (zh)
Other versions
CN112181839B (en
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 CN202011061443.3A priority Critical patent/CN112181839B/en
Publication of CN112181839A publication Critical patent/CN112181839A/en
Application granted granted Critical
Publication of CN112181839B publication Critical patent/CN112181839B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

An information processing method, an information processing apparatus and a terminal device. The application provides an information processing method, which comprises the following steps: when a configuration file is converted into a code file, if the configuration file is detected to contain appointed node information, adding import indication information into the code file, wherein the appointed node information contains first path information and an appointed name of the import file, and the import indication information associates the appointed name with the first path information; when the code file is executed, if request information of specified data of the import file is acquired, an access request is generated according to the request information and the specified name; and accessing the import file according to the access request and the import indication information. By the method and the device, the problem that in the configuration file, the designated node information cannot be directly applied to the code file due to the fact that the setting mode of the designated node for importing other files is different from the setting mode of the code file, and therefore importing of other files cannot be achieved 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, data of other files may be imported by declaring a designated node. The information architecture and description mode of the designated node are different from those in the code file, so that the information of the designated node cannot be directly applied in the code file, and the import of other files cannot be conveniently realized in the code file.
Disclosure of Invention
In view of this, an embodiment of the present application provides an information processing method, an information processing apparatus, and a terminal device, which can solve the problem that in a configuration file of a type such as OTX, a setting manner such as an information architecture and a description manner of a designated node for importing another file is different from a setting of a code file, so that information of the designated node cannot be directly applied in the code file, and thus, importing of another file cannot be conveniently 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 the configuration file is detected to contain designated node information, adding import indication information into the code file, wherein the designated node information contains first path information and a designated name of an import file associated with the configuration file, the import indication information contains the first path information and the designated name, and the import indication information is used for associating the designated name with the first path information in the code file;
when the code file is executed, if request information of specified data of the import file is acquired, an access request is generated according to the request information and the specified name;
and accessing the import file according to the access request and the import indication information.
Optionally, the information processing method further includes:
when the configuration file is converted into the code file, adding a namespace into the code file, wherein the namespace is used for representing second path information of the configuration file, and importing data of the configuration file into other configuration files through the namespace.
Optionally, the code file includes a source file and a header file;
when the configuration file is converted into the code file, adding a namespace in the code file, including:
when the configuration file is converted into the code file, the namespace is stated in the header file obtained by conversion, and the namespace is defined in the source file obtained by conversion, so that the namespace can represent the second path information.
Optionally, the name space includes a first name space and a second name space, the first name space is determined according to the package attribute name of the package in which the configuration file is located, the second name space is determined according to the file name of the configuration file, the second name space is defined in the first name space, and the second path information is determined based on the package attribute name of the package in which the configuration file is located and the file name of the configuration file.
Optionally, the code file includes a source file and a header file;
when the configuration file is converted into the code file, if it is detected that the configuration file contains the specified node information, adding import indication information in the code file, including:
when the configuration file is converted into the code file, if the configuration file is detected to contain the designated node information, the import indication information is added into the source file.
Optionally, the import indication information includes a preset statement and pointing information, the preset statement includes the first path information, and the pointing information is used for pointing the specified name to the first path information in the code file;
when the code file is executed, if request information requesting to use the specified data of the import file is acquired, generating an access request according to the request information and the specified name, including:
when the code file is executed, if request information of specified data requesting to use the import file is acquired, generating an access request carrying a data name of the specified data and the specified name;
the accessing the import file according to the access request and the import indication information includes:
and accessing the import file according to the specified name, the pointing information and the preset statement in the access request, and acquiring the specified data from the import file according to the data name.
Optionally, the first path information includes a package attribute name of a package in which the import file is located and a file name of the import file, and the specified name is obtained according to an alias of the import file.
A second aspect of an embodiment of the present application provides an information processing apparatus, including:
an adding module, configured to, when a configuration file is converted into a code file, add import indication information in the code file if it is detected that the configuration file includes specified node information, where the specified node information includes first path information and a specified name of an import file associated with the configuration file, the import indication information includes the first path information and a specified name, and the import indication information is used to associate the specified name with the first path information in the code file;
the request module is used for generating an access request according to the request information and the specified name if the request information of the specified data of the import file is acquired when the code file is executed;
and the access module is used for accessing the imported file according to the access request and the import indication information.
Optionally, the information processing apparatus further includes:
and the second adding module is used for adding a namespace into the code file when the configuration file is converted into the code file, wherein the namespace is used for representing second path information of the configuration file, so that data of the configuration file is imported into other configuration files through the namespace.
Optionally, the code file includes a source file and a header file;
the second adding module is specifically configured to:
when the configuration file is converted into the code file, the namespace is stated in the header file obtained by conversion, and the namespace is defined in the source file obtained by conversion, so that the namespace can represent the second path information.
Optionally, the second path information includes a package attribute name of a package in which the configuration file is located and a file name of the configuration file, the namespace includes a first namespace and a second namespace, the first namespace is determined according to the package attribute name of the package in which the configuration file is located, the second namespace is determined according to the file name of the configuration file, and the second namespace is defined in the first namespace.
Optionally, the code file includes a source file and a header file;
the adding module is specifically configured to:
when the configuration file is converted into the code file, if the configuration file is detected to contain the designated node information, the import indication information is added into the source file.
Optionally, the import indication information includes a preset statement and pointing information, the preset statement includes the first path information, and the pointing information is used for pointing the specified name to the first path information in the code file;
the request module is specifically configured to:
when the code file is executed, if request information of specified data requesting to use the import file is acquired, generating an access request carrying a data name of the specified data and the specified name;
the access module is specifically configured to:
and accessing the import file according to the specified name, the pointing information and the preset statement in the access request, and acquiring the specified data from the import file according to the data name.
Optionally, the first path information includes a package attribute name of a package in which the import file is located and a file name of the import file, and the specified name is obtained according to an alias of the import file.
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 it is detected that the configuration file contains designated node information, adding import indication information into the code file, wherein the designated node information contains first path information and a designated name of an import file associated with the configuration file, the import indication information contains the first path information and a designated name, and the import indication information is used for associating the designated name with the first path information in the code file; at this time, the import instruction information may describe, in the converted code file, first path information and a specified name in the specified node information by the import instruction information, and may associate the specified name with the first path information. Then, when the code file is executed, if request information requesting to use the specified data of the import file is acquired, an access request is generated according to the request information and the specified name, and then the import file is accessed according to the access request and the import indication information; at this time, since the import instruction information may associate the designated name with the first path information, the designated name may be associated with the first path information, that is, after the request information is acquired, an access request may be generated and provided through the request information and the designated name, and the import file is accessed according to the access request and the import instruction information, so that the import of the information of the import file is conveniently implemented in the code file.
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 of an implementation of an information processing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of an information processing apparatus according to a second embodiment of the present application;
fig. 3 is a schematic diagram of a terminal device provided in the third 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 inventors have found that in OTX-like type configuration files, data of other files can be imported by declaring a designated node. The information architecture and description mode of the designated node are different from those in the code file, so that the information of the designated node cannot be directly applied in the code file, and the import of other files cannot be conveniently realized in the code file.
According to the method and the device for importing the file information, the access request can be generated and provided by requesting the request information and the specified name of the specified data of the import file in the code file, and the import file can be accessed according to the access request and the import indication information, so that the import of the information of the import file can be conveniently realized in the code file.
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 it is detected that the configuration file contains designated node information, adding import indication information into the code file, wherein the designated node information contains first path information and a designated name of an import file associated with the configuration file, the import indication information contains the first path information and a designated name, and the import indication information is used for associating the designated name with the first path information 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.
The file type of the import file may be various. The file type of the import file may be the same as the configuration file, for example, if the configuration file is an OTX file, the type of the import file may also be an OTX file. Of course, in some cases, the file type of the import file may also be different from the configuration file, for example, the configuration file is an OTX file, and the type of the import file may be a text file.
In this embodiment of the application, the designated node information may include first path information and a designated name of an import file associated with the configuration file. Wherein the specific form of the designated node information may be determined based on the configuration mode of the configuration file. For example, when the configuration file is detected to include information such as a name of a designated node or data associated with the designated node, it may be determined that the configuration file is detected to include the information of the designated node.
For example, if the configuration file is an OTX file, the designated node may be an imort node for the OTX file, and the designated node information may be information associated with the imort node. The data of the imported file such as other OTX files can be imported by declaring the Import node in the OTX file, so that the purpose of data multiplexing and sharing is achieved.
The Import node specifies the package path of the OTX file by the package attribute name, that is, specifies the name of the package in which the OTX file is located, and specifies the file name of the Import file by the document attribute value. In addition, an alias of the import file may also be specified by the prefix attribute value.
An application example of the setting mode of the Import node of the OTX file is given below.
<?xml version="1.0"encoding="UTF-8"?>
<otx id="Otx202004091036188699238"name="procedureCall"package="package">
<imports>
<import prefix="imp1"package="package"document="validity"/>
<import prefix="imp2"package="package"document="validity1"/>
<import prefix="imp3"package="package"document="signature"/>
</imports>
<procedures>
<procedure id="Procedure202004091037401429246"name="p2"visibility="PRIVATE"implements="imp3:sig2"validFor="imp1:v2">
<realisation>
<flow>
<return id="Return202004091054220119253">
</return>
</flow>
</realisation>
</procedure>
</procedures>
</otx>
The specific form of the lead-in indication information may be various. For example, the import indication information may include a mapping relation of a specified name to the first path information; or, the import indication information may include a preset statement and pointing information, where the preset statement includes the first path information, and the pointing information is used to point the specified name to the first path information in the code file. Of course, the lead-in indication information may be represented in other forms.
Wherein the specified naming can be set according to a scene. For example, in some scenarios, if the file name of the import file is too long, a name with a shorter length may be set as an alias of the file name of the import file for easy reference, and the alias is used as the specified name.
In this embodiment of the application, the import indication information may be in the code file obtained by conversion, and may be used to record the first path information and the designated name in the designated node information through the import indication information, and may associate the designated name with the first path information. Since the import indication information may associate the designated name with the first path information, it may be associated to the first path information through the designated name.
In some embodiments, the code files include a source file and a header file;
when the configuration file is converted into the code file, if it is detected that the configuration file contains the specified node information, adding import indication information in the code file, including:
when the configuration file is converted into the code file, if the configuration file is detected to contain the designated node information, the import indication information is added into the source file.
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.
Since the import instruction information does not include a function, macro, or other variable newly defined with respect to the configuration file, when the configuration file is converted into a code file, if it is detected that the configuration file includes the designated node information, the import instruction information is added to the code file.
Step S102, when the code file is executed, if request information requesting to use the specified data of the import file is obtained, an access request is generated according to the request information and the specified name.
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, since the import indication information may associate the designated name with the first path information, the first path information may be associated with the designated name. Therefore, the access request can be generated according to the request information and the specified name, and a large amount of information for searching the import file, such as the first path information, does not need to be carried in the access request, so that the information processing amount is simplified, and the processing efficiency is improved.
Step S103, accessing the import file according to the access request and the import indication information.
After the access request is obtained, the first path information to the import file may be obtained according to the import indication information and the specified name in the access request, so as to access the import file, and the required data may be obtained according to the request information in the access request.
As can be seen, in the embodiment of the present application, because the import indication information may associate the designated name with the first path information, the designated name may be associated with the first path information, that is, after the request information is acquired, an access request may be generated and provided through the request information and the designated name, and the import file is accessed according to the access request and the import indication information, so that the import of the information of the import file is conveniently implemented in the code file.
In some embodiments, the information processing method further includes:
when the configuration file is converted into the code file, adding a namespace into the code file, wherein the namespace is used for representing second path information of the configuration file, and importing data of the configuration file into other configuration files through the namespace.
In the embodiment of the present application, the Namespace (Namespace) is also referred to as a Namespace. The namespace may determine the scope of the corresponding element to avoid element naming conflicts. Therefore, in the embodiment of the present application, when the configuration file is converted into the code file, a namespace may be added to the code file. So as to avoid the second path information in the name space from conflicting with the first path information in the import indication information and the names of the information such as the designated names.
And the namespace added in the code file can be used for representing the second path information of the configuration file, so that when other configuration files need to Import the data of the configuration file, specific node information such as the Import node information of the configuration file can be generated according to the second path information in the namespace, and the data of the configuration file can be imported into other configuration files.
In some embodiments, the code files include a source file and a header file;
when the configuration file is converted into the code file, adding a namespace in the code file, including:
when the configuration file is converted into the code file, the namespace is stated in the header file obtained by conversion, and the namespace is defined in the source file obtained by conversion, so that the namespace can represent the second path information.
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.
In this embodiment of the application, the namespace is declared on the header file obtained by conversion, and the namespace is defined in the source file obtained by conversion, so that the namespace can represent the second path information, and other configuration files can import the data of the configuration files according to the namespace.
In some embodiments, the second path information includes a package attribute name of a package in which the configuration file is located and a file name of the configuration file, the namespace includes a first namespace and a second namespace, the first namespace is determined according to the package attribute name of the package in which the configuration file is located, the second namespace is determined according to the file name of the configuration file, and the second namespace is defined in the first namespace.
In this embodiment, the Package (Package) may correspond to a space. For example, in some scenarios, a folder may be considered a package, and each package may include some elements, e.g., may include files, or classes, etc. The package property name may be determined according to a setting manner of the configuration file.
In this embodiment, the second namespace is defined within the first namespace, and thus, the second namespace may be considered to be nested in the first namespace. At this time, the relationship between the first namespace and the second namespace may correspond to the relationship between the package in which the configuration file is located and the configuration file, and thus, the second path information of the configuration file may be indicated through the first namespace and the second namespace.
In some embodiments, the import indication information includes a preset statement and pointing information, the preset statement includes the first path information, and the pointing information is used to point the specified name to the first path information in the code file;
when the code file is executed, if request information requesting to use the specified data of the import file is acquired, generating an access request according to the request information and the specified name, including:
when the code file is executed, if request information of specified data requesting to use the import file is acquired, generating an access request carrying a data name of the specified data and the specified name;
the accessing the import file according to the access request and the import indication information includes:
and accessing the import file according to the specified name, the pointing information and the preset statement in the access request, and acquiring the specified data from the import file according to the data name.
In the embodiment of the present application, for example, the preset statement may be an include statement. The preset statement may include the first path information, and the designated name is pointed to the first path information by the pointing information, so that when an access request is subsequently generated and made, the first path of the import file can be determined by the pointing information and the preset statement only by carrying the data name of the designated data and the designated name, so as to access the import file, and the designated data is obtained from the import file according to the data name.
For example, if the configuration file is an OTX file, the designated node may be an imort node for the OTX file, and the designated node information may be information associated with the imort node. The Import node specifies the package path of the OTX file by the package attribute name, that is, specifies the name of the package in which the OTX file is located, and specifies the file name of the Import file by the document attribute name. In addition, an alias of the import file may also be specified by the prefix attribute name.
At this time, the first path information includes a package attribute name of the import file and a document attribute name of the import file, and the pointing information is used to point the prefix attribute name to the first path information, that is, an information set pointing to the package attribute name of the import file and the document attribute name of the import file.
If request information requesting to use the specified data of the import file is acquired, an access request carrying the data name of the specified data and the prefix attribute name is generated, that is, the first path information of the import file is determined according to the access request and the direction information, and the import file is accessed, so that the specified data is acquired from the import file according to the data name.
In some embodiments, the first path information includes a package attribute name of a package in which the import file is located and a file name of the import file, and the specified name is obtained according to an alias of the import file.
In the embodiment of the application, the designated name is obtained according to the alias of the import file, a name with a short length can be set as the alias of the file name of the import file according to the scene requirement, and the alias is used as the designated name, so that subsequent reference is facilitated, the processing flow is simplified, and the processing efficiency is improved.
In the embodiment of the application, when a configuration file is converted into a code file, if it is detected that the configuration file contains designated node information, adding import indication information into the code file, wherein the designated node information contains first path information and a designated name of an import file associated with the configuration file, the import indication information contains the first path information and a designated name, and the import indication information is used for associating the designated name with the first path information in the code file; at this time, the import instruction information may describe, in the converted code file, first path information and a specified name in the specified node information by the import instruction information, and may associate the specified name with the first path information. Then, when the code file is executed, if request information requesting to use the specified data of the import file is acquired, an access request is generated according to the request information and the specified name, and then the import file is accessed according to the access request and the import indication information; at this time, since the import instruction information may associate the designated name with the first path information, the designated name may be associated with the first path information, that is, after the request information is acquired, an access request may be generated and provided through the request information and the designated name, and the import file is accessed according to the access request and the import instruction information, so that the import of the information of the import file is conveniently implemented in the code file.
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. 2 is a schematic diagram of an information processing apparatus according to a second 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 2 includes:
an adding module 201, configured to, when a configuration file is converted into a code file, add import indication information in the code file if it is detected that the configuration file includes specified node information, where the specified node information includes first path information and a specified name of an import file associated with the configuration file, the import indication information includes the first path information and a specified name, and the import indication information is used to associate the specified name with the first path information in the code file;
a request module 202, configured to, when the code file is executed, if request information requesting to use specified data of the import file is obtained, generate an access request according to the request information and the specified name;
and the access module 203 is configured to access the import file according to the access request and the import indication information.
Optionally, the information processing apparatus further includes:
and the second adding module is used for adding a namespace into the code file when the configuration file is converted into the code file, wherein the namespace is used for representing second path information of the configuration file, so that data of the configuration file is imported into other configuration files through the namespace.
Optionally, the code file includes a source file and a header file;
the second adding module is specifically configured to:
when the configuration file is converted into the code file, the namespace is stated in the header file obtained by conversion, and the namespace is defined in the source file obtained by conversion, so that the namespace can represent the second path information.
Optionally, the second path information includes a package attribute name of a package in which the configuration file is located and a file name of the configuration file, the namespace includes a first namespace and a second namespace, the first namespace is determined according to the package attribute name of the package in which the configuration file is located, the second namespace is determined according to the file name of the configuration file, and the second namespace is defined in the first namespace.
Optionally, the code file includes a source file and a header file;
the adding module 201 is specifically configured to:
when the configuration file is converted into the code file, if the configuration file is detected to contain the designated node information, the import indication information is added into the source file.
Optionally, the import indication information includes a preset statement and pointing information, the preset statement includes the first path information, and the pointing information is used for pointing the specified name to the first path information in the code file;
the request module 202 is specifically configured to:
when the code file is executed, if request information of specified data requesting to use the import file is acquired, generating an access request carrying a data name of the specified data and the specified name;
the access module 203 is specifically configured to:
and accessing the import file according to the specified name, the pointing information and the preset statement in the access request, and acquiring the specified data from the import file according to the data name.
Optionally, the first path information includes a package attribute name of a package in which the import file is located and a file name of the import file, and the specified name is obtained according to an alias of the import file.
In the embodiment of the application, when a configuration file is converted into a code file, if it is detected that the configuration file contains designated node information, adding import indication information into the code file, wherein the designated node information contains first path information and a designated name of an import file associated with the configuration file, the import indication information contains the first path information and a designated name, and the import indication information is used for associating the designated name with the first path information in the code file; at this time, the import instruction information may describe, in the converted code file, first path information and a specified name in the specified node information by the import instruction information, and may associate the specified name with the first path information. Then, when the code file is executed, if request information requesting to use the specified data of the import file is acquired, an access request is generated according to the request information and the specified name, and then the import file is accessed according to the access request and the import indication information; at this time, since the import instruction information may associate the designated name with the first path information, the designated name may be associated with the first path information, that is, after the request information is acquired, an access request may be generated and provided through the request information and the designated name, and the import file is accessed according to the access request and the import instruction information, so that the import of the information of the import file is conveniently implemented in the code file.
Fig. 3 is a schematic diagram of a terminal device provided in the third embodiment of the present application. As shown in fig. 3, the terminal device 3 of this embodiment includes: a processor 30, a memory 31 and a computer program 32 stored in said memory 31 and executable on said processor 30. The processor 30, when executing the computer program 32, implements the steps in the various information processing method embodiments described above, such as the steps 101 to 103 shown in fig. 1. Alternatively, the processor 30, when executing the computer program 32, implements the functions of each module/unit in each device embodiment described above, for example, the functions of the modules 201 to 203 shown in fig. 2.
Illustratively, the computer program 32 may be partitioned into one or more modules/units that are stored in the memory 31 and executed by the processor 30 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 32 in the terminal device 3. For example, the computer program 32 may be divided into an adding module, a requesting module, and an accessing module, and the specific functions of the modules are as follows:
an adding module, configured to, when a configuration file is converted into a code file, add import indication information in the code file if it is detected that the configuration file includes specified node information, where the specified node information includes first path information and a specified name of an import file associated with the configuration file, the import indication information includes the first path information and a specified name, and the import indication information is used to associate the specified name with the first path information in the code file;
the request module is used for generating an access request according to the request information and the specified name if the request information of the specified data of the import file is acquired when the code file is executed;
and the access module is used for accessing the imported file according to the access request and the import indication information.
In the embodiment of the application, when a configuration file is converted into a code file, if it is detected that the configuration file contains designated node information, adding import indication information into the code file, wherein the designated node information contains first path information and a designated name of an import file associated with the configuration file, the import indication information contains the first path information and a designated name, and the import indication information is used for associating the designated name with the first path information in the code file; at this time, the import instruction information may describe, in the converted code file, first path information and a specified name in the specified node information by the import instruction information, and may associate the specified name with the first path information. Then, when the code file is executed, if request information requesting to use the specified data of the import file is acquired, an access request is generated according to the request information and the specified name, and then the import file is accessed according to the access request and the import indication information; at this time, since the import instruction information may associate the designated name with the first path information, the designated name may be associated with the first path information, that is, after the request information is acquired, an access request may be generated and provided through the request information and the designated name, and the import file is accessed according to the access request and the import instruction information, so that the import of the information of the import file is conveniently implemented in the code file.
The terminal device 3 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 30, a memory 31. It will be understood by those skilled in the art that fig. 3 is only an example of the terminal device 3, and does not constitute a limitation to the terminal device 3, and may include more or less components than those shown, or combine some components, or different components, for example, the terminal device may also include an input-output device, a network access device, a bus, etc.
The Processor 30 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 31 may be an internal storage unit of the terminal device 3, such as a hard disk or a memory of the terminal device 3. The memory 31 may also be an external storage device of the terminal device 3, 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 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the terminal device 3. The memory 31 is used for storing the computer program and other programs and data required by the terminal device. The memory 31 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 the configuration file is detected to contain designated node information, adding import indication information into the code file, wherein the designated node information contains first path information and a designated name of an import file associated with the configuration file, the import indication information contains the first path information and the designated name, and the import indication information is used for associating the designated name with the first path information in the code file;
when the code file is executed, if request information of specified data of the import file is acquired, an access request is generated according to the request information and the specified name;
and accessing the import file according to the access request and the import indication information.
2. The information processing method of claim 1, further comprising:
when the configuration file is converted into the code file, adding a namespace into the code file, wherein the namespace is used for representing second path information of the configuration file, and importing data of the configuration file into other configuration files through the namespace.
3. The information processing method according to claim 2, wherein the code file includes a source file and a header file;
when the configuration file is converted into the code file, adding a namespace in the code file, including:
when the configuration file is converted into the code file, the namespace is stated in the header file obtained by conversion, and the namespace is defined in the source file obtained by conversion, so that the namespace can represent the second path information.
4. The information processing method according to claim 2, wherein the second path information includes a package attribute name of a package in which the configuration file is located and a file name of the configuration file, the namespace includes a first namespace and a second namespace, the first namespace is determined according to the package attribute name of the package in which the configuration file is located, the second namespace is determined according to the file name of the configuration file, and the second namespace is defined in the first namespace.
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 it is detected that the configuration file contains the specified node information, adding import indication information in the code file, including:
when the configuration file is converted into the code file, if the configuration file is detected to contain the designated node information, the import indication information is added into the source file.
6. The information processing method according to any one of claims 1 to 5, wherein the import instruction information includes a preset statement and pointing information, the preset statement including the first path information, the pointing information being used to point the specified name to the first path information in the code file;
when the code file is executed, if request information requesting to use the specified data of the import file is acquired, generating an access request according to the request information and the specified name, including:
when the code file is executed, if request information of specified data requesting to use the import file is acquired, generating an access request carrying a data name of the specified data and the specified name;
the accessing the import file according to the access request and the import indication information includes:
and accessing the import file according to the specified name, the pointing information and the preset statement in the access request, and acquiring the specified data from the import file according to the data name.
7. The information processing method according to claim 6, wherein the first path information includes a package attribute name of a package in which the import file is located and a file name of the import file, and the specified name is obtained from an alias of the import file.
8. An information processing apparatus characterized by comprising:
an adding module, configured to, when a configuration file is converted into a code file, add import indication information in the code file if it is detected that the configuration file includes specified node information, where the specified node information includes first path information and a specified name of an import file associated with the configuration file, the import indication information includes the first path information and a specified name, and the import indication information is used to associate the specified name with the first path information in the code file;
the request module is used for generating an access request according to the request information and the specified name if the request information of the specified data of the import file is acquired when the code file is executed;
and the access module is used for accessing the imported file according to the access request and the import indication information.
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 information processing method according to any one of claims 1 to 7 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 information processing method according to any one of claims 1 to 7.
CN202011061443.3A 2020-09-30 2020-09-30 Information processing method, information processing device and terminal equipment Active CN112181839B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011061443.3A CN112181839B (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
CN202011061443.3A CN112181839B (en) 2020-09-30 2020-09-30 Information processing method, information processing device and terminal equipment

Publications (2)

Publication Number Publication Date
CN112181839A true CN112181839A (en) 2021-01-05
CN112181839B CN112181839B (en) 2023-10-10

Family

ID=73948444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011061443.3A Active CN112181839B (en) 2020-09-30 2020-09-30 Information processing method, information processing device and terminal equipment

Country Status (1)

Country Link
CN (1) CN112181839B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030101434A1 (en) * 2001-11-29 2003-05-29 Microsoft Corporation System and method for identifying namespaces
CN101771762A (en) * 2009-01-06 2010-07-07 北京邮电大学 Method and system for dynamically loading services in service system
CN110308908A (en) * 2018-03-20 2019-10-08 北京小米移动软件有限公司 The generation of the configuration file of application and methods of exhibiting, device and the storage medium of application page

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030101434A1 (en) * 2001-11-29 2003-05-29 Microsoft Corporation System and method for identifying namespaces
CN101771762A (en) * 2009-01-06 2010-07-07 北京邮电大学 Method and system for dynamically loading services in service system
CN110308908A (en) * 2018-03-20 2019-10-08 北京小米移动软件有限公司 The generation of the configuration file of application and methods of exhibiting, device and the storage medium of application page

Also Published As

Publication number Publication date
CN112181839B (en) 2023-10-10

Similar Documents

Publication Publication Date Title
CN110601880B (en) Cloud platform, service processing method, command interface and computer equipment
CN111552267B (en) Vehicle diagnosis method and device and vehicle diagnosis equipment
CN110162544A (en) Heterogeneous data source data capture method and device
WO2008156969A1 (en) Discoscript: a simplified distributed computing scripting language
CN111324396A (en) Block chain intelligent contract execution method, device and equipment
CN112181924A (en) File conversion method, device, equipment and medium
CN112147983B (en) Vehicle diagnosis method and device, electronic equipment and storage medium
Pedersen et al. hts-nim: scripting high-performance genomic analyses
CN110765067A (en) Data processing method and device
CN113961919A (en) Malicious software detection method and device
CN107766036B (en) Module construction method and device and terminal equipment
CN111767056A (en) Source code compiling method, executable file running method and terminal equipment
CN112083709A (en) Vehicle diagnosis method, system, terminal device and storage medium
CN109033456B (en) Condition query method and device, electronic equipment and storage medium
US9064042B2 (en) Instrumenting computer program code by merging template and target code methods
CN112181839B (en) Information processing method, information processing device and terminal equipment
CN109324838B (en) Execution method and execution device of single chip microcomputer program and terminal
CN111796865B (en) Byte code file modification method, device, terminal equipment and medium
CN114218175A (en) Resource cross-platform sharing method and device, terminal equipment and storage medium
CN114416057A (en) Project code packaging method and device, terminal equipment and storage medium
CN112181837A (en) Information processing method, information processing device and terminal equipment
CN108629003B (en) Content loading method and device
CN112905381A (en) Method, device, equipment and medium for acquiring stack frame information in call stack
CN112949258A (en) Data processing method and device, electronic equipment and storage medium
CN110764995A (en) Method, device, medium and electronic equipment for detecting file access abnormity

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
GR01 Patent grant
GR01 Patent grant