CN109062797B - Method and device for generating information - Google Patents
Method and device for generating information Download PDFInfo
- Publication number
- CN109062797B CN109062797B CN201810836790.5A CN201810836790A CN109062797B CN 109062797 B CN109062797 B CN 109062797B CN 201810836790 A CN201810836790 A CN 201810836790A CN 109062797 B CN109062797 B CN 109062797B
- Authority
- CN
- China
- Prior art keywords
- file
- template
- performance
- data
- tool
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000012360 testing method Methods 0.000 claims abstract description 76
- 238000001514 detection method Methods 0.000 claims abstract description 72
- 238000013144 data compression Methods 0.000 claims abstract description 45
- 238000011161 development Methods 0.000 claims abstract description 34
- 230000006870 function Effects 0.000 claims abstract description 26
- 238000012545 processing Methods 0.000 claims abstract description 26
- 238000011056 performance test Methods 0.000 claims description 36
- 238000012544 monitoring process Methods 0.000 claims description 27
- 238000004458 analytical method Methods 0.000 claims description 24
- 238000007906 compression Methods 0.000 claims description 17
- 230000006835 compression Effects 0.000 claims description 17
- 238000003860 storage Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 7
- 238000000605 extraction Methods 0.000 claims description 6
- 230000004044 response Effects 0.000 claims description 6
- 238000006243 chemical reaction Methods 0.000 claims description 5
- 230000003416 augmentation Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 12
- 238000004891 communication Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 4
- 230000006837 decompression Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000013480 data collection Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000007405 data analysis Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the application discloses a method and a device for generating information. One specific embodiment of the method for generating information includes: acquiring a test data compression packet generated by a detection debugging tool in the iOS integrated development tool; extracting key data files from the files decompressed by the test data compression packets, wherein the key data files comprise archived data files; converting the archived data file by adopting an inverse archiving function of the object-oriented programming language of the expansion C to obtain a memory object file; and generating a performance data file meeting the preset requirement based on the memory object file. The embodiment improves the processing efficiency of generating the performance data file.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating information.
Background
It is a common and important task to perform performance testing on a piece of software and collect performance testing data (e.g., CPU, memory, network, power consumption usage, etc.) of the software. However, due to the closed characteristic of the iOS operating system, it is difficult to perform performance test data acquisition on the iOS operating system.
At present, the prior art generally adopts the following two schemes for performing performance testing on an iOS system: the first scheme is as follows: developing a test data acquisition and analysis tool by self; this solution must rely on some special interfaces provided by the operating system, which are few and often very low-level. Scheme II: test data is collected and analyzed directly based on instrumentation detection debugging tools in the iOS integrated development tool. Instruments test and debug tools do provide a very rich set of collected data, however Instruments test and debug tools only provide a natural human-oriented interface.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating information.
In a first aspect, an embodiment of the present application provides a method for generating information, including: acquiring a test data compression packet generated by a detection debugging tool in the iOS integrated development tool; extracting key data files from the files decompressed by the test data compression packets, wherein the key data files comprise archived data files; converting the archived data file by adopting an inverse archiving function of the object-oriented programming language of the expansion C to obtain a memory object file; and generating a performance data file meeting the preset requirement based on the memory object file.
In some embodiments, obtaining a test data compression package generated by a detection debugging tool in the iOS integrated development tool comprises: loading a tested application and a performance test template by adopting a detection debugging tool in the iOS integrated development tool; adopting a performance testing template to carry out performance pressure detection on the application to be tested; and responding to the stop performance pressure detection, and acquiring the test data compression packet generated by the detection debugging tool.
In some embodiments, obtaining a test data compression package generated by a detection debugging tool in the iOS integrated development tool comprises: acquiring a trace file compression package generated by an Instruments detection debugging tool by adopting at least one of the following performance test templates: a Network template, a Leak template, an Allocation template and a VMTraker template.
In some embodiments, converting the archived data file using an inverse archive function of the object-oriented programming language of extension C to obtain the memory object file includes: for each performance test template, presenting error prompt information in response to the fact that no analysis class corresponding to the template exists in the object-oriented programming language of the expansion C; adding an analysis class corresponding to the template based on user operation; analyzing the template by adopting an analysis class corresponding to the template in an object-oriented programming language of the expansion C in the class method, and adding a plurality of lines of codes; and analyzing the data based on the breakpoints of the multiple lines of codes and the user debugging information to obtain a memory object file.
In some embodiments, the key data file further comprises: a database file; and generating a performance data file meeting the preset requirement based on the memory object file comprises the following steps: counting network information based on the database file and preset network table data; and generating a performance data file meeting the preset requirement based on the memory object file and the network information.
In some embodiments, the method further comprises: and analyzing and processing the performance data file by adopting a performance data analyzing and processing tool to generate a performance test report.
In some embodiments, the method further comprises: and generating a monitoring event by adopting a performance data monitoring tool based on the monitoring index and the result of analyzing and processing the performance data file.
In a second aspect, an embodiment of the present application provides an apparatus for generating information, including: a compressed packet acquisition unit configured to acquire a test data compressed packet generated by a detection debugging tool in the iOS integrated development tool; an archive file extraction unit configured to extract key data files from the file after decompression of the test data compression package, the key data files including archive data files; the object file conversion unit is configured to convert the archived data file by adopting an inverse archive function of an object-oriented programming language of the expansion C to obtain a memory object file; and the performance file generation unit is configured to generate a performance data file meeting the preset requirement based on the memory object file.
In some embodiments, the compressed packet acquisition unit includes: the application template loading subunit is configured to load the application to be tested and the performance testing template by adopting a detection debugging tool in the iOS integrated development tool; the performance pressure detection subunit is configured to perform performance pressure detection on the application to be tested by adopting the performance test template; and the compressed packet acquisition subunit is configured to acquire the test data compressed packet generated by the detection debugging tool in response to the performance pressure detection stopping.
In some embodiments, the compressed packet acquisition unit is further configured to: acquiring a trace file compression package generated by an Instruments detection debugging tool by adopting at least one of the following performance test templates: a Network template, a Leak template, an Allocation template and a VMTraker template.
In some embodiments, the object file converting unit includes: the error prompt subunit is configured to respond to the fact that no analysis class corresponding to each performance test template exists in the object-oriented programming language of the expansion C and present error prompt information; a class adding subunit configured to add, based on a user operation, an analysis class corresponding to the template; a code adding subunit, configured to analyze the template in the class device by adopting the analysis class corresponding to the template in the object-oriented programming language of the extension C, and add a plurality of lines of codes; and the memory object subunit is configured to analyze data based on the breakpoints of the multiple lines of codes and the user debugging information to obtain a memory object file.
In some embodiments, the key data file in the archived file extraction unit further includes: a database file; and the performance file generating unit is further configured to: counting network information based on the database file and preset network table data; and generating a performance data file meeting the preset requirement based on the memory object file and the network information.
In some embodiments, the apparatus further comprises: and the test report generating unit is configured to adopt the performance data analyzing and processing tool to analyze and process the performance data file and generate a performance test report.
In some embodiments, the apparatus further comprises: and the monitoring event generating unit is configured to adopt the performance data monitoring tool to generate the monitoring event based on the monitoring index and the result of analyzing and processing the performance data file.
In a third aspect, an embodiment of the present application provides an apparatus, including: one or more processors; storage means for storing one or more programs; when executed by one or more processors, cause the one or more processors to implement a method as any one of above.
In a fourth aspect, embodiments of the present application provide a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements a method as any of the above.
According to the method and the device for generating the information, firstly, a test data compression packet generated by a detection debugging tool in an iOS integrated development tool is obtained; then, extracting key data files from the files decompressed by the test data compression packets, wherein the key data files comprise archived data files; then, converting the archived data file by adopting an inverse archive function of an object-oriented programming language (OC) of the expansion C to obtain a memory object file; and finally, generating a performance data file meeting the preset requirement based on the memory object file. In the process, the key data file for performance test is automatically extracted from the file after the test data compression packet is decompressed, the key data file comprises the archived data file, then the archived data file is automatically converted into the memory object file by adopting an OC (open circuit) reverse archiving function, and finally the performance data file meeting the preset requirement is generated based on the memory object file, so that the iOS performance test data generated by the detection and debugging tool can be automatically processed in batches, the processing efficiency of generating the performance data file is improved, and the workload of manually processing the data is reduced.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a schematic flow chart diagram illustrating one embodiment of a method of generating information according to the present application;
FIG. 3 is a schematic diagram of an application scenario according to an embodiment of the present application;
FIG. 4 is a schematic flow chart diagram illustrating yet another embodiment of a method of generating information according to the present application;
FIG. 5 is a schematic block diagram of an embodiment of an apparatus for generating information according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the method of generating information or the apparatus for generating information of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and servers 105, 106. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the servers 105, 106. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user 110 may use the terminal devices 101, 102, 103 to interact with the servers 105, 106 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a search engine application, a shopping application, an instant messaging tool, a mailbox client, social platform software, a video playing application, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio layer iii, mpeg compression standard Audio layer 3), MP4 players (Moving Picture Experts Group Audio layer IV, mpeg compression standard Audio layer 4), laptop and desktop computers, and the like.
The servers 105, 106 may be servers providing various services, such as background servers providing support for the terminal devices 101, 102, 103. The background server can analyze, store or calculate the data submitted by the terminal and push the analysis, storage or calculation result to the terminal device.
It should be noted that, in practice, the method for generating information provided in the embodiment of the present application is generally executed by the servers 105 and 106, and accordingly, the apparatus for generating information is generally disposed in the servers 105 and 106. However, when the performance of the terminal device can satisfy the execution condition of the method or the setting condition of the device, the method for generating information provided in the embodiment of the present application can also be executed by the terminal devices 101, 102, 103, and the apparatus for generating information can also be provided in the terminal devices 101, 102, 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method of generating information in accordance with the present application is shown. The method for generating information comprises the following steps:
step 201, obtaining a test data compression packet generated by a detection debugging tool in the iOS integrated development tool.
In this embodiment, an electronic device (for example, a server or a terminal shown in fig. 1) on which the above-described method for generating information operates may perform detection and debugging on an iOS application using a detection and debugging tool in an integrated development tool of the iOS to obtain a test data compression package. The integrated development tool is used for developing an application program of the iOS, and can be X-code, for example. The detection and debugging tool is used for detecting and debugging an application program of the iOS developed by the integrated development tool, and may be, for example, Instruments. The test data compression packet may be a compression packet generated by detecting a compression format supported by the debug tool. For example, the format of the test data compression package may be a zip format file.
In a specific example of this embodiment, obtaining the test data compression packet generated by the detection debugging tool in the iOS integrated development tool may include: loading a tested application and a performance test template by adopting a detection debugging tool in the iOS integrated development tool; adopting a performance testing template to carry out performance pressure detection on the application to be tested; and responding to the stop performance pressure detection, and acquiring the test data compression packet generated by the detection debugging tool.
In a specific example of obtaining a test data compression packet generated by a detection and debugging tool in an iOS integrated development tool, a trace file compression packet generated by an Instruments detection and debugging tool using at least one of the following performance test templates may be obtained: a Network (trace TCP/IP and UDP/IP connections) template, a Leak template, an Allocation of memory template, and a vmtrailer (virtual machine trace) template.
It should be understood that, for the performance testing template in the Instruments detection debugging tool, the user may select the template as required, and the template is not necessarily limited to the above-mentioned exemplary templates, for example, the obtained trace file compression package may also be a compression package of any one of the following templates: activity Monitor templates, Core Animation templates, Energy Log templates, and the like. After the test data compression packet is decompressed, the trace file can be obtained according to the data collection type specified when the data packet is generated.
Step 202, extracting key data files from the files decompressed by the test data compression packets, wherein the key data files comprise archived data files.
In this embodiment, the electronic device may decompress the test data compression packet, and extract, from the decompressed file, a key data file required to generate a performance data file meeting preset requirements. The extracted key data files mainly include archived data files. For example, the trace file stores archive data files, typically run, zip, archiver files under the directory of archive data, share data.
Step 203, the archived data file is converted by using the inverse archive function of the object-oriented programming language of the expansion C to obtain the memory object file.
In this embodiment, since the detection and debugging tool is implemented by using the object serialization capability of an object-oriented programming language (OC) extended with C, the electronic device may convert the archived data file by using an anti-archive function of OC to obtain the memory object file. That is, the electronic device may perform a reverse archiving operation on the trace file according to the existing trace file memory model by using a reverse archiving function according to the written test program, that is, reversely deducing the field type of the archived data file through the deserialization capability of Objective-C. Then, the meaning of most data can be deduced by combining the data (information such as error prompt, the value of the field when the error occurs, the known value of the field and the like) displayed on the interface of the detection debugging tool and the mode of repeatedly testing the contrast difference.
In some optional implementation manners of this embodiment, converting the archived data file by using an inverse archive function of the object-oriented programming language of the extension C to obtain the memory object file includes: for each performance test template, presenting error prompt information in response to the fact that no analysis class corresponding to the template exists in the object-oriented programming language of the expansion C; adding an analysis class corresponding to the template based on user operation; analyzing the template by adopting an analysis class corresponding to the template in an object-oriented programming language of the expansion C in the class method, and adding a plurality of lines of codes; and analyzing the data based on the breakpoints of the multiple lines of codes and the user debugging information to obtain a memory object file.
In a specific example of this implementation, the archived data file may be parsed using an nsonarchiever parsing class carried by the iOS-NSCoding protocol. When a new template is analyzed, the NSUnderiver searches for a class corresponding to the template to perform data analysis, if the class corresponding to the template is not found, corresponding error information is printed out in a debugging window, and then the class corresponding to the template is added according to the prompt information, wherein the class inherits NSObject < NScoding >. After the analysis class of the template is added, a system decoder is used for analyzing in a class method initwithCoder, a plurality of lines of id var are added [ decoder decode object ], data are analyzed according to breakpoints and debugging information, and a memory object file is obtained.
The meaning of the field of interest in the resolution of the template is described below in conjunction with a specific performance test template.
Taking the Leak template as an example, the Leak template can check memory leakage, and analyzing the data of the template can obtain memory Allocation statistics and memory address records of all objects, which can be generally used together with Allocation, so that two templates are generally analyzed simultaneously during analysis. The most important focus fields in the Leak & Allocation project procedure are as follows:
(1) the following (in order of priority) for All Heap & Anoymous VM of Allocation Statistics:
Categopry
PerSItent By.. (size)
PerSItent (number)
Total Bytes (size)
Transient (number)
(2) The Leak Object, the address itself has no significance.
Taking the vmtrailer template as an example, the vmtrailer template may be used to monitor the virtual memory, and as with other templates, the compressed packet file is parsed first to obtain the run. There are 30 entries for trace and 74 for _ DATA for the entire VMTrker.
(1) Vmtrailer focus field as follows:
region Map
Type ═ ALL (global)
MALLOC_LARGE
MALLOC_NANO
MALLOC_SMALL
MALLOC_TINY
Several of the above types Resient Size, Dirty Size, Virtual Size;
(2) vmtrailer has analyzed the completed field description:
a.0 is classification
Dirty: marking (marking a certain block of memory as dirty);
c, path: the location of the APP in the handset;
index, matching in 2 classes, and internal management;
e. if type is null and path is null, then the record is that of a stack, although stack is very special:
firstly, the calculation method of pages is relatively complex;
the value of its Resident Size field is actually the value of VirtualSize;
object _ id 6b6153bb, this is mapped file.
Step 204, based on the memory object file, generating a performance data file meeting the preset requirement.
In this embodiment, based on the memory object file obtained in step 203, a performance data file meeting the preset requirement may be generated. For example, the required data can be extracted from the memory object according to the project requirement and output as a performance data file in the csv format.
An exemplary application scenario of the method of generating information of the present application is described below in conjunction with fig. 3.
As shown in fig. 3, fig. 3 shows a schematic flow chart of an application scenario of a method of generating information according to the present application.
As shown in fig. 3, a method 300 of generating information operates in an electronic device 310 and may include:
firstly, acquiring a test data compression packet 302 generated by an Instrument test tool 301;
then, extracting key data files 304 from the files 303 decompressed by the test data compression package 302, wherein the key data files 304 comprise archive data files 305;
then, the archived data file 305 is converted by using an OC inverse archive function 306 to obtain a memory object file 307;
finally, based on the memory object file 307, a performance data file 308 meeting the preset requirement is generated.
It should be understood that the application scenario of the method for generating information shown in fig. 3 is only an exemplary description of the method for generating information, and does not represent a limitation on the method. For example, the steps shown in fig. 3 above may be implemented in further detail.
The method for generating information according to the embodiment of the application may obtain a test data compression packet generated by a detection and debugging tool in an iOS integrated development tool, may then extract a key data file from a file after decompression of the test data compression packet, where the key data file includes a filing data file, may then convert the filing data file by using an inverse filing function of an object-oriented programming language of an extended C to obtain a memory object file, and may finally generate a performance data file meeting a preset requirement based on the memory object file. In the process, the filing data file extracted from the test data compression package can be converted based on the inverse filing function of the unextended C object-oriented programming language, the iOS performance test data generated by the detection debugging tool is processed in batch, the processing efficiency of generating the performance data file is improved, and the workload of manually processing the data is reduced.
Referring to FIG. 4, a flow diagram of one embodiment of a method of generating information is shown, according to the present application.
As shown in fig. 4, a process 400 of the method for determining a route for planning based on unverified roads of the present embodiment may include the following steps:
in step 401, a test data compression packet generated by a detection debugging tool in the iOS integrated development tool is obtained.
In this embodiment, an electronic device (for example, a server or a terminal shown in fig. 1) on which the above-described method for generating information operates may perform detection and debugging on an iOS application using a detection and debugging tool in an integrated development tool of the iOS to obtain a test data compression package. The integrated development tool is used for developing an application program of the iOS, and can be X-code, for example. The detection and debugging tool is used for detecting and debugging an application program of the iOS developed by the integrated development tool, and may be, for example, Instruments. The test data compression packet may be a compression packet generated by detecting a compression format supported by the debug tool. For example, the format of the test data compression package may be a zip format file.
In a specific example of this embodiment, obtaining the test data compression packet generated by the detection debugging tool in the iOS integrated development tool may include: loading a tested application and a performance test template by adopting a detection debugging tool in the iOS integrated development tool; adopting a performance testing template to carry out performance pressure detection on the application to be tested; and responding to the stop performance pressure detection, and acquiring the test data compression packet generated by the detection debugging tool.
In a specific example of obtaining a test data compression packet generated by a detection and debugging tool in an iOS integrated development tool, a trace file compression packet generated by an Instruments detection and debugging tool using at least one of the following performance test templates may be obtained: a Network (trace TCP/IP and UDP/IP connections) template, a Leak template, an Allocation of memory template, and a vmtrailer (virtual machine trace) template.
It should be understood that, for the performance testing template in the Instruments detection debugging tool, the user may select the template as required, and the template is not necessarily limited to the above-mentioned exemplary templates, for example, the obtained trace file compression package may also be a compression package of any one of the following templates: activity Monitor templates, Core Animation templates, Energy Log templates, and the like. After the test data compression packet is decompressed, the trace file can be obtained according to the data collection type specified when the data packet is generated.
In step 402, key data files are extracted from the decompressed files of the test data compression package, wherein the key data files include archived data files and database files.
In this embodiment, the electronic device may decompress the test data compression packet, and extract, from the decompressed file, a key data file required to generate a performance data file meeting preset requirements. The extracted key data files mainly comprise archived data files and database files. For example, taking a Network template as an example, what is stored in the trace file is typically an archive _ data and share _ data directory, run. In addition, a database file is also included under the track 1.run file directory.
File parsing of a database typically comprises the following steps: firstly, opening a data file, acquiring the number of tables of a current database and the name of each table, traversing each table according to the table name, and reading data in the tables. Then, the conversion of the IP address is carried out: since the network address read from the database table is 16 bytes of binary data, it needs to be converted into a readable IP address: the form of the port. From left to right, bytes 1-2 are the network transport protocol type (TCP/UDP), bytes 3-4 are the ports, bytes 5-8 are the address of IPV4, and bytes 9-16 are all typically 0. Bytes 1-2 are 1002 for the TCP protocol and 1c1e for the UDP protocol.
In step 403, the archived data file is converted by using the inverse archive function of the object-oriented programming language of the extension C to obtain the memory object file.
In this embodiment, since the detection and debugging tool is implemented by using the object serialization capability of an object-oriented programming language (OC) extended with C, the electronic device may convert the archived data file by using an anti-archive function of OC to obtain the memory object file. That is, the electronic device may reversely deduce the field type of the archived data file through the deserialization capability of Objective-C, and may deduce the meaning of most data by combining the data displayed on the interface of the detection debugging tool and the way of repeatedly testing contrast differences.
In step 404, network information is counted based on the database file and the preset network table data.
In this embodiment, network table data with a preset table name is searched from the parsed database file, and network data in the network table data is counted to obtain network information.
In a specific example of this embodiment, taking a Network template as an example, integrating data of the same Network request includes: after the database file is read and saved through the steps, two important tables for really saving the network data are Connnection and ConnectionAgrrerate. The connection table stores network data information sent from address a to address B, and has a serial number as a primary key. The connectionagregate stores more detailed network information for each interaction, such as the total number of packets sent, the total number of packets received, etc., again with the serial numeber as the primary key. Therefore, through the two tables, all network data sent from the address a to the address B, i.e. the statistical data which is finally desired, can be counted.
In step 405, a performance data file meeting the preset requirement is generated based on the memory object file and the network information.
In this embodiment, based on the memory object file obtained in step 403 and the network information obtained in step 404, a performance data file meeting the preset requirement may be obtained.
In step 406, the performance data file is parsed and processed using the performance data parsing and processing tool to generate a performance test report.
In this embodiment, the performance data parsing and processing work may be determined according to parameters required by the performance test report, and the performance data file may be parsed and processed by the performance data parsing and processing tool to generate the performance test report.
In step 407, a performance data monitoring tool is used to generate a monitoring event based on the monitoring index and the result of parsing and processing the performance data file.
In this embodiment, a monitoring event may also be generated by using the performance data monitoring tool when the result of the performance data file matches the monitoring index according to the monitoring index concerned by the user and the result of analyzing and processing the performance data file.
According to the method for generating the information, the performance data file meeting the preset requirement can be generated based on the memory object file and the network information, the accuracy of generating the performance data file is improved, the performance test report and the monitoring event can be automatically generated, and the monitoring efficiency of the performance data file is improved.
With further reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for generating information, which corresponds to the embodiment of the method shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the apparatus 500 for generating information of the present embodiment may include: a compressed packet obtaining unit 510 configured to obtain a test data compressed packet generated by a detection debugging tool in the iOS integrated development tool; an archive file extraction unit 520 configured to extract key data files from the file after decompression of the test data compression packet, the key data files including archive data files; an object file conversion unit 530 configured to convert the archived data file by using an inverse archive function of the object-oriented programming language of the extended C to obtain a memory object file; the performance file generating unit 540 is configured to generate a performance data file meeting a preset requirement based on the memory object file.
In some optional implementations of the present embodiment, the compressed packet obtaining unit 510 includes (not shown in the figure): the application template loading subunit is configured to load the application to be tested and the performance testing template by adopting a detection debugging tool in the iOS integrated development tool; the performance pressure detection subunit is configured to perform performance pressure detection on the application to be tested by adopting the performance test template; and the compressed packet acquisition subunit is configured to acquire the test data compressed packet generated by the detection debugging tool in response to the performance pressure detection stopping.
In some optional implementations of the present embodiment, the compressed packet obtaining unit 510 is further configured to: acquiring a trace file compression package generated by an Instruments detection debugging tool by adopting at least one of the following performance test templates: a Network template, a Leak template, an Allocation template and a VMTraker template.
In some optional implementations of the present embodiment, the object file converting unit 530 includes (not shown in the figure): the error prompt subunit is configured to respond to the fact that no analysis class corresponding to each performance test template exists in the object-oriented programming language of the expansion C and present error prompt information; a class adding subunit configured to add, based on a user operation, an analysis class corresponding to the template; a code adding subunit, configured to analyze the template in the class device by adopting the analysis class corresponding to the template in the object-oriented programming language of the extension C, and add a plurality of lines of codes; and the memory object subunit is configured to analyze data based on the breakpoints of the multiple lines of codes and the user debugging information to obtain a memory object file.
In some optional implementations of this embodiment, the key data file in the archived file extracting unit 520 further includes: a database file; and the performance file generating unit 540 is further configured to: counting network information based on the database file and preset network table data; and generating a performance data file meeting the preset requirement based on the memory object file and the network information.
In some optional implementations of this embodiment, the apparatus further comprises: and a test report generating unit 550 configured to generate a performance test report by parsing and processing the performance data file using the performance data parsing and processing tool.
In some optional implementations of this embodiment, the apparatus further comprises: the monitoring event generating unit 560 is configured to generate a monitoring event based on the monitoring index and the result of parsing and processing the performance data file using the performance data monitoring tool.
It should be understood that the elements recited in apparatus 500 may correspond to various steps in the method described with reference to fig. 4. Thus, the operations and features described above for the method are equally applicable to the apparatus 500 and the units included therein, and are not described in detail here.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a server according to embodiments of the present application. The terminal device or the server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a compressed package acquisition unit, an archive file extraction unit, an object file conversion unit, and a performance file generation unit. The names of these units do not in some cases constitute a limitation on the units themselves, and for example, the compressed packet acquisition unit may also be described as a "unit that acquires a test data compressed packet generated by a test debug tool in the iOS integrated development tool".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: acquiring a test data compression packet generated by a detection debugging tool in the iOS integrated development tool; extracting key data files from the files decompressed by the test data compression packets, wherein the key data files comprise archived data files; converting the archived data file by adopting an inverse archiving function of the object-oriented programming language of the expansion C to obtain a memory object file; and generating a performance data file meeting the preset requirement based on the memory object file.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Claims (16)
1. A method of generating information, comprising:
acquiring a test data compression packet generated by a detection debugging tool in the iOS integrated development tool;
extracting key data files from the files decompressed by the test data compression packets, wherein the key data files comprise archived data files;
adopting an inverse filing function of an object-oriented programming language of the expansion C to convert the filing data file to obtain a memory object file, wherein the method comprises the following steps: for each performance test template, adopting an analysis class corresponding to the template in an object-oriented programming language of an expansion C in a class method to analyze the template, and adding a plurality of lines of codes; analyzing data based on breakpoints of a plurality of lines of codes and user debugging information to obtain a memory object file;
and generating a performance data file meeting the preset requirement based on the memory object file.
2. The method of claim 1, wherein the obtaining test data compression packets generated by a detection debugging tool in the iOS integrated development tool comprises:
loading a tested application and a performance test template by adopting a detection debugging tool in the iOS integrated development tool;
performing performance pressure detection on the application to be tested by adopting the performance testing template;
and responding to the stop performance pressure detection, and acquiring the test data compression packet generated by the detection debugging tool.
3. The method of any one of claims 1-2, wherein the obtaining test data compression packets generated by a detection debugging tool in the iOS integrated development tool comprises:
acquiring a trace file compression package generated by an Instruments detection debugging tool by adopting at least one of the following performance test templates:
a Network template, a Leak template, an Allocation template and a VMTraker template.
4. The method of claim 2, wherein the converting the archived data file using the inverse archive function of the object-oriented programming language of augmentation C to obtain the memory object file comprises:
for each performance test template, presenting error prompt information in response to the fact that no analysis class corresponding to the template exists in the object-oriented programming language of the expansion C;
adding an analysis class corresponding to the template based on user operation;
analyzing the template by adopting an analysis class corresponding to the template in an object-oriented programming language of the expansion C in the class method, and adding a plurality of lines of codes;
and analyzing data based on the breakpoints of the multiple lines of codes and the user debugging information to obtain a memory object file.
5. The method of claim 1, wherein the key data file further comprises: a database file; and
the generating of the performance data file meeting the preset requirement based on the memory object file comprises: counting network information based on the database file and preset network table data; and generating a performance data file meeting the preset requirement based on the memory object file and the network information.
6. The method of claim 1, wherein the method further comprises:
and analyzing and processing the performance data file by adopting a performance data analyzing and processing tool to generate a performance test report.
7. The method of claim 6, wherein the method further comprises:
and generating a monitoring event by adopting a performance data monitoring tool based on the monitoring index and the result of analyzing and processing the performance data file.
8. An apparatus to generate information, comprising:
a compressed packet acquisition unit configured to acquire a test data compressed packet generated by a detection debugging tool in the iOS integrated development tool;
an archive file extraction unit configured to extract key data files from the files decompressed by the test data compression packets, the key data files including archive data files;
the object file conversion unit is configured to convert the archived data file by adopting an inverse archive function of an object-oriented programming language of the expansion C to obtain a memory object file, and comprises: for each performance test template, adopting an analysis class corresponding to the template in an object-oriented programming language of an expansion C in a class method to analyze the template, and adding a plurality of lines of codes; analyzing data based on breakpoints of a plurality of lines of codes and user debugging information to obtain a memory object file;
and the performance file generation unit is configured to generate a performance data file meeting preset requirements based on the memory object file.
9. The apparatus of claim 8, wherein the compressed packet obtaining unit comprises:
the application template loading subunit is configured to load the application to be tested and the performance testing template by adopting a detection debugging tool in the iOS integrated development tool;
a performance pressure detection subunit configured to perform performance pressure detection on the application under test by using the performance test template;
a compressed packet obtaining subunit configured to obtain, in response to stopping performance pressure detection, a test data compressed packet generated by the detection debugging tool.
10. The apparatus according to any one of claims 8-9, wherein the compressed packet acquisition unit is further configured to:
acquiring a trace file compression package generated by an Instruments detection debugging tool by adopting at least one of the following performance test templates:
a Network template, a Leak template, an Allocation template and a VMTraker template.
11. The apparatus of claim 9, wherein the object file converting unit comprises:
the error prompt subunit is configured to respond to the fact that no analysis class corresponding to each performance test template exists in the object-oriented programming language of the expansion C and present error prompt information;
a class adding subunit configured to add, based on a user operation, an analysis class corresponding to the template;
a code adding subunit, configured to analyze the template in the class device by adopting the analysis class corresponding to the template in the object-oriented programming language of the extension C, and add a plurality of lines of codes;
and the memory object subunit is configured to analyze data based on the breakpoints of the multiple lines of codes and the user debugging information to obtain a memory object file.
12. The apparatus of claim 8, wherein the key data file in the archived file extraction unit further comprises: a database file; and
the performance file generating unit is further configured to: counting network information based on the database file and preset network table data; and generating a performance data file meeting the preset requirement based on the memory object file and the network information.
13. The apparatus of claim 8, wherein the apparatus further comprises:
and the test report generating unit is configured to adopt a performance data analyzing and processing tool to analyze and process the performance data file and generate a performance test report.
14. The apparatus of claim 13, wherein the apparatus further comprises:
and the monitoring event generating unit is configured to adopt a performance data monitoring tool to generate a monitoring event based on the monitoring index and the result of analyzing and processing the performance data file.
15. A server, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
16. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810836790.5A CN109062797B (en) | 2018-07-26 | 2018-07-26 | Method and device for generating information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810836790.5A CN109062797B (en) | 2018-07-26 | 2018-07-26 | Method and device for generating information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109062797A CN109062797A (en) | 2018-12-21 |
CN109062797B true CN109062797B (en) | 2019-12-27 |
Family
ID=64836701
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810836790.5A Active CN109062797B (en) | 2018-07-26 | 2018-07-26 | Method and device for generating information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109062797B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115378859B (en) * | 2021-04-13 | 2023-06-02 | 百度在线网络技术(北京)有限公司 | Method, apparatus, device, medium and product for determining limit state information |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006116120A2 (en) * | 2005-04-21 | 2006-11-02 | Qualcomm Incorporated | Methods and apparatus for determining aspects of multimedia performance of a wireless device |
CN106056530A (en) * | 2016-06-01 | 2016-10-26 | 腾讯科技(深圳)有限公司 | Method and device for displaying picture content in application |
CN107026747A (en) * | 2016-02-01 | 2017-08-08 | 中兴通讯股份有限公司 | The statistical summaries method and device of network management performance data |
-
2018
- 2018-07-26 CN CN201810836790.5A patent/CN109062797B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006116120A2 (en) * | 2005-04-21 | 2006-11-02 | Qualcomm Incorporated | Methods and apparatus for determining aspects of multimedia performance of a wireless device |
CN107026747A (en) * | 2016-02-01 | 2017-08-08 | 中兴通讯股份有限公司 | The statistical summaries method and device of network management performance data |
CN106056530A (en) * | 2016-06-01 | 2016-10-26 | 腾讯科技(深圳)有限公司 | Method and device for displaying picture content in application |
Also Published As
Publication number | Publication date |
---|---|
CN109062797A (en) | 2018-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111625473B (en) | Interface test case generation method and device, storage medium and electronic equipment | |
CN109471851B (en) | Data processing method, device, server and storage medium | |
CN110597704B (en) | Pressure test method, device, server and medium for application program | |
CN113836014B (en) | Interface testing method, device, electronic device and storage medium | |
CN109672722B (en) | Data deployment method and device, computer storage medium and electronic equipment | |
CN103577310A (en) | Method and device for recording software debugging logs | |
CN111324510B (en) | Log processing method and device and electronic equipment | |
CN116244387A (en) | Entity relationship construction method, device, electronic equipment and storage medium | |
CN112650673A (en) | Method and device for creating test case in transaction tracking system and electronic equipment | |
CN112748930B (en) | Compilation detection method, device, equipment and storage medium | |
CN109062797B (en) | Method and device for generating information | |
CN112131611B (en) | Data correctness verification method, device, equipment, system and storage medium | |
CN112162954B (en) | User operation log generation and path positioning method, device, equipment and medium | |
CN113238940A (en) | Interface test result comparison method, device, equipment and storage medium | |
CN110443062B (en) | Operation method and device of multi-tenant database and computer equipment | |
CN112860538A (en) | Method and device for performing interface regression test based on online log | |
CN113901773B (en) | Data accounting method, device, electronic equipment and storage medium | |
CN116185393A (en) | Method, device, equipment, medium and product for generating interface document | |
CN113986381A (en) | Data analysis method, device, equipment and storage medium | |
CN114090514A (en) | Log retrieval method and device for distributed system | |
CN113742225A (en) | Test data generation method, device, equipment and storage medium | |
CN113687881A (en) | Metadata calling method and device, electronic equipment and storage medium | |
CN112988593B (en) | Code analysis method, device, computer equipment and storage medium | |
CN112948266B (en) | Database grammar testing system, method, device, equipment and storage medium | |
CN116467223B (en) | Method, device, system, equipment and medium for generating test report |
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 |