CN110737412A - information output method, device, electronic equipment and storage medium - Google Patents

information output method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110737412A
CN110737412A CN201910945832.3A CN201910945832A CN110737412A CN 110737412 A CN110737412 A CN 110737412A CN 201910945832 A CN201910945832 A CN 201910945832A CN 110737412 A CN110737412 A CN 110737412A
Authority
CN
China
Prior art keywords
member variable
variable value
variables
type
printed
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
CN201910945832.3A
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910945832.3A priority Critical patent/CN110737412A/en
Publication of CN110737412A publication Critical patent/CN110737412A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1208Improving or facilitating administration, e.g. print management resulting in improved quality of the output result, e.g. print layout, colours, workflows, print preview
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1236Connection management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/1279Controller construction, e.g. aspects of the interface hardware

Abstract

Compared with the prior art, the technical scheme provided by the application has the advantages that the complex operation that in the prior art, each variable value can only be printed one by one is avoided, developers can conveniently print all the printing information for times through class member traversal, the printing effect is optimized, better development experience is provided for developers, the development efficiency is improved, and the development cost is reduced.

Description

information output method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to methods and apparatuses for outputting information, an electronic device, and a storage medium.
Background
When a developer develops software, the developer usually needs to print values of various variables or results to perform debugging, so as to determine whether a program is executed normally. Debugging printing most commonly uses a printing function of developing software, however, the printing function of the software does not meet the requirement of debugging, and much debugging information can be obtained by additional and complex repeated printing. Wherein the printing is information output (when the program runs).
Currently, software development systems allow customization of printing functions within classes, but developers do not generally order specific printing methods for all classes to improve efficiency.
Disclosure of Invention
In order to solve the above technical problem or at least partially solve the above technical problem, methods, apparatuses, electronic devices, and storage media for outputting information capable of simultaneously printing a plurality of information are provided.
, the present application provides a method of information output, comprising:
determining an object to be printed;
traversing all member variables of the object to be printed, and obtaining printing information of all the member variables, wherein the object to be printed at least comprises member variables;
and outputting the printing information of all the member variables.
Further , the method for outputting information, which traverses all member variables of the object to be printed and obtains the printing information of all member variables, includes:
determining the member variable value corresponding to each member variable;
and traversing according to the types of the member variable values to obtain the printing information of all the member variables.
Further , the traversing according to the type of the member variable value to obtain the printing information of all the member variables according to the method for information output, includes:
judging whether the member variable value of the object to be printed is a member variable value of a preset type, wherein the member variable value of the preset type comprises at least sub-member variables;
when the member variable value is a member variable value of a preset type, traversing child member variables of the member variable;
and traversing the member variables when the member variable values are not member variable values of a preset type, so as to obtain the printing information of all the member variables and the sub-member variables.
Further , the method for determining whether the member variable value of the object to be printed is a member variable value of a preset type, includes:
judging whether the type of the member variable value is a system type;
when the member variable value is a system class, judging whether the member variable value is an th member variable value, wherein the type of the th member variable value is an array or a dictionary;
when the member variable value is the th member variable value, obtaining the child member variables of the member variable, and judging whether the member variable values of the child member variables comprise member variable values of preset types or not;
when the member variable value is not the th member variable value, determining whether the member variable value is a preset type of member variable value.
In a second aspect, the present application provides an apparatus for information output, comprising:
the object determining module is used for determining an object to be printed;
the traversal module is used for traversing all member variables of the object to be printed and obtaining all printing information;
and the printing module is used for outputting all the printing information.
Further , the traversing module comprises:
the variable value submodule is used for determining the member variable value corresponding to each member variable;
and the printing information submodule is used for traversing according to the types of the member variable values to obtain the printing information of all the member variables.
Further , the print information submodule, as in the previous information output apparatus, includes:
an th judging unit for judging whether the member variable value of the object to be printed is a member variable value of a preset type, wherein the member variable value of the preset type includes at least child member variables;
a traversal unit for traversing child member variables of the member variables when the member variable values are member variable values of a preset type;
and the printing information unit is used for traversing the member variables when the member variable values are not the member variable values of the preset type, so that the printing information of all the member variables and the sub-member variables is obtained.
, the traversing module comprises the determining unit which comprises:
, a judgment subunit, configured to judge whether the type of the member variable value is a system class;
the second judgment subunit is used for judging whether the member variable value is the th member variable value when the member variable value is the system class, wherein the type of the th member variable value is an array or a dictionary;
a third judging subunit, configured to, when the member variable value is an th member variable value, obtain a child member variable of the th member variable value, and judge whether the member variable value of the child member variable includes a model class member variable value;
a fourth judging subunit, configured to judge whether the member variable value includes a model class member variable value when the member variable value is not the th member variable value.
In a third aspect, the application provides kinds of electronic devices, which include a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor, when executing the computer program, performing the method of any of of aspect .
In a fourth aspect, the present application provides non-transitory computer readable storage media storing computer instructions that cause the computer to perform the method of any of aspect .
Compared with the prior art, the technical scheme provided by the embodiment of the application has the advantages that the complex operation that in the prior art, each variable value can only be printed one by one is avoided, developers can conveniently print all the printing information for times through class member traversal, the printing effect is optimized, better development experience is provided for developers, the development efficiency is improved, and the development cost is reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification , illustrate embodiments consistent with the invention and together with the description , serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flow chart of methods for outputting information according to embodiments of the present disclosure;
FIG. 2 is a flowchart illustrating the method of step S2 of FIG. 1 in embodiments;
FIG. 3 is a flowchart illustrating the method of step S22 of FIG. 2 according to embodiments;
fig. 4 is a schematic structural diagram of functional modules of an information output apparatus according to an embodiment of the present application;
FIG. 5 is a functional block diagram of an embodiment of module 2 of FIG. 4;
fig. 6 is a schematic structural diagram of functional modules of electronic devices according to an embodiment of the present application;
fig. 7 is a flowchart illustrating a method in application examples of the present application.
Detailed Description
For purposes of making the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be described in detail and completely with reference to the drawings of the embodiments of the present application, and it is obvious that the described embodiments are partial embodiments of of the present application, rather than all embodiments.
Fig. 1 is a method for outputting kinds of information according to an embodiment of the present application, including the following steps S1 to S3:
s1, determining an object to be printed;
specifically, the object to be printed is determined according to the name of the object to be printed, and the object to be printed is a selected variable to be printed, as shown in , the object to be printed includes at least member variables, and in step , each member variable of the object to be printed may further include a sub-member variable, and the member variable or the sub-member variable in the object to be printed may be expanded in any tree structure according to actual conditions;
s2, traversing all member variables of the object to be printed and obtaining printing information of all the member variables, wherein the printing information of the member variables is member variable names and member variable values in the member variables, specifically, the member variables are different due to different types of each object to be printed, for example, when the variables are schools, the corresponding member variables may include school names, class number, student number and teacher number, and when the variables are students, the corresponding member variables may include names, sexes and ages, and the member variables of each object can change according to actual requirements;
s3, outputting printing information of all member variables;
that is, the variable values of the respective member variables are subjected to information output.
For example, the printing of custom student information class objects in the prior art is as follows:
(11db)po stu
<Student:0x60000368e2e0>
from the above, only the type and the memory address value of the variable can be printed out by using the system printing method in the prior art, and the developer is concerned with all the attribute values of the internal variable. If the system method is adopted for printing, the printing needs to be repeated for a plurality of times, and the effects are as follows:
(11db)po stu
<Student:0x60000368e2e0>
(11db)po stu.name
Jack
(11db)po stu.age
13
(11db)po stu.gender
Male
(11db)po stu.phone
010-12345676543
specifically, feasible implementation methods are that traversal is performed under an OC language (Objective-C language) environment as an example, after the type of the object to be printed is taken out, member variable names (such as age and name in the foregoing embodiment) of all member variables in the taken-out type can be taken as key, then the value of the corresponding attribute of the object is taken out through a value ForKey method, and the value of a pointer is printed.
In view of the above problem, according to the method provided by the embodiment, the printing results are as follows:
(11db)po[stu test_log]
<Student:0x60000059a100>
{
“_age”=13;
“_gender”=male;
“_name”=Jack;
“_phone”=“010-12345676543”;
}
the method can also be used for printing after the printing information of each member variable is obtained one by one, and after the printing information of all the member variables is finally obtained through traversal, the member variables are called from the memory and printed by the system .
As shown in fig. 2, in embodiments, as the aforementioned method for outputting information, the step S2. traverses all member variables of the object to be printed and obtains the printing information of all member variables, including the steps S21 and S22 as follows:
s21, determining member variable values corresponding to the member variables;
, after determining the member variables, the corresponding member variable values (i.e. the attribute values of the member variables) can be determined, and in the present application, the child member variables of the member variables can be obtained through the member variables, or can be obtained by using the member variable values as objects;
and S22, traversing according to the types of the member variable values to obtain the printing information of all the member variables.
That is, firstly, the scheme should determine whether the types of the member variable values of the classes are preset types, that is, whether the classes of the preset types include other member variables, if not, the preset types can be directly printed, meanwhile, different traversal methods are adopted due to different types of the member variable values, for example, when the member variable values are self-defined type member variable values, the system does not have a type description interface for outputting the member variable values, and only can obtain corresponding names and addresses, and therefore cannot directly output the specific printing information of each member variable value, and when the system does not respond to self-defined type data such as events, and the system has a corresponding type description interface, and therefore can directly output the specific printing information of each member variable value, and in conclusion, if the same traversal methods are adopted no matter what the types of the member variable values are, the system cannot obtain the internal attribute values when traversing and printing by using some member variable values as objects, and still can only obtain the types and memory address values of the member variable values as objects.
In , the method for outputting information as described above traverses all member variables of the object to be printed, including:
acquiring the type of an object to be printed;
that is, the method of acquiring the member variables of the object to be printed needs to be selected specifically according to the type of the object to be printed;
the method comprises the steps of judging whether the type of an object to be printed is a composite type, specifically, when member variables in the object to be printed are class (class) objects, the object to be printed is the composite type, wherein when the object to be printed is the composite type, generally comprises or a plurality of member variables, and each member variable also has a corresponding sub-member variable.
When the type of the object to be printed is a compound type, each member variable is used as the object to be printed according to the method in the steps S1 to S3, and each member variable is subjected to steps of traversal, so that each member variable is subjected to steps of traversal, because the member variable may also have sub-member variables when the object is the compound type, and therefore, if the object is not subjected to steps of traversal, only the type and the memory address information of the member variable can be obtained, therefore, based on the reasons, the member variable is also subjected to steps of traversal until all attribute values, namely the printing information of all the member variables, are obtained;
specifically, the reason why the composite type judgment is performed is that if printing is directly performed, there are cases as follows:
when class objects are created, there are again variables for the student class and the teacher class in the class.
(11db)po[cls test_log]
<Class_:0x6000016d44e0>
{
“_student”=“<Student:0x6000018c1680>”;
“_teacher”=“<Teacher:0x6000018c1980>”;
}
As can be seen from the above, the printing result only indicates the type and the memory address of the member variable (i.e. the student and the teacher), but does not list the specific attribute information of the student and the teacher; it is therefore necessary to determine whether or not the object to be printed is of a complex type whose structure is more complicated than that of a simple type.
In , as the method for outputting information described above, the step S22 is traversed according to the type of the member variable value to obtain the printing information of all the member variables, including:
s221, judging whether the member variable value of the object to be printed is a member variable value of a preset type, wherein the member variable value of the preset type comprises at least sub-member variables;
specifically, the preset type is a type which cannot be printed through a system printing interface; the preset type comprises a model type (namely a self-defined model type);
taking the preset type as a model class as an example, that is, before printing, determining whether member variable values of member variables of an object to be printed are of the model class; for example, in the foregoing embodiments: the teacher, the student and the class are all objects with custom Model types (namely, the variable values of the teacher and the student are of Model types);
specifically, the implementation methods for determining whether the type of the variable value of the current variable to be printed is the custom Model type may be, for example, rules determined by OC language, in which a custom type directly inherited from an NSObject class is determined as the custom Model type, or a class name not beginning with NS or __ NS is regarded as the Model class (the rules may be extended, and are not described herein again);
s222, when the member variable value is a member variable value of a preset type, traversing child member variables of the member variable;
specifically, taking the type of the member variable value as a model class as an example, traversing to obtain all the child member variables of the member variable value when the member variable value is the member variable value of the model class (namely, the member variable value of a preset type), continuously judging whether the variable value of the child member variable is still the member variable value of the model class after the child member variable is obtained, continuously obtaining the child member variables (marked as child member variables) included in the child member variables if the variable value type of the child member variable is still the member variable value of the model class, and obtaining the printing information of the member variable according to the variable value of the final member variable after the recursive traversal until the variable value type of the final member variable is not the model class;
if the judgment result is that the model class member variable value is included, the value is obtained, the steps are repeatedly executed according to the method, and the depth traversal is realized recursively;
s223, traversing the member variables when the member variable values are not member variable values of preset types, so as to obtain printing information of all the member variables and the sub-member variables;
in step S222, if the result is no, it indicates that the variable value of the final member variable obtained in the last traversals is not of a preset type such as a model type, and thus the printing information of the member variable and the child member variable can be taken for direct printing.
In , the method for outputting information as described above, the determining whether the member variable value of the object to be printed is a member variable value of a preset type includes:
judging whether the type of the member variable value is a system class, wherein the system class is types in the preset type;
that is, before judging whether the type of the member variable value is the model class, it is necessary to judge in advance whether the member variable value is the system class, so as to traverse by using the traversal method of the model class member variable value when judging that the member variable value is not the system class, or traverse by using the traversal method of the th member variable value of the system class when judging that the member variable value is the system class, thereby realizing that all the member variable values of the member variable are obtained by an accurate method and corresponding printing information is obtained;
specifically, the implementation methods for determining whether the member variable value is the system type may be:
taking OC language judgment rules as an example, when the class name of a variable value is NS, __ NS, UI and CA, the variable value is a system type (only exemplary examples are taken here, the rule can be expanded), the dictionary type judgment is NSDictionary class and subclass thereof, and the array type judgment is NSArray class and subclass thereof;
when the member variable value is a system class, judging whether the member variable value is an th member variable value of which the type is an array or a dictionary;
specifically, the array and the dictionary are data structures, and other data structure information can be stored; therefore, after the member variable value is judged to be the system type, whether the member variable value is an array or a dictionary is judged, namely whether the member variable value is the data structure type is judged; if the member variable value is of a system type and does not belong to a dictionary or array type (such as an interface, a response event and the like), the information of the data structure is not contained, only the information corresponding to the member variable value needs to be directly printed, and the data structure does not need to be traversed;
when the member variable value is the th member variable value, obtaining a child member variable of the th member variable value, and judging whether the member variable value of the child member variable comprises a model class member variable value;
when the member variable value is not the th member variable value, determining whether the member variable value includes a model class member variable value.
If the type of the member variable value is a data structure (i.e. an array or a dictionary), times of traversal is needed to be performed on the member variable value, so as to obtain the th member variable value corresponding to the child member variable, for example, if the object is a student and is an array, the member variable of the object includes student 1, student 2 and the like, after the child member variables such as student 1, student 2 and the like are obtained through traversal, the child member variable value is obtained according to each child member variable, then whether the type of the child member variable value is the model class is judged, if yes, the child member variable value is used as the object, the judgment of the step S221 is performed again, and if not, the printing information of the child member variable is read.
In addition, on the basis of judging the custom model type and the system type, other custom processing modes can be added to expand the printing mode of the application; however, any printing method that involves the implementation of the above steps of the present application is within the scope of the present application.
As shown in fig. 4, according to another embodiments of the present application, there are also provided kinds of information output apparatuses, including:
an object determination module 1 for determining an object to be printed;
the traversal module 2 is used for traversing all member variables of the object to be printed and obtaining the printing information of all the member variables, wherein the object to be printed at least comprises member variables;
and the printing module 3 is used for outputting the printing information of all the member variables.
Specifically, the specific process of implementing the functions of each module in the apparatus according to the embodiment of the present invention may refer to the related description in the method embodiment, and is not described herein again.
As shown in fig. 5, in embodiments, the traversing module 2 includes, as the aforementioned means for outputting information:
a variable value submodule 21 for determining a member variable value corresponding to each member variable;
and the printing information submodule 22 is used for traversing according to the types of the member variable values to obtain the printing information of all the member variables.
Specifically, the specific process of implementing the functions of each module in the apparatus according to the embodiment of the present invention may refer to the related description in the method embodiment, and is not described herein again.
In , the print information submodule 22 includes, as the aforementioned information output apparatus:
an th judging unit for judging whether the member variable value of the object to be printed is a member variable value of a preset type, wherein the member variable value of the preset type includes at least child member variables;
a traversal unit for traversing child member variables of the member variables when the member variable values are member variable values of a preset type;
and the printing information unit is used for traversing the member variables when the member variable values are not the member variable values of the preset type, so that the printing information of all the member variables and the sub-member variables is obtained.
Specifically, the specific process of implementing the functions of each module in the apparatus according to the embodiment of the present invention may refer to the related description in the method embodiment, and is not described herein again.
In , the traversing module comprises the determining unit which comprises:
, a judgment subunit, configured to judge whether the type of the member variable value is a system class;
the second judgment subunit is used for judging whether the member variable value is the th member variable value when the member variable value is the system class, wherein the type of the th member variable value is an array or a dictionary;
a third judging subunit, configured to, when the member variable value is an th member variable value, obtain a child member variable of the th member variable value, and judge whether the member variable value of the child member variable includes a member variable value of a preset type;
a fourth judging subunit, configured to judge whether the member variable value includes a member variable value of a preset type when the member variable value is not the th member variable value.
Specifically, the specific process of implementing the functions of each module in the apparatus according to the embodiment of the present invention may refer to the related description in the method embodiment, and is not described herein again.
As shown in fig. 6, kinds of electronic devices are further provided according to another embodiments of the present application, including as shown in fig. 6, the electronic devices may include a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504, wherein the processor 1501, the communication interface 1502, and the memory 1503 complete communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to implement the steps of the above-described method embodiments when executing the program stored in the memory 1503.
The bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. the bus may be divided into an address bus, a data bus, a control bus, etc. for convenience of illustration, only bold lines are used to indicate the bus, but not only buses or types of buses.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include Random Access Memory (RAM) or Non-Volatile Memory (NVM), such as at least disk memories, and optionally at least Memory devices located remotely from the processor.
The Processor may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Array (FPGA), or other Programmable logic device, discrete , or a transistor logic device, discrete hardware components.
The present application also provides non-transitory computer readable storage media storing computer instructions that cause a computer to perform the steps of the above-described method embodiments.
It should be noted that, for the above-mentioned apparatus, electronic device and non-transitory computer-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is simple, and for the relevant points, refer to the partial description of the method embodiments.
Application example:
as shown in fig. 7, examples of application of the method of the present application are provided:
step 1: the print object is acquired, assuming that the print object is a class.
Step 2: and acquiring the type and the member variable name of the object from the object.
And step 3: and acquiring the member variable value of the object through the member variable name.
And 4, discussing member variable values, if the variable values are of the self-defined Model type, taking the variable values as object inputs to repeat the step 1, if the variable values are of the array type or the dictionary type, traversing all th variable values of the numerical values or the dictionaries corresponding to the variable values, judging whether the th variable values are of the self-defined Model type, if so, taking the th variable values as the objects to repeat the step 1, otherwise, reading the printing information corresponding to the th variable values, and if the variable values are of the system type, directly reading the printing information of the variable values.
And 5: and (4) printing all the printing information of the member variables summarized in the step (4), and obtaining an optimized printing result as shown in the following:
Figure BDA0002224089530000161
Figure BDA0002224089530000171
compared with a system method, the printing method provided by the patent can be used for printing the attribute values of all member variables in the object in a more detailed and comprehensive manner, and provides convenience for development and debugging work of developers.
It should be noted that, in this document, relational terms such as "" and "second", and the like, are only used to distinguish entities or operations from another entities or operations, without necessarily requiring or implying any actual relationship or order between such entities or operations, furthermore, the terms "comprise", "include", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises the series of elements does not include only those elements but also other elements not expressly listed or inherent to such process, method, article, or apparatus.
It will thus be appreciated that the present invention is not limited to the embodiments illustrated herein but is to be accorded the widest scope consistent with the principles and novel features as herein claimed.

Claims (10)

1, A method for information output, comprising:
determining an object to be printed, wherein the object to be printed at least comprises member variables;
traversing all member variables of the object to be printed, and obtaining printing information of all the member variables;
and outputting the printing information of all the member variables.
2. The method for outputting information according to claim 1, wherein traversing all member variables of the object to be printed and obtaining printing information of all member variables comprises:
determining the member variable value corresponding to each member variable;
and traversing according to the types of the member variable values to obtain the printing information of all the member variables.
3. The method for outputting information according to claim 2, wherein the traversing according to the type of the member variable value to obtain the printing information of all the member variables comprises:
judging whether the member variable value of the object to be printed is a member variable value of a preset type, wherein the member variable value of the preset type comprises at least sub-member variables;
when the member variable value is a member variable value of a preset type, traversing child member variables of the member variable;
and traversing the member variables when the member variable values are not member variable values of a preset type, so as to obtain the printing information of all the member variables and the sub-member variables.
4. The information output method according to claim 3, wherein the judging whether the member variable value of the object to be printed is a member variable value of a preset type includes:
judging whether the type of the member variable value is a system type;
when the member variable value is a system class, judging whether the member variable value is an th member variable value, wherein the type of the th member variable value is an array or a dictionary;
when the member variable value is the th member variable value, obtaining the child member variables of the member variable, and judging whether the member variable values of the child member variables comprise member variable values of preset types or not;
when the member variable value is not the th member variable value, determining whether the member variable value is a preset type of member variable value.
An apparatus for outputting information of , comprising:
the object determining module is used for determining an object to be printed;
the traversal module is used for traversing all member variables of the object to be printed and obtaining all printing information, wherein the object to be printed at least comprises member variables;
and the printing module is used for outputting the printing information of all the member variables.
6. The information output apparatus according to claim 5, wherein the traversal module comprises:
the variable value submodule is used for determining the member variable value corresponding to each member variable;
and the printing information submodule is used for traversing according to the types of the member variable values to obtain the printing information of all the member variables.
7. The information output apparatus according to claim 6, wherein the print information submodule includes:
an th judging unit for judging whether the member variable value of the object to be printed is a member variable value of a preset type, wherein the member variable value of the preset type includes at least child member variables;
a traversal unit for traversing child member variables of the member variables when the member variable values are member variable values of a preset type;
and the printing information unit is used for traversing the member variables when the member variable values are not the member variable values of the preset type, so that the printing information of all the member variables and the sub-member variables is obtained.
8. The information output apparatus according to claim 7, wherein the th judging unit includes:
, a judgment subunit, configured to judge whether the type of the member variable value is a system class;
the second judgment subunit is used for judging whether the member variable value is the th member variable value when the member variable value is the system class, wherein the type of the th member variable value is an array or a dictionary;
a third judging subunit, configured to, when the member variable value is an th member variable value, obtain a child member variable of the th member variable value, and judge whether the member variable value of the child member variable includes a member variable value of a preset type;
a fourth judging subunit, configured to judge whether the member variable value includes a member variable value of a preset type when the member variable value is not the th member variable value.
9, kinds of electronic equipment, which is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor, when executing the computer program, implementing the method of any of claims 1-4.
A non-transitory computer readable storage medium , wherein the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform the method of any of claims 1-4 to .
CN201910945832.3A 2019-09-30 2019-09-30 information output method, device, electronic equipment and storage medium Pending CN110737412A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910945832.3A CN110737412A (en) 2019-09-30 2019-09-30 information output method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910945832.3A CN110737412A (en) 2019-09-30 2019-09-30 information output method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110737412A true CN110737412A (en) 2020-01-31

Family

ID=69268576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910945832.3A Pending CN110737412A (en) 2019-09-30 2019-09-30 information output method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110737412A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080007779A1 (en) * 2003-02-11 2008-01-10 International Business Machines Corporation Method and system for generating executable code for formatting and printing complex data structures
CN105760161A (en) * 2016-02-04 2016-07-13 网易(杭州)网络有限公司 Attribute analysis method and device of Python
CN107015798A (en) * 2017-03-13 2017-08-04 深圳市鑫君特智能医疗器械有限公司 A kind of method and system of monitoring program variate-value

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080007779A1 (en) * 2003-02-11 2008-01-10 International Business Machines Corporation Method and system for generating executable code for formatting and printing complex data structures
CN105760161A (en) * 2016-02-04 2016-07-13 网易(杭州)网络有限公司 Attribute analysis method and device of Python
CN107015798A (en) * 2017-03-13 2017-08-04 深圳市鑫君特智能医疗器械有限公司 A kind of method and system of monitoring program variate-value

Similar Documents

Publication Publication Date Title
CN107622080B (en) Data processing method and equipment
US10997332B1 (en) System and method for computing electrical over-stress of devices associated with an electronic design
CN110990276A (en) Automatic testing method and device for interface field and storage medium
CN112083897A (en) Signal declaration system, method, equipment and medium in digital logic design
KR100873885B1 (en) Design Verification Device, Design Verification Method and CAD System
US6117179A (en) High voltage electrical rule check program
CN109542785B (en) Invalid bug determination method and device
CN114091383A (en) Test sequence generation method, device and system and related equipment
CN112560372B (en) Chip prototype verification method, device, equipment and medium
CN114201397A (en) Interface test modeling method and device, electronic equipment and storage medium
CN110737412A (en) information output method, device, electronic equipment and storage medium
CN112052157A (en) Test message construction method, device and system
JP3249040B2 (en) Scan test equipment
CN114780326B (en) Cross-platform calibration test method, device and equipment
CN114492295A (en) Bus checking method and device
CN111444456B (en) Style editing method and device and electronic equipment
JP2760682B2 (en) Hardware design support system
CN112464636B (en) Constraint file comparison method and device, electronic equipment and storage medium
CN114265780A (en) Method, system, equipment and storage medium for testing report system
CN110851665B (en) Calibration information extraction method and device, electronic equipment and storage medium
CN113360402A (en) Test method, electronic device, chip and storage medium
CN113988043B (en) Hardware bill of material management method and device, computer equipment and storage medium
CN110765008A (en) Data processing method and device
CN110991130A (en) Method for checking standard unit time sequence library by circuit simulation
CN114189880B (en) Method and device for generating occupation file for base station test

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