CN106843947B - Method and device for processing code defects - Google Patents

Method and device for processing code defects Download PDF

Info

Publication number
CN106843947B
CN106843947B CN201710005495.0A CN201710005495A CN106843947B CN 106843947 B CN106843947 B CN 106843947B CN 201710005495 A CN201710005495 A CN 201710005495A CN 106843947 B CN106843947 B CN 106843947B
Authority
CN
China
Prior art keywords
defect
application program
terminal
code
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710005495.0A
Other languages
Chinese (zh)
Other versions
CN106843947A (en
Inventor
朱志刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710005495.0A priority Critical patent/CN106843947B/en
Publication of CN106843947A publication Critical patent/CN106843947A/en
Application granted granted Critical
Publication of CN106843947B publication Critical patent/CN106843947B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a method and a device for processing code defects. The method comprises the following steps: starting and running an application program; acquiring a defect configuration file corresponding to the application program and acquiring equipment information of a terminal where the application program is located; detecting a defect identifier in a code file of the application program, and reading a device information set corresponding to the defect identifier from the defect configuration file; judging whether the equipment information of the terminal is in the equipment information set or not; and if the equipment information is in the equipment information set, finding out a repair code corresponding to the defect identifier from the code file of the application program, and executing the repair code. The code defect processing method and the code defect processing device can be used for rapidly realizing the code defect processing without modifying the local code, thereby improving the code defect processing efficiency.

Description

Method and device for processing code defects
Technical Field
The present invention relates to the field of computer applications, and in particular, to a method and an apparatus for processing code defects.
Background
Due to the problem of Android fragmentation, the Android application developer often encounters the phenomenon that no problem exists on the mobile terminal of the own tester model, but problems occur on the mobile terminals of other models. At this time, the reason needs to be found according to the problems occurring in other mobile terminals, and the repair packet compatible with different mobile terminals needs to be modified as much as possible. The Android fragmentation means that the Android system has a plurality of versions, and functions of each version may have different differences, or a plurality of manufacturers using the Android system use the Android system, and each manufacturer may modify the bottom content according to the requirements of each manufacturer, so that the same installation package may be installed on mobile terminals of different machines to cause different phenomena.
For the problem that the code defects cannot adapt to various types of machines, the traditional processing mode is that a repair packet needs to be generated again after the defects are repaired aiming at the problem that each manufacturer feeds back, and the repair packet is sent to each manufacturer for testing, so that the defect processing efficiency is low.
Disclosure of Invention
Based on this, the embodiments of the present invention provide a method and an apparatus for processing a code defect, which can improve the efficiency of processing the code defect.
A method for processing code defects comprises the following steps:
starting and running an application program;
acquiring a defect configuration file corresponding to the application program and acquiring equipment information of a terminal where the application program is located;
detecting a defect identifier in a code file of the application program, and reading a device information set corresponding to the defect identifier from the defect configuration file;
judging whether the equipment information of the terminal is in the equipment information set or not;
and if the equipment information is in the equipment information set, finding out a repair code corresponding to the defect identifier from the code file of the application program, and executing the repair code.
A device for handling code defects, comprising:
the starting module is used for starting and running the application program;
the acquisition module is used for acquiring a defect configuration file corresponding to the application program and acquiring equipment information of a terminal where the application program is located;
the reading module is used for detecting a defect identifier in a code file of the application program and reading a device information set corresponding to the defect identifier from the defect configuration file;
the judging module is used for judging whether the equipment information of the terminal is in the equipment information set or not;
and the execution module is used for finding out a repair code corresponding to the defect identifier from the code file of the application program and executing the repair code if the equipment information is in the equipment information set.
According to the method and the device for processing the code defects, after the application program is started and operated, the defect configuration file corresponding to the application program and the equipment information of the terminal where the application program is located are obtained, when the defect identification in the code file of the application program is detected, the equipment information set corresponding to the defect identification is obtained from the defect configuration file, whether the equipment information of the terminal is in the equipment information set corresponding to the defect identification in the defect configuration file or not is judged, if yes, the repair code is executed, the code defects are rapidly processed, the local code does not need to be modified, and the processing efficiency of the code defects is improved.
Drawings
FIG. 1 is a diagram illustrating an exemplary application environment of a method for handling code defects according to an embodiment;
fig. 2A is a schematic diagram of an internal structure of a terminal in one embodiment;
FIG. 2B is a diagram illustrating an internal architecture of a server according to an embodiment;
FIG. 3 is a flow diagram of a method for handling code defects in one embodiment;
FIG. 4 is a flowchart of a method for handling code defects in another embodiment;
FIG. 5 is a flow diagram of a method for handling code defects in one embodiment;
FIG. 6 is a flow diagram of a method for handling code defects in one embodiment;
FIG. 7 is a block diagram of an apparatus for handling code defects in one embodiment;
FIG. 8 is a block diagram showing a structure of a device for processing a code defect in another embodiment;
FIG. 9 is a block diagram showing a structure of a device for processing a code defect in another embodiment;
FIG. 10 is a block diagram showing a structure of a device for processing a code defect in another embodiment;
FIG. 11 is a block diagram showing a structure of a device for processing a code defect in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the present invention. Both the first client and the second client are clients, but they are not the same client.
FIG. 1 is a diagram illustrating an application environment of a method for handling code defects according to an embodiment. As shown in fig. 1, the application environment includes a terminal 110 and a server 120. The terminal 110 is in data communication with the server 120. The server 120 stores a defect configuration file corresponding to the application program. The defect profile is recorded with device information, defect identification, and the like. The terminal 110 downloads the updated defect configuration file from the server 120 after running the application program, acquires the device information of the terminal, and when executing the defect identifier, reads the device information set corresponding to the defect configuration file and the defect identifier, and if the device information of the terminal is in the device information set corresponding to the defect identifier of the defect configuration file, executes the repair code corresponding to the defect identifier to repair the code defect. And if the equipment information of the terminal is not in the defect configuration file, executing a non-repair code. Non-repair code refers to code before a defect is repaired. The processing efficiency of repairing the code defects is high. The terminal 110 may be a smart phone, a tablet computer, a personal digital assistant, a wearable device, or other smart devices. The server 120 may be a server cluster of one or more servers or a cloud server.
Fig. 2A is a schematic diagram of an internal structure of the terminal in one embodiment. As shown in fig. 2A, the terminal includes a processor, a nonvolatile storage medium, an internal memory, a network interface, a display screen, and an input device, which are connected through a system bus. The non-volatile storage medium of the terminal stores an operating system and further comprises a code defect processing device, and the code defect processing device is used for realizing a code defect processing method. The processor is used for providing calculation and control capability and supporting the operation of the whole terminal. An internal memory in the terminal provides an environment for operation of the processing device for code defects in the non-volatile storage medium, the internal memory having stored therein computer-readable instructions which, when executed by the processor, cause the processor to perform a method for processing code defects. The network interface is used for performing network communication with the server, such as sending an update request to the server, receiving an updated defect configuration file returned by the server, and the like. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen, and the input device can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the terminal, or an external keyboard, a touch pad or a mouse. The terminal can be a mobile phone, a tablet computer, a personal digital assistant or a wearable device. Those skilled in the art will appreciate that the configuration shown in fig. 2A is a block diagram of only a portion of the configuration relevant to the present application, and does not constitute a limitation on the terminal to which the present application is applied, and a particular terminal may include more or less components than those shown in the drawings, or may combine certain components, or have a different arrangement of components.
Fig. 2B is a schematic diagram of an internal structure of a server (or a cloud, etc.) in one embodiment. As shown in fig. 2B, the server includes a processor, a non-volatile storage medium, an internal memory, and a network interface connected by a system bus. The non-volatile storage medium of the server stores an operating system, a database and a code defect processing device, the database stores a defect configuration file corresponding to an application program, and the code defect processing device is used for realizing a code defect processing method suitable for the server. The processor of the server is used for providing calculation and control capacity and supporting the operation of the whole server. The internal memory of the server provides an environment for the operation of the processing device for the code defect in the non-volatile storage medium, and the internal memory can store computer readable instructions which, when executed by the processor, can cause the processor to execute a processing method for the code defect. The network interface of the server is used for communicating with an external terminal through a network connection, such as receiving an update request sent by the terminal and returning an updated defect configuration file to the terminal. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers. Those skilled in the art will appreciate that the architecture shown in fig. 2B is merely a block diagram of some of the structures associated with the present solution and does not constitute a limitation on the servers to which the present solution applies, and that a particular server may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
FIG. 3 is a flow diagram of a method for handling code defects in one embodiment. As shown in fig. 3, a method for processing a code defect, which is executed on the terminal in fig. 1 and fig. 2A, includes:
step 302, an application is started and run.
In this embodiment, one or more applications are installed on the terminal. And the terminal acquires the touch operation of the user on the icon or the shortcut of the application program, and starts and runs the application program.
Step 304, acquiring a defect configuration file, and acquiring device information of a terminal where the application program is located.
In this embodiment, the defect configuration file is used to record device information and a file of defect identifiers of a terminal that causes an application to fail when the code is executed. The device information may include model information and may also include hardware information. The model information can be a model keyword, and the model keyword is the unique identity information of the model of the marking terminal. The hardware information may include a CPU (central processing unit), an internal memory, a graphics processor, and the like. The defect identifier is an identity credential that uniquely represents the defect. The defect identifier may be a defect number, etc. When the code files of the application program are executed on different terminals, some terminals can generate defects, and some terminals can not generate defects. The positions of defects generated by running the application programs by different terminals can be the same or different. And recording a defect identifier of the defect generated by the application program and a device information set corresponding to the defect identifier by using the defect configuration file. The defect configuration file is downloaded by the terminal from the server and corresponds to the application program.
The corresponding relation between the application program identification and the defect configuration file is stored on the terminal. The application identification is a character string or the like for uniquely representing the application. The character string may include one or more of numbers, letters, characters, and the like.
The defect may be an application exit or a stuck or flashing screen, etc.
The device information of the terminal where the application is located may include model information, or model information and hardware information, and the like.
Step 306, detecting a defect identifier in the code file of the application program, and reading a device information set corresponding to the defect identifier from the defect configuration file.
In this embodiment, when the application program is executed, the defect identifier in the code file of the application program is encountered, and the defect identifier in the code file of the application program is obtained. And reading a device information set corresponding to the defect identifier from the defect configuration file according to the defect identifier.
Step 308, determining whether the device information of the terminal is in the device information set, if so, executing step 310, and if not, executing step 312.
Step 310, finding out the repair code corresponding to the defect identifier from the code file of the application program, and executing the repair code.
Step 312, finding out the non-repair code corresponding to the defect identifier from the code file of the application program, and executing the non-repair code.
In this embodiment, determining whether the device information of the terminal where the application program is located is in the device information set corresponding to the defect identifier in the defect configuration file means comparing the device information of the terminal where the application program is located with the device information set corresponding to the defect identifier in the defect configuration file, if the device information of the terminal where the application program is located is the same as the device information set corresponding to the defect identifier in the defect configuration file, and if the device information of the terminal where the application program is located is not the same as the device information set corresponding to the defect identifier in the defect configuration file.
The repair code is a code recorded in advance in a code file of the application program to repair the defect. Two branches are recorded in the code file, namely when the defect identifier is executed and the device information of the terminal is judged to be in the device information set corresponding to the defect identifier in the defect configuration file, the repair code is executed, and if the device information of the terminal is judged not to be in the device information set corresponding to the defect identifier in the defect configuration file, the non-repair code is executed. Non-repair code refers to code before a defect is repaired.
According to the code defect processing method, after the application program is started and operated, the defect configuration file corresponding to the application program is obtained, the equipment information of the terminal where the application program is located is obtained, when the defect identifier in the code file of the application program is obtained, the equipment information set corresponding to the defect identifier is obtained from the defect configuration file, whether the equipment information of the terminal is in the equipment information set corresponding to the defect identifier in the defect configuration file is judged, if yes, the repair code is executed, the code defect processing is rapidly achieved, the local code does not need to be modified, and the code defect processing efficiency is improved.
In an embodiment, as shown in fig. 4, the acquiring the defect configuration file corresponding to the application program includes:
step 402, initiating a query request to a server whether the defect configuration file corresponding to the application program has an update.
In this embodiment, the server stores a defect configuration file corresponding to the application program. And after the terminal runs the application program, acquiring an application program identifier, and initiating a query request for whether the defect configuration file corresponding to the application program has an update to the server. The query request may include an application identifier and defect configuration file version information stored on the terminal and corresponding to the application identifier.
Step 404, receiving a response result that the defect configuration file returned by the server has an update.
In this embodiment, after receiving the query request, the server searches for a corresponding defect configuration file from a correspondence between an application identifier stored in the server and the defect configuration file according to the application identifier in the query request, obtains version information of the defect configuration file corresponding to the application stored in the server, compares the version information of the defect configuration file stored in the server with the version information of the defect configuration file stored in the terminal, and if the version information of the defect configuration file stored in the server is the same as the version information of the defect configuration file stored in the terminal, the server sends a result that the defect configuration file is not updated to the terminal, and if the version information of the defect configuration file is different from the version information of the defect configuration file.
Step 406, downloading an updated defect configuration file from the server according to the response result.
In this embodiment, the terminal downloads the updated defect configuration file from the server according to the response result.
In this embodiment, after the application program is started and run, whether the defect configuration file corresponding to the application program has an updated query request is sent to the server, and after an updated response result is received, the updated defect configuration file is downloaded from the server, so that the defect configuration file stored on the terminal is ensured to be the latest, an error in execution of the application program is avoided, and the code defect of the terminal can be repaired only by downloading the defect configuration file from the server without modifying a local code, thereby saving network traffic.
In an embodiment, the method for processing the code defect further includes: acquiring a defect identifier of the application program with defects on the terminal; comparing the defect identifier of the application program with a defect identifier in a defect configuration file which is stored on a server and corresponds to the application program; if the defect identifiers are the same, acquiring the equipment information of the terminal, and adding the equipment information of the terminal into an equipment information set corresponding to the defect identifiers in the defect configuration file; and if the defect identifiers are different, acquiring the equipment information of the terminal, generating a corresponding code repair packet according to the defect identifier of the application program, and adding the defect identifier and the equipment information of the terminal into the defect configuration file.
FIG. 5 is a flow diagram that illustrates a method for handling code defects, according to one embodiment. As shown in fig. 5, a method for processing a code defect, which is executed on the server in fig. 1 and 2B, includes:
step 502, receiving a query request for whether a defect configuration file corresponding to an application program has an update, which is initiated after the terminal starts and runs the application program.
In this embodiment, the server receives an inquiry request for whether the defect configuration file corresponding to the application program has an update or not, where the inquiry request is initiated after the terminal starts and runs the application program. The query request may include an application identifier and defect configuration file version information stored on the terminal and corresponding to the application identifier.
Step 504, returning the response result that the defect configuration file has update to the terminal.
In this embodiment, after receiving the query request, the server searches for a corresponding defect configuration file from a correspondence between an application identifier stored in the server and the defect configuration file according to the application identifier in the query request, obtains version information of the defect configuration file corresponding to the application stored in the server, compares the version information of the defect configuration file stored in the server with the version information of the defect configuration file stored in the terminal, and if the version information of the defect configuration file stored in the server is the same as the version information of the defect configuration file stored in the terminal, the server sends a result that the defect configuration file is not updated to the terminal, and if the version information of the defect configuration file is different from the version information of the defect configuration file.
Step 506, receiving a downloading request of a terminal, and sending the updated defect configuration file to the terminal according to the downloading request, so that the terminal can obtain the defect configuration file corresponding to the application program and obtain the device information of the terminal where the application program is located; detecting a defect identifier in a code file of the application program, and acquiring a device information set corresponding to the defect identifier from the defect configuration file; judging whether the equipment information of the terminal is in the equipment information set or not; and if the equipment information is in the equipment information set, finding out a repair code corresponding to the defect identifier from the code file of the application program, and executing the repair code.
In this embodiment, the device information includes model information, or includes model information and hardware information.
In this embodiment, the server receives whether the defect configuration file corresponding to the application program sent by the terminal after starting and running the application program has an updated query request, responds to the query request, sends the updated defect configuration file to the terminal, can ensure that the defect configuration file stored on the terminal is the latest, avoids errors in the execution of the application program, and can realize the repair of the code defect of the terminal only by downloading the defect configuration file from the server, without modifying a local code, saves network traffic, and enables the terminal to obtain corresponding device information from the defect configuration file according to a defect identifier when executing the defect identifier, determine whether the device information of the terminal is in a device information set corresponding to the defect identifier of the defect configuration file, if the device information set is, execute the repair code, and if the device information set is not, the non-repair code is executed, the processing of the code defect is quickly realized, the local code does not need to be modified, and the processing efficiency of the code defect is improved.
FIG. 6 is a flow diagram that illustrates a method for handling code defects, according to one embodiment. As shown in fig. 6, the method for processing the code defect further includes:
step 602, acquiring defect identifiers of defects of the application program on the terminal.
In this embodiment, the defect identifier is used to uniquely represent the identity credential of the defect. The defect may be a defect such as an application exit, a stuck, etc.
Step 604, comparing the defect identifier of the application program with the defect identifier in the defect configuration file stored on the server and corresponding to the application program.
The server stores a defect configuration file, and the defect configuration file records defect identification and corresponding equipment information.
Step 606, if the device information of the terminal is the same as the defect identifier, the device information is obtained and added to a device information set corresponding to the defect identifier in the defect configuration file.
In this embodiment, the device information includes model information, or includes model information and hardware information. The model information can be a model keyword, and the model keyword is unique identity information for marking the model of the terminal. The hardware information may include a CPU, internal memory, graphics processor, etc. The defect configuration file is downloaded by the terminal from the server and corresponds to the application program.
If the defect identifications are the same, the terminal of other machine types has the same defect, the equipment information is added into the defect configuration file, and the defect can be repaired by adopting the existing repair code. If the defect identifications are different, the defect is represented to be the first occurrence, and a corresponding code repair packet is generated according to the defect identifications.
Step 608, if the difference is different, acquiring the device information of the terminal, generating a corresponding code repair packet according to the defect identifier of the application program, and adding the defect identifier and the device information of the terminal to the defect configuration file.
In this embodiment, the corresponding code repair package generated by the defect identifier of the application program is added to the code file of the application program, so that the same defect appears next time, the code repair package is executed to repair the defect corresponding to the defect identifier.
When the defect identifier of the application program on the terminal is the same as the defect identifier in the defect configuration file on the server, the device information of the terminal is directly added into the defect configuration file on the server and the device information set corresponding to the defect identifier, and the latest defect configuration file is downloaded when the terminal with the same device information starts the application program, so that the problem of code defect of the application program on the terminal with the same device information is solved.
FIG. 7 is a block diagram of an apparatus for handling code defects in one embodiment. As shown in fig. 7, a device 700 for processing a code defect, which runs on the terminal in fig. 1 and fig. 2A, includes a starting module 702, an obtaining module 704, a reading module 706, a determining module 708, and an executing module 710. Wherein:
the start module 702 is used to start and run an application.
In this embodiment, one or more applications are installed on the terminal. And the terminal acquires the touch operation of the user on the icon or the shortcut of the application program, and starts and runs the application program.
The obtaining module 704 is configured to obtain a defect configuration file corresponding to the application program, and obtain device information of a terminal where the application program is located. In this embodiment, the defect configuration file is used to record device information and a file of defect identifiers of a terminal that causes an application to fail when the code is executed. The device information may include model information and may also include hardware information. The model information can be a model keyword, and the model keyword is the unique identity information of the model of the marking terminal. The hardware information may include a CPU, internal memory, graphics processor, etc. The defect identifier is an identity credential that uniquely represents the defect. The defect identifier may be a defect number, etc. When the code files of the application program are executed on different terminals, some terminals can generate defects, and some terminals can not generate defects. The positions of defects generated by running the application programs by different terminals can be the same or different. And recording a defect identifier of the defect generated by the application program and a device information set corresponding to the defect identifier by using the defect configuration file. The defect configuration file is downloaded by the terminal from the server and corresponds to the application program.
The corresponding relation between the application program identification and the defect configuration file is stored on the terminal. The application identification is a character string or the like for uniquely representing the application. The character string may include one or more of numbers, letters, characters, and the like.
The defect may be an application exit or a stuck or flashing screen, etc.
The device information of the terminal where the application is located may include model information, or model information and hardware information, and the like.
The reading module 706 is configured to detect a defect identifier in a code file of the application, and read a device information set corresponding to the defect identifier from the defect configuration file.
In this embodiment, when the application program is executed, the defect identifier in the code file of the application program is encountered, and the defect identifier in the code file of the application program is obtained. And acquiring a device information set corresponding to the defect identifier from the defect configuration file according to the defect identifier.
The determining module 708 is configured to determine whether the device information of the terminal is in the device information set corresponding to the defect identifier.
The execution module 710 is configured to find a repair code corresponding to the defect identifier from a code file of the application program if the device information is in the device information set, and execute the repair code.
In this embodiment, determining whether the device information of the terminal where the application program is located is in the device information set corresponding to the defect identifier in the defect configuration file means comparing the device information of the terminal where the application program is located with the device information set corresponding to the defect identifier in the defect configuration file, if the device information of the terminal where the application program is located is the same as the device information set corresponding to the defect identifier in the defect configuration file, and if the device information of the terminal where the application program is located is not the same as the device information set corresponding to the defect identifier in the defect configuration file.
If the device information of the terminal is not in the device information set corresponding to the defect identifier, finding out a non-repair code corresponding to the defect identifier from the code file of the application program, and executing the non-repair code.
The repair code is a code recorded in advance in a code file of the application program to repair the defect. Two branches are recorded in the code file, namely when the defect identifier is executed and the device information of the terminal is judged to be in the device information set corresponding to the defect identifier in the defect configuration file, the repair code is executed, and if the device information of the terminal is judged not to be in the defect configuration file, the non-repair code is executed. Non-repair code refers to code before a defect is repaired.
After the application program is started and run, the device for processing the code defect acquires the defect configuration file corresponding to the application program and acquires the device information of the terminal where the application program is located, acquires the device information set corresponding to the defect identifier from the defect configuration file when the defect identifier in the code file of the application program is acquired, judges whether the device information of the terminal is in the device information set corresponding to the defect identifier in the defect configuration file, and executes the repair code if the device information of the terminal is in the device information set corresponding to the defect identifier in the defect configuration file.
FIG. 8 is a block diagram of a first obtaining module in one embodiment. As shown in fig. 8, acquisition module 704 includes query request initiating unit 7042, response receiving unit 7044, and downloading unit 7046. Wherein:
the query request initiating unit 7042 is configured to initiate, to the server, a query request for whether the defect configuration file corresponding to the application program has an update after the application program is started and executed.
In this embodiment, the server stores a defect configuration file corresponding to the application program. And after the terminal runs the application program, acquiring an application program identifier, and initiating a query request for whether the defect configuration file corresponding to the application program has an update to the server. The query request may include an application identifier and defect configuration file version information stored on the terminal and corresponding to the application identifier.
The response receiving unit 7044 is configured to receive a response result that the defect configuration file returned by the server has an update.
In this embodiment, after receiving the query request, the server searches for a corresponding defect configuration file from a correspondence between an application identifier stored in the server and the defect configuration file according to the application identifier in the query request, obtains version information of the defect configuration file corresponding to the application stored in the server, compares the version information of the defect configuration file stored in the server with the version information of the defect configuration file stored in the terminal, and if the version information of the defect configuration file stored in the server is the same as the version information of the defect configuration file stored in the terminal, the server sends a result that the defect configuration file is not updated to the terminal, and if the version information of the defect configuration file is different from the version information of the defect configuration file.
The downloading unit 7046 is configured to download the updated defect configuration file from the server according to the response result.
In this embodiment, after the application program is started and run, whether the defect configuration file corresponding to the application program has an updated query request is sent to the server, and after an updated response result is received, the updated defect configuration file is downloaded from the server, so that the defect configuration file stored on the terminal is ensured to be the latest, an error in execution of the application program is avoided, and the code defect of the terminal can be repaired only by downloading the defect configuration file from the server without modifying a local code, thereby saving network traffic.
FIG. 9 is a block diagram showing a structure of a device for processing a code defect in another embodiment. As shown in fig. 9, a device 700 for processing code defects, which runs on the terminal in fig. 1 and fig. 2A, includes a defect identifier obtaining module 712, a comparing module 714, an adding module 716, and a generating module 718 in addition to a starting module 702, an obtaining module 704, a reading module 706, a judging module 708, and an executing module 710.
The defect identifier obtaining module 712 is configured to obtain a defect identifier of a defect occurring on the terminal by the application.
The comparing module 714 is configured to compare the defect identifier of the application with a defect identifier in a defect configuration file stored on the server and corresponding to the application.
The adding module 716 is configured to, if the defect identifiers are the same, obtain the device information of the terminal, and add the device information of the terminal to the device information set corresponding to the defect identifier in the defect configuration file.
The generating module 718 is configured to, if the defect identifiers are different, obtain device information of the terminal, generate a corresponding code repair package according to the defect identifier of the application, and add the defect identifier and the device information of the terminal to the defect configuration file.
FIG. 10 is a block diagram showing a structure of a device for processing a code defect in another embodiment. As shown in fig. 10, a device for processing a code defect, which runs on the server in fig. 1 and 2B, includes a request receiving module 1002, a responding module 1004, and a sending module 1006. Wherein:
the request receiving module 1002 is configured to receive an inquiry request for whether an updated defect configuration file corresponding to an application program is initiated after the terminal starts and runs the application program.
In this embodiment, the server receives an inquiry request for whether the defect configuration file corresponding to the application program has an update or not, where the inquiry request is initiated after the terminal starts and runs the application program. The query request may include an application identifier and defect configuration file version information stored on the terminal and corresponding to the application identifier.
The response module 1004 is configured to return a response result that the defect profile has been updated to the terminal.
In this embodiment, after receiving the query request, the server searches for a corresponding defect configuration file from a correspondence between an application identifier stored in the server and the defect configuration file according to the application identifier in the query request, obtains version information of the defect configuration file corresponding to the application stored in the server, compares the version information of the defect configuration file stored in the server with the version information of the defect configuration file stored in the terminal, and if the version information of the defect configuration file stored in the server is the same as the version information of the defect configuration file stored in the terminal, the server sends a result that the defect configuration file is not updated to the terminal, and if the version information of the defect configuration file is different from the version information of the defect configuration file.
The sending module 1006 is configured to receive a download request of a terminal, and send an updated configuration file to the terminal according to the download request, so that the terminal obtains a defect configuration file corresponding to the application program and obtains device information of the terminal where the application program is located; detecting a defect identifier in a code file of the application program, and reading a device information set corresponding to the defect identifier from the defect configuration file; judging whether the equipment information of the terminal is in the equipment information set corresponding to the defect identifier or not; and if the equipment information is in the defect configuration file, finding out a repair code corresponding to the defect identifier from the code file of the application program, and executing the repair code.
In this embodiment, the device information includes model information, or includes model information and hardware information.
In this embodiment, the server receives whether the defect configuration file corresponding to the application program sent by the terminal after starting and running the application program has an updated query request, responds to the query request, sends the updated defect configuration file to the terminal, can ensure that the defect configuration file stored on the terminal is the newest, avoids errors in the execution of the application program, can realize the repair of the code defect of the terminal only by downloading the defect configuration file from the server, does not need to modify a local code, saves network traffic, and enables the terminal to obtain corresponding device information from the defect configuration file according to the defect identifier when executing the defect identifier, judge whether the device information of the terminal is in a device information set corresponding to the defect identifier of the defect configuration file, if the device information is in the defect configuration file, execute the repair code, and if the repair code is not in the configuration file, the non-repair code is executed, the processing of the code defect is quickly realized, the local code does not need to be modified, and the processing efficiency of the code defect is improved.
FIG. 11 is a block diagram showing a structure of a device for processing a code defect in another embodiment. As shown in fig. 11, a device for processing a code defect, which runs on the server in fig. 1 and fig. 2B, includes a defect identifier obtaining module 1008, a comparing module 1010, an adding module 1012, and a generating module 1014, in addition to a request receiving module 1002, a responding module 1004, and a sending module 1006. Wherein:
the defect identifier obtaining module 1008 is configured to obtain a defect identifier of a defect occurring on the terminal by the application.
The comparing module 1010 is configured to compare the defect identifier of the application program with a defect identifier in a defect configuration file stored on a server and corresponding to the application program.
The adding module 1012 is configured to, if the defect identifiers are the same, obtain the device information of the terminal, and add the device information of the terminal to the device information set corresponding to the defect identifier in the defect configuration file. The device information includes model information, or includes model information and hardware information.
The generating module 1014 is configured to, if the defect identifiers are different, obtain the device information of the terminal, generate a corresponding code repair package according to the defect identifier of the application, and add the defect identifier and the device information of the terminal to the defect configuration file.
In this embodiment, when the defect identifier of the application program appearing on the terminal is the same as the defect identifier in the defect configuration file on the server, the device information of the terminal is directly added to the device information set corresponding to the defect configuration file on the server and the defect identifier, and the latest defect configuration file is downloaded when the terminal having the same device information starts the application program, so that the problem of the defect code of the application program on the terminal having the same device information is solved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (12)

1. A method for processing code defects comprises the following steps:
starting and running an application program;
acquiring a defect configuration file corresponding to the application program and acquiring equipment information of a terminal where the application program is located;
detecting a defect identifier in a code file of the application program, and reading a device information set corresponding to the defect identifier from the defect configuration file;
judging whether the equipment information of the terminal is in the equipment information set or not;
and if the equipment information is in the equipment information set, finding out a repair code corresponding to the defect identifier from the code file of the application program, and executing the repair code.
2. The method of claim 1, wherein the obtaining a defect profile corresponding to the application comprises:
initiating a query request for whether the defect configuration file corresponding to the application program has update to a server;
receiving a response result that the defect configuration file returned by the server has update;
and downloading the updated defect configuration file from the server according to the response result.
3. The method according to claim 1 or 2, wherein the device information comprises model information, or comprises model information and hardware information.
4. The method of claim 1, further comprising:
and if the equipment information of the terminal is not in the equipment information set corresponding to the defect identifier, finding out a non-repair code corresponding to the defect identifier from the code file of the application program, and executing the non-repair code.
5. The method of claim 1, further comprising:
acquiring defect identification of defects of the application program on the terminal;
comparing the defect identifier of the application program with a defect identifier in a defect configuration file which is stored on a server and corresponds to the application program;
if the defect identifiers are the same, acquiring the equipment information of the terminal, and adding the equipment information of the terminal into an equipment information set corresponding to the defect identifiers in the defect configuration file;
and if the defect identification is different from the defect identification of the application program, acquiring the equipment information of the terminal, generating a corresponding code repair packet according to the defect identification of the application program, and adding the defect identification and the equipment information of the terminal into the defect configuration file.
6. A device for processing a code defect, comprising:
the starting module is used for starting and running the application program;
the acquisition module is used for acquiring a defect configuration file corresponding to the application program and acquiring equipment information of a terminal where the application program is located;
the reading module is used for detecting a defect identifier in a code file of the application program and reading a device information set corresponding to the defect identifier from the defect configuration file;
the judging module is used for judging whether the equipment information of the terminal is in the equipment information set or not;
and the execution module is used for finding out a repair code corresponding to the defect identifier from the code file of the application program and executing the repair code if the equipment information is in the equipment information set.
7. The apparatus of claim 6, wherein the obtaining module comprises:
the query request initiating unit is used for initiating a query request for whether the defect configuration file corresponding to the application program has updating to a server;
the response receiving unit is used for receiving a response result that the defect configuration file returned by the server has update;
and the downloading unit is used for downloading the updated defect configuration file from the server according to the response result.
8. The apparatus according to claim 6 or 7, wherein the device information comprises model information, or comprises model information and hardware information.
9. The apparatus according to claim 6, wherein the execution module is further configured to, if the device information of the terminal is not in the device information set corresponding to the defect identifier, find a non-repair code corresponding to the defect identifier from a code file of the application, and execute the non-repair code.
10. The apparatus of claim 6, further comprising:
the defect identifier acquisition module is used for acquiring the defect identifier of the defect of the application program on the terminal;
the comparison module is used for comparing the defect identifier of the application program with the defect identifier in the defect configuration file which is stored on the server and corresponds to the application program;
an adding module, configured to obtain device information of the terminal and add the device information of the terminal to a device information set corresponding to the defect identifier in the defect configuration file if the device information of the terminal is the same as the device information of the defect identifier;
and the generating module is used for acquiring the equipment information of the terminal if the equipment information is different, generating a corresponding code repair packet according to the defect identifier of the application program, and adding the defect identifier and the equipment information of the terminal into the defect configuration file.
11. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 5.
12. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 5.
CN201710005495.0A 2017-01-04 2017-01-04 Method and device for processing code defects Active CN106843947B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710005495.0A CN106843947B (en) 2017-01-04 2017-01-04 Method and device for processing code defects

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710005495.0A CN106843947B (en) 2017-01-04 2017-01-04 Method and device for processing code defects

Publications (2)

Publication Number Publication Date
CN106843947A CN106843947A (en) 2017-06-13
CN106843947B true CN106843947B (en) 2020-01-24

Family

ID=59116733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710005495.0A Active CN106843947B (en) 2017-01-04 2017-01-04 Method and device for processing code defects

Country Status (1)

Country Link
CN (1) CN106843947B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108681464A (en) * 2018-05-12 2018-10-19 芜湖市疾病预防控制中心 Method of the old B/S architecture systems to mobile client optimization and compatibility adaptation
CN111722998B (en) * 2019-03-21 2024-05-24 阿里巴巴集团控股有限公司 Code quality control method, system, equipment and storage medium
CN111858113B (en) * 2019-04-30 2024-03-12 北京达佳互联信息技术有限公司 Application program repairing method and device, service system and storage medium
CN110633099A (en) * 2019-09-05 2019-12-31 北京无限光场科技有限公司 Application program repairing method, device, equipment and readable medium
CN114610516B (en) * 2022-03-10 2023-07-04 抖音视界有限公司 Application program repairing method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662833A (en) * 2012-03-21 2012-09-12 天津书生软件技术有限公司 Method for managing test cases
CN103559127A (en) * 2013-10-28 2014-02-05 北京邮电大学 Defect processing method and defect processor
CN104142881A (en) * 2013-05-07 2014-11-12 腾讯科技(深圳)有限公司 Adaptive defect detecting method and device of application program programming interfaces
CN104765678A (en) * 2014-01-08 2015-07-08 阿里巴巴集团控股有限公司 Method and device for testing applications on mobile terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8584079B2 (en) * 2010-12-16 2013-11-12 Sap Portals Israel Ltd Quality on submit process

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662833A (en) * 2012-03-21 2012-09-12 天津书生软件技术有限公司 Method for managing test cases
CN104142881A (en) * 2013-05-07 2014-11-12 腾讯科技(深圳)有限公司 Adaptive defect detecting method and device of application program programming interfaces
CN103559127A (en) * 2013-10-28 2014-02-05 北京邮电大学 Defect processing method and defect processor
CN104765678A (en) * 2014-01-08 2015-07-08 阿里巴巴集团控股有限公司 Method and device for testing applications on mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于PI3000平台的软件缺陷管理系统的应用实践;夏慧等;《计算机与现代化》;20100531(第5期);全文 *

Also Published As

Publication number Publication date
CN106843947A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN106843947B (en) Method and device for processing code defects
CN106940651B (en) POS terminal software upgrading method and device
CN103150231B (en) The method of computer booting and computer system
CN108121559B (en) Configuration file pushing method, server and storage medium
CN107729227B (en) Application program test range determining method, system, server and storage medium
CN109814524B (en) Vehicle diagnosis method, device and system
CN103518191A (en) Upgrade method, intelligent terminal and upgrade system
CN110928770B (en) Software testing method, device, system, storage medium and electronic equipment
US20220253297A1 (en) Automated deployment of changes to applications on a cloud computing platform
CN111538523A (en) Differential upgrading method, device and storage medium
CN113656107A (en) Mobile application loading method and device and electronic equipment
US8347285B2 (en) Embedded agent for self-healing software
CN108762787B (en) Software repairing method, device, computer equipment and storage medium
CN109032641B (en) Application version updating method and device
CN104182266A (en) Application installation method and device
CN108196975B (en) Data verification method and device based on multiple checksums and storage medium
CN113918384A (en) Data saving method, device, equipment and storage medium
CN114116033A (en) Server configuration modification method and device
CN112328288A (en) Method, system, equipment and storage medium for updating server component
CN112230939A (en) Hardware module repairing method and device, computer equipment and storage medium
CN112379943A (en) Plug-in application method and device of Electron application program and storage medium
CN113032019A (en) Multi-factor-based android device identification method and device and storage medium
CN107122164B (en) Method, device, equipment and storage medium for acquiring function address and applying function address
CN111538651A (en) Interface testing method, device, server and storage medium
CN110825406A (en) Software upgrading method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant