CN116633815A - Debugging method, device, electronic equipment and storage medium - Google Patents

Debugging method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116633815A
CN116633815A CN202310484401.8A CN202310484401A CN116633815A CN 116633815 A CN116633815 A CN 116633815A CN 202310484401 A CN202310484401 A CN 202310484401A CN 116633815 A CN116633815 A CN 116633815A
Authority
CN
China
Prior art keywords
debugging
instruction
debug
service function
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310484401.8A
Other languages
Chinese (zh)
Inventor
刘亚伟
尹卫姣
安君超
杨春晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Visionvera Information Technology Co Ltd
Original Assignee
Visionvera Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Visionvera Information Technology Co Ltd filed Critical Visionvera Information Technology Co Ltd
Priority to CN202310484401.8A priority Critical patent/CN116633815A/en
Publication of CN116633815A publication Critical patent/CN116633815A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application provides a debugging method, a debugging device, electronic equipment and a storage medium. The method comprises the following steps: calling a debugging agent thread in a main program to acquire a debugging instruction of a simulation operation instruction sent by at least one upper computer; analyzing the debugging instruction to obtain debugging parameters; and executing debugging operation on the corresponding service function based on the debugging parameters. The embodiment of the application can lead the terminal side service realization logic to be independent of the UI for debugging and verification, and simultaneously greatly reduce the number of BUGs when the UI side and the terminal side are in joint debugging because the terminal side service realization logic is verified in advance, improve joint debugging efficiency and lead research and development personnel to rapidly locate and solve the problems.

Description

Debugging method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of network technologies, and in particular, to a debugging method, a device, an electronic device, and a storage medium.
Background
The service function of the terminal is mainly driven by a series of operation instructions of a UI (User Interface Design, interface design), and when the service function is developed, the service realization logic of the terminal side is inconvenient to independently debug and verify before the development of the UI side is completed. After the UI side is developed, the BUG of the terminal side service realization logic may be discovered when the integrated joint debugging is realized with the terminal side service. In order to quickly locate and solve the problem, the terminal needs to provide complete debugging information of the operation of the service function for research and development personnel.
The existing terminal side service realizes the development and debugging process of logic, and the development and debugging process of the UI side and the terminal side can be carried out continuously only after the UI side development is completed due to the fact that the UI-dependent links which can be carried out continuously only by driving some operation instructions, so that the development and debugging processes of the UI side and the terminal side are operated in series, and the whole development period is increased. The terminal side service realization logic cannot be fully verified before the UI side development is finished, more BUGs appear when joint debugging is integrated, whether the BUGs are the UI side or the terminal side cannot be easily defined, and joint debugging efficiency is low. Meanwhile, in the existing positioning and problem solving technology, the operation log information of a terminal main program is mainly relied on. However, the log information only records the execution flow of user operation and service logic, and cannot accurately and completely record the real-time data state of a certain service function and the state of system operation (such as CPU (Central Processing Unit, central processing unit) utilization rate, memory utilization rate, network operation information, etc.), so that the debug information is not accurate and complete enough, which is not beneficial to quick positioning and solving the problems.
Disclosure of Invention
In view of the foregoing, embodiments of the present application are provided to provide a debugging method, apparatus, electronic device, and storage medium that overcome or at least partially solve the foregoing problems.
In a first aspect, an embodiment of the present application provides a debugging method, where the method includes:
calling a debugging agent thread in a main program to acquire a debugging instruction of a simulation operation instruction sent by at least one upper computer;
analyzing the debugging instruction to obtain debugging parameters;
and executing debugging operation on the corresponding service function based on the debugging parameters.
Optionally, the parsing the debug instruction to obtain debug parameters includes:
analyzing the debugging instruction to obtain an operation word and an operation parameter;
the operation word is used for indicating the service function to be debugged, and the operation parameter is used for indicating the relevant parameter of the service function corresponding to the operation word.
Optionally, the executing the debugging operation on the corresponding service function based on the debugging parameter includes:
acquiring an operation word type corresponding to the operation word;
and calling an interface corresponding to the operation word type, and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
Optionally, the calling the interface corresponding to the operation word type executes the debugging operation on the service function indicated by the operation word according to the operation parameter, including:
when the operation word type is a system type, calling a system application programming interface to acquire system running state information indicated by the operation parameter; or alternatively
And calling a service realization logic interface of the main program under the condition that the operation word type is a service type, and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
Optionally, the calling the debug agent thread in the main program obtains a debug instruction of the simulated operation instruction sent by at least one upper computer, including:
invoking the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer through a network communication mode; and/or
And calling the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer through a serial port communication mode.
Optionally, when the debug instruction is an instruction generated when the target service function is abnormal, the debug instruction includes: a service class debug instruction corresponding to the target service function and a system class debug instruction corresponding to a target system function matched with the target service function,
the step of executing the debugging operation on the corresponding service function based on the debugging parameters comprises the following steps:
based on the service class debugging instruction, executing debugging operation on the target service function to acquire service data state information corresponding to the target service function;
and acquiring system running state information corresponding to the target system function based on the system debugging instruction.
In a second aspect, an embodiment of the present application provides a debugging device, where the device includes:
the debugging instruction acquisition module is used for calling a debugging agent thread in the main program and acquiring a debugging instruction of the simulation operation instruction sent by at least one upper computer;
the debugging parameter acquisition module is used for analyzing the debugging instruction to obtain debugging parameters;
and the debugging operation executing module is used for executing debugging operation on the corresponding service function based on the debugging parameters.
Optionally, the debug parameter acquisition module includes:
the operation word acquisition unit is used for analyzing the debugging instruction to obtain an operation word and an operation parameter;
the operation word is used for indicating the service function to be debugged, and the operation parameter is used for indicating the relevant parameter of the service function corresponding to the operation word.
Optionally, the debug operation execution module includes:
an operation word type obtaining unit, configured to obtain an operation word type corresponding to the operation word;
and the debugging operation executing unit is used for calling the interface corresponding to the operation word type and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
Optionally, the debug operation execution unit includes:
the operation state acquisition subunit is used for calling a system application programming interface to acquire the system operation state information indicated by the operation parameters under the condition that the operation word type is a system type;
and the debugging operation execution subunit is used for calling the service realization logic interface of the main program under the condition that the operation word type is the service type, and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
Optionally, the debug instruction acquisition module includes:
the first instruction acquisition unit is used for calling the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer in a network communication mode;
the second instruction acquisition unit is used for calling the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer in a serial port communication mode.
Optionally, when the debug instruction is an instruction generated when the target service function is abnormal, the debug instruction includes: a service class debug instruction corresponding to the target service function and a system class debug instruction corresponding to a target system function matched with the target service function,
the debugging operation execution module comprises:
the service data state acquisition unit is used for executing debugging operation on the target service function based on the service class debugging instruction so as to acquire service data state information corresponding to the target service function;
and the system running state acquisition unit is used for acquiring the system running state information corresponding to the target system function based on the system debugging instruction.
In a third aspect, an embodiment of the present application provides an electronic device, including:
one or more processors; and
one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform the debugging method of any preceding claim.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium storing a computer program for causing a processor to execute the debugging method of any one of the above claims.
The embodiment of the application has the following advantages:
according to the scheme provided by the embodiment of the application, the debugging agent thread in the main program is called to obtain the debugging instruction of the simulated operation instruction sent by at least one upper computer, the debugging instruction is analyzed to obtain the debugging parameters, and the debugging operation is executed on the corresponding service function based on the debugging parameters. According to the embodiment of the application, the terminal side service function is debugged through the simulation operation instruction (such as the UI operation instruction and the like), so that the terminal side service realization logic can be independent of the UI for debugging and verification, further, the development of the service function can be performed in parallel on the UI side and the terminal side for development and verification, and the whole development period is shortened. Meanwhile, as the service realization logic of the terminal side is verified in advance, the number of BUGs in joint debugging of the UI side and the terminal side can be greatly reduced, and the joint debugging efficiency is improved. Meanwhile, when a function abnormality occurs in a certain service function, the service data state and the system running state of the terminal can be acquired in real time, so that research personnel can quickly locate and solve the problem.
Drawings
FIG. 1 is a flow chart of steps of a debugging method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating steps of a method for obtaining a debug instruction according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a debugging process according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a system structure according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating steps of a method for obtaining debug parameters according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating steps of a method for performing a debug operation according to an embodiment of the present application;
FIG. 7 is a flowchart illustrating steps of another method for performing debug operations according to an embodiment of the present application;
FIG. 8 is a flowchart illustrating steps of a method for performing a debug operation according to an embodiment of the present application;
FIG. 9 is a schematic diagram of an interaction timing sequence of debug verification according to an embodiment of the present application;
FIG. 10 is a schematic diagram of an interaction timing sequence for obtaining complete debug information according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a debugging device according to an embodiment of the present application.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will become more readily apparent, a more particular description of the application will be rendered by reference to the appended drawings and appended detailed description.
Referring to fig. 1, a step flowchart of a debugging method provided by an embodiment of the present application is shown. As shown in fig. 1, the debugging method may include: step 101, step 102 and step 103.
Step 101: and calling a debugging agent thread in the main program to acquire a debugging instruction of the simulated operation instruction sent by at least one upper computer.
The embodiment of the application can be applied to the scene of debugging the service function according to the debugging instruction of the simulation operation instruction.
The embodiment of the application can be applied to the terminal, namely, the execution main body is the terminal.
The main program is a first functional program on the terminal for executing the user application service function, and the main thread runs on the terminal in a process mode.
The upper computer is a software program which runs on the PC and can send debugging instructions to the terminal, and the upper computer can be connected with the terminal through a serial port or a network.
The debug agent thread is a thread on the terminal responsible for executing debug instructions sent by the upper computer, and is also an agent program for communicating the terminal main program with the upper computer.
When the service function of the terminal needs to be debugged (for example, a certain service function abnormality occurs in the terminal), a debugging agent thread in the main program can be called to obtain a debugging instruction of the simulation operation instruction sent by at least one upper computer. In this example, at least one upper computer may send debug instructions to the terminal at the same time, and may send one or more debug instructions each time, so that batch debug operations may be implemented, and debug efficiency is improved.
In this embodiment, the operation instruction may be a UI operation instruction, and the debug instruction is not generated by clicking a UI control (such as a login control, a live broadcast control, etc.) on the UI side, but is edited according to the UI operation instruction. Specifically, a series of operation instructions of the UI may be mapped into debug instructions in advance in the upper computer. For example, the user logs in the debug instruction to be < logic, userName, userPasswords >, issues the live debug instruction to be < livecast, livenum >, receives the live debug instruction to be < livecast sink, srcnum, srchport, dstport >, etc.
The debug instruction may be composed of two parts, an operation word and an operation parameter table, the operation word is an identifier for distinguishing each service function, and the operation parameter table is a relevant operation parameter of the operation word corresponding to the service function. The operation words can be classified into two categories, system and business. The system class is mainly related to system operation, such as CPU utilization rate, memory utilization rate, network operation information and the like, is irrelevant to specific service functions, and is directly executed after the debugging agent analyzes the instruction without calling a specific service realization logic module of a main program. The service class instructions are mainly related to specific services, such as user login, log-out, live broadcast release, live broadcast receiving and the like, and the debugging agent needs to call a specific service implementation logic module in the main program after analyzing the instructions.
When the upper computer realizes the mapping from the operation instruction to the debugging instruction, the operation instruction action can be corresponding to the service class command word of the debugging instruction, the operation instruction data can be corresponding to the operation parameter table of the debugging instruction, and further, the upper computer can be utilized to simulate the operation instruction to sufficiently debug and verify the service realization logic of the terminal side. Therefore, when the service function is developed, the terminal side service realization logic can be independent of the UI to carry out debugging verification, and further the development of the service function can be carried out in parallel development verification on the UI side and the terminal side, so that the development period of the service function can be shortened. Meanwhile, as the service realization logic of the terminal side is verified in advance, the number of BUGs in joint debugging of the UI side and the terminal side can be greatly reduced, and the joint debugging efficiency is improved.
In a specific implementation, a debugging agent thread in the main program can be called to monitor a debugging instruction sent by at least one upper computer through a serial port or a network. This implementation may be described in detail below in conjunction with fig. 2.
Referring to fig. 2, a flowchart illustrating steps of a method for obtaining a debug instruction according to an embodiment of the present application is shown. As shown in fig. 2, the debug instruction acquisition method may include: step 201 and step 202.
Step 201: invoking the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer through a network communication mode; and/or
Step 202: and calling the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer through a serial port communication mode.
In this embodiment, the debug agent thread may be invoked to monitor a debug instruction sent by at least one host computer through a network communication manner and/or a serial port communication manner. As shown in fig. 3, the debug agent thread may monitor debug instructions sent from the network and receive network debug instructions. And/or monitor the debug instruction sent by the serial port, receive the serial port debug instruction, etc.
In this embodiment, the terminal may support a connection manner of one serial port and multiple network ports, that is, in practical application, the terminal may be connected to at least one upper computer. When the number of the upper computers is multiple, the multiple upper computers can debug the terminal at the same time. As shown in fig. 4, the debug agent thread may be communicatively connected to the PC side via a network or serial port.
In the prior art, the communication mode of the debugging upper computer and the terminal debugging agent is seriously dependent on the network, and if the terminal network function is abnormal, the terminal service function cannot be debugged continuously. The embodiment of the application can support two modes of debugging the terminal, namely the network and the serial port, the debugging agent can monitor the network and the serial port at the same time, the data received from the network or the serial port is uniformly transmitted to the same instruction analysis module for processing and continuously executing subsequent processing logic, namely the debugging agent supports two communication modes of the network and the serial port at the same time, and after the network function of the terminal is abnormal, the terminal service function can still be debugged through the serial port.
After the debug agent thread in the main program is called to obtain the debug instruction simulating the UI operation instruction sent by the at least one upper computer, step 102 is executed.
Step 102: and analyzing the debugging instruction to obtain debugging parameters.
After a debugging proxy thread in the main program is called to obtain a debugging instruction simulating the UI operation instruction sent by at least one upper computer, the debugging instruction can be analyzed to obtain a debugging parameter. Specifically, after the debug agent thread obtains the debug instruction, the debug instruction may be parsed by the debug agent thread to obtain an operation word and an operation parameter. The parsing process may be described in detail as follows in connection with fig. 5.
Referring to fig. 5, a flowchart of steps of a method for obtaining debug parameters according to an embodiment of the present application is shown. As shown in fig. 5, the debug parameter acquisition method may include: step 501.
Step 501: and analyzing the debugging instruction to obtain an operation word and an operation parameter.
In this embodiment, after the debug agent thread obtains the debug instruction sent by at least one upper computer, the obtained debug instruction may be sent to the parsing recognition module, so that the parsing recognition module performs the parsing recognition operation on the debug instruction to obtain the operation word (such as login, livecast, livecastsink) and the operation parameter. The operation word may be used to indicate a service function to be debugged, and the operation parameter may be used to indicate a related parameter of the service function corresponding to the operation word. As shown in FIG. 3, after the debug agent thread receives the debug instruction, the debug instruction may be parsed and the operations identified.
According to the embodiment of the application, the debugging instruction is formed by editing the operation words and the operation parameters, the operation words can be used for distinguishing the identification of each service function, the operation parameters can be used for indicating the operation parameters corresponding to the service functions of the operation words, and the directional debugging of the service functions can be realized through the operation words and the operation parameters.
After parsing the debug instruction to obtain debug parameters, step 103 is performed.
Step 103: and executing debugging operation on the corresponding service function based on the debugging parameters.
After the debug instruction is parsed to obtain debug parameters, debug operations may be performed on the corresponding business functions based on the debug parameters. Specifically, an operation word type (such as a system class or a service class) corresponding to the operation word may be obtained, then an interface corresponding to the operation word type may be called, and a debugging operation is performed on the service function indicated by the operation word according to the operation parameter.
According to the embodiment of the application, the terminal side service function is debugged through the simulation operation instruction (such as the UI operation instruction and the like), so that the terminal side service realization logic can be independent of the UI for debugging and verification, further, the development of the service function can be performed in parallel on the UI side and the terminal side for development and verification, and the whole development period is shortened. Meanwhile, when a function abnormality occurs in a certain service function, the service data state and the system running state of the terminal can be acquired in real time, so that research personnel can quickly locate and solve the problem.
For the interface corresponding to the call operation word type, the implementation process of executing the debugging operation on the service function indicated by the operation word according to the operation parameter may be described in detail below with reference to fig. 6.
Referring to fig. 6, a flowchart of steps of a method for performing a debug operation according to an embodiment of the present application is shown. As shown in fig. 6, the debug operation execution method may include: step 601 and step 602.
Step 601: and obtaining the type of the operation word corresponding to the operation word.
In this embodiment, after the operation word and the operation parameter are obtained by parsing, the operation word type corresponding to the operation word may be obtained, that is, whether the operation word type of the operation word obtained by parsing is a system type or a service type is determined. As shown in fig. 3, after the operation word is recognized, the type of the operation word, i.e., the operation word type, may be recognized.
The embodiment of the application can be used for indicating the terminal to call the corresponding interface to execute the debugging operation by presetting the types of the operation words corresponding to different operation words, can effectively identify the required call interface and improves the debugging efficiency.
After the operation word type corresponding to the operation word is acquired, step 602 is performed.
Step 602: and calling an interface corresponding to the operation word type, and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
After the operation word type corresponding to the operation word is obtained, an interface corresponding to the operation word type can be called, and debugging operation is performed on the service function indicated by the operation word according to the operation parameter. Specifically, in the case where the operation word type is a system type, a system API (Application Program Interface, application programming interface) interface may be called to perform a debugging operation. And under the condition that the operation word type is the service type, the service realization logic interface of the main program can be called to execute debugging operation. This implementation may be described in detail below in conjunction with fig. 7.
Referring to fig. 7, a flowchart of steps of another method for performing a debug operation according to an embodiment of the present application is shown. As shown in fig. 7, the debug operation execution method may include: step 701 and step 702.
Step 701: and calling a system application programming interface to acquire the system running state information indicated by the operation parameters under the condition that the operation word type is the system type.
In the embodiment of the application, when the operation word type of the operation word is the system type, the system API interface can be called to obtain the system running state information indicated by the operation parameter, such as CPU utilization rate, memory utilization rate, network running information and the like. As shown in fig. 3, when the type of the operation word is identified as a system class, the calling of the system API interface is performed.
Specifically, when the operation word type of the operation word is a system type, the operation parameter may indicate which system operation state information is acquired, such as CPU utilization, memory utilization, network operation information, and the like. And directly acquiring system running state information indicated by the operation parameters of the system, namely finishing the debugging of the terminal system.
Step 702: and calling a service realization logic interface of the main program under the condition that the operation word type is a service type, and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
And under the condition that the operation word type of the operation word is a service type, a service realization logic interface of the main program can be called, and the debugging operation is executed on the service function indicated by the operation word according to the operation parameter. For example, when the service function indicated by the operation word is a login function, the operation parameter is a user name password used for login, and debugging of the login function is completed through the user name password. As shown in fig. 3, when the type of the operation word is identified as the service class, the calling of the main program service is performed to realize the logic interface.
In a specific implementation, after the debugging operation is performed on the corresponding service function based on the debugging parameter, the corresponding debugging information can be obtained, and then the debugging agent thread can feed the debugging information back to at least one upper computer. Therefore, the research and development personnel can acquire real-time and accurate complete debugging information of the terminal, wherein the complete debugging information comprises the service state and the system running state. As shown in fig. 3, after the debugging execution is completed, the execution result may be returned to the upper computer, so that the developer obtains real-time debugging information.
In this embodiment, when a terminal has a service function abnormality, a debug instruction of a service data state and a system running state may be sent to the terminal by an upper computer, so as to obtain real-time and accurate complete debug information of the terminal, including both the service state and the system running state. This implementation may be described in detail below in conjunction with fig. 8.
Referring to fig. 8, a flowchart of steps of yet another debug operation execution method provided by an embodiment of the present application is shown. As shown in fig. 8, the debug operation execution method may include: step 801 and step 802.
Step 801: and executing debugging operation on the target service function based on the service class debugging instruction so as to acquire service data state information corresponding to the target service function.
Step 802: and acquiring system running state information corresponding to the target system function based on the system debugging instruction.
In this embodiment, when the debug instruction is an instruction generated when the target service function is abnormal, the debug instruction may include: and the system comprises a service class debugging instruction corresponding to the target service function and a system class debugging instruction corresponding to a target system function matched with the target service function. For example, when the target service function is a login function, the target system function may be a network operation information function or the like.
When the service class debugging instruction is obtained, a debugging operation can be executed on the target service function based on the service class debugging instruction so as to obtain service data state information corresponding to the target service function. Specifically, when a terminal has abnormal service function, a debugging instruction for acquiring the service data state is sent to the terminal through the upper computer, the terminal debugging agent receives and analyzes that an operation word in the debugging instruction is a service class instruction for acquiring a specific service data state, and the debugging agent thread calls a function for acquiring the service data state in the main program and returns the service data state to the upper computer.
When the system debugging instruction is acquired, the system running state information corresponding to the target system function can be acquired based on the system debugging instruction. Specifically, the debug agent thread of the terminal can receive and analyze that the operation word in the debug instruction is a system class instruction for acquiring the running state of the system, and the debug agent thread directly calls a system API interface and returns the system state to the upper computer.
According to the embodiment of the application, through the scheme, when a certain service function abnormality occurs in the terminal, the real-time and accurate complete debugging information of the service state and the system running state of the terminal can be obtained through the debugging instruction of the simulation operation instruction.
In an embodiment, the interactive sequence of the simulated UI operation instruction for debugging and verifying the terminal side service implementation logic may be as shown in fig. 9.
Firstly, a service personnel can edit a series of operation instructions of the UI into a batch debugging instruction set consisting of a plurality of debugging instructions, for example, a user logs in the debugging instruction < logic, userName, userPasssard >, issues a live debugging instruction < livecast, livenum >, receives the live debugging instruction < livecast sink, srcnum, srchport, dstport > and the like. The batch debug instruction set may then be added to the host computer.
Then, the upper computer can send the debugging instruction to the terminal one by one. If a user login debugging command (logic, userName, userPassword) is sent, the terminal debugging agent analyzes and identifies the operation logic as a service class, then a main program login service realization logic interface can be called, the main program executes login service realization logic and returns login service execution result data to the terminal debugging agent, and further, the terminal debugging agent replies login service execution result data to the upper computer.
And then, the upper computer sends a live broadcast release debugging instruction < live cast, live num > and the terminal analyzes and identifies the operation word live cast as a service class, and then the main program can be called to release a live broadcast service realization logic interface, the main program executes and releases live broadcast service realization logic and returns live broadcast service release execution result data to the terminal debugging agent, and further, the terminal debugging agent replies and releases the live broadcast service execution result data to the upper computer.
Furthermore, the host computer can send and receive live broadcast debugging instructions < live broadcast, srcnum, srchport, dstport >, and the terminal analyzes and recognizes the operation word live broadcast as a service class, and can call the host program to receive the live broadcast service realization logic interface, the host program executes the live broadcast receiving realization logic and returns the live broadcast service execution result data, and the terminal debugging agent can reply the live broadcast service execution result data to the host computer.
In this embodiment, the interactive sequence for acquiring the complete debug information when a certain service function abnormality occurs in the terminal may be as shown in fig. 10.
First, a developer may edit a batch debug instruction set with a related debug instruction for acquiring an abnormal service state, for example, acquire a live data state debug instruction of < getLivecast >, and acquire a system running state debug instruction of < getSystem >, etc. And adding the edited instruction set to the upper computer.
And secondly, the upper computer can send debugging instructions to the terminal debugging agent one by one. If the service data state is acquired, the < getLivecast > can be sent to the terminal debugging agent, the terminal debugging agent analyzes and identifies the operation word getLivecast as a service class, the main program can be called to acquire the live broadcast data state acquisition logic interface, and the main program executes the live broadcast data state acquisition logic and returns live broadcast data state data to the terminal debugging agent. Furthermore, the terminal debugging agent can reply and issue the live broadcast data state data to the upper computer.
When the system running state is acquired, the upper computer can send the < getSystem > to the terminal debugging agent. The terminal debugging agent analyzes and identifies the getSystem as a system class, and can call a system API interface such as CPU utilization rate, memory utilization rate, network operation information and the like, directly acquire system operation state data such as the CPU utilization rate, the memory utilization rate, the network operation information and the like, and reply the system operation state data such as the CPU utilization rate, the memory utilization rate, the network operation information and the like to the upper computer.
The mode of the simulated operation instruction provided by the embodiment of the application can enable the terminal side business realization logic to be independent of the UI for debugging and verification when the business function is developed, further enable the development of the business function to be parallel to the UI side and the terminal side for development and verification, and shorten the whole development period. Meanwhile, batch debugging instructions can be supported, and the debugging efficiency is improved.
According to the debugging method provided by the embodiment of the application, the debugging instruction of the simulated operation instruction sent by at least one upper computer is obtained by calling the debugging agent thread in the main program, the debugging instruction is analyzed to obtain the debugging parameters, and the debugging operation is executed on the corresponding service function based on the debugging parameters. According to the embodiment of the application, the terminal side service function is debugged through the simulation operation instruction (such as the UI operation instruction and the like), so that the terminal side service realization logic can be independent of the UI for debugging and verification, further, the development of the service function can be performed in parallel on the UI side and the terminal side for development and verification, and the whole development period is shortened. Meanwhile, as the service realization logic of the terminal side is verified in advance, the number of BUGs in joint debugging of the UI side and the terminal side can be greatly reduced, and the joint debugging efficiency is improved. Meanwhile, when a function abnormality occurs in a certain service function, the service data state and the system running state of the terminal can be acquired in real time, so that research personnel can quickly locate and solve the problem.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the application.
Referring to fig. 11, a schematic structural diagram of a debugging device according to an embodiment of the present application is shown. As shown in fig. 11, the debugging device 1100 may include the following modules:
the debug instruction obtaining module 1101 is configured to call a debug agent thread in the main program, and obtain a debug instruction of a simulated operation instruction sent by at least one upper computer;
a debug parameter obtaining module 1102, configured to parse the debug instruction to obtain a debug parameter;
the debug operation execution module 1103 is configured to execute a debug operation on the corresponding service function based on the debug parameter.
Optionally, the debug parameter acquisition module includes:
the operation word acquisition unit is used for analyzing the debugging instruction to obtain an operation word and an operation parameter;
the operation word is used for indicating the service function to be debugged, and the operation parameter is used for indicating the relevant parameter of the service function corresponding to the operation word.
Optionally, the debug operation execution module includes:
an operation word type obtaining unit, configured to obtain an operation word type corresponding to the operation word;
and the debugging operation executing unit is used for calling the interface corresponding to the operation word type and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
Optionally, the debug operation execution unit includes:
the operation state acquisition subunit is used for calling a system application programming interface to acquire the system operation state information indicated by the operation parameters under the condition that the operation word type is a system type;
and the debugging operation execution subunit is used for calling the service realization logic interface of the main program under the condition that the operation word type is the service type, and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
Optionally, the debug instruction acquisition module includes:
the first instruction acquisition unit is used for calling the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer in a network communication mode;
the second instruction acquisition unit is used for calling the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer in a serial port communication mode.
Optionally, when the debug instruction is an instruction generated when the target service function is abnormal, the debug instruction includes: a service class debug instruction corresponding to the target service function and a system class debug instruction corresponding to a target system function matched with the target service function,
the debugging operation execution module comprises:
the service data state acquisition unit is used for executing debugging operation on the target service function based on the service class debugging instruction so as to acquire service data state information corresponding to the target service function;
and the system running state acquisition unit is used for acquiring the system running state information corresponding to the target system function based on the system debugging instruction.
According to the debugging device provided by the embodiment of the application, the debugging instruction of the simulated operation instruction sent by at least one upper computer is obtained by calling the debugging agent thread in the main program, the debugging instruction is analyzed to obtain the debugging parameters, and the debugging operation is executed on the corresponding service function based on the debugging parameters. According to the embodiment of the application, the terminal side service function is debugged through the simulation operation instruction (such as the UI operation instruction and the like), so that the terminal side service realization logic can be independent of the UI for debugging and verification, further, the development of the service function can be performed in parallel on the UI side and the terminal side for development and verification, and the whole development period is shortened. Meanwhile, as the service realization logic of the terminal side is verified in advance, the number of BUGs in joint debugging of the UI side and the terminal side can be greatly reduced, and the joint debugging efficiency is improved. Meanwhile, when a function abnormality occurs in a certain service function, the service data state and the system running state of the terminal can be acquired in real time, so that research personnel can quickly locate and solve the problem.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In an embodiment of the application, an electronic device is also provided. The electronic device may include one or more processors and one or more machine-readable media having instructions stored thereon, such as an application. The instructions, when executed by the one or more processors, cause the processors to perform the debugging method of any one of the above.
In an embodiment of the present application, there is also provided a non-transitory computer-readable storage medium having stored thereon a computer program executable by a processor of an electronic device to implement any of the above-described methods of video networking access. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be seen with each other.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The above describes in detail a debugging method, device, electronic apparatus and storage medium provided by the present application, and specific examples are applied to illustrate the principles and embodiments of the present application, where the above examples are only used to help understand the method and core ideas of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method of debugging, the method comprising:
calling a debugging agent thread in a main program to acquire a debugging instruction of a simulation operation instruction sent by at least one upper computer;
analyzing the debugging instruction to obtain debugging parameters;
and executing debugging operation on the corresponding service function based on the debugging parameters.
2. The method of claim 1, wherein said parsing the debug instruction to obtain debug parameters comprises:
analyzing the debugging instruction to obtain an operation word and an operation parameter;
the operation word is used for indicating the service function to be debugged, and the operation parameter is used for indicating the relevant parameter of the service function corresponding to the operation word.
3. The method of claim 2, wherein performing a debug operation on the corresponding business function based on the debug parameters comprises:
acquiring an operation word type corresponding to the operation word;
and calling an interface corresponding to the operation word type, and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
4. A method according to claim 3, wherein said calling the interface corresponding to the operation word type, and executing the debug operation on the service function indicated by the operation word according to the operation parameter, includes:
when the operation word type is a system type, calling a system application programming interface to acquire system running state information indicated by the operation parameter; or alternatively
And calling a service realization logic interface of the main program under the condition that the operation word type is a service type, and executing debugging operation on the service function indicated by the operation word according to the operation parameter.
5. The method of claim 1, wherein the calling the debug agent thread in the main program to obtain the debug instruction of the simulated operation instruction sent by the at least one host computer comprises:
invoking the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer through a network communication mode; and/or
And calling the debugging agent thread to acquire the debugging instruction sent by the at least one upper computer through a serial port communication mode.
6. The method according to any one of claims 1 to 5, wherein when the debug instruction is an instruction generated when a target service function is abnormal, the debug instruction includes: a service class debug instruction corresponding to the target service function and a system class debug instruction corresponding to a target system function matched with the target service function,
the step of executing the debugging operation on the corresponding service function based on the debugging parameters comprises the following steps:
based on the service class debugging instruction, executing debugging operation on the target service function to acquire service data state information corresponding to the target service function;
and acquiring system running state information corresponding to the target system function based on the system debugging instruction.
7. A debugging device, the device comprising:
the debugging instruction acquisition module is used for calling a debugging agent thread in the main program and acquiring a debugging instruction of the simulation operation instruction sent by at least one upper computer;
the debugging parameter acquisition module is used for analyzing the debugging instruction to obtain debugging parameters;
and the debugging operation executing module is used for executing debugging operation on the corresponding service function based on the debugging parameters.
8. The apparatus of claim 7, wherein the debug parameter acquisition module comprises:
the operation word acquisition unit is used for analyzing the debugging instruction to obtain an operation word and an operation parameter;
the operation word is used for indicating the service function to be debugged, and the operation parameter is used for indicating the relevant parameter of the service function corresponding to the operation word.
9. An electronic device, comprising:
one or more processors; and
one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform the debugging method of any of claims 1-6.
10. A computer readable storage medium, characterized in that it stores a computer program causing a processor to execute the debugging method according to any one of claims 1 to 6.
CN202310484401.8A 2023-04-28 2023-04-28 Debugging method, device, electronic equipment and storage medium Pending CN116633815A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310484401.8A CN116633815A (en) 2023-04-28 2023-04-28 Debugging method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310484401.8A CN116633815A (en) 2023-04-28 2023-04-28 Debugging method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116633815A true CN116633815A (en) 2023-08-22

Family

ID=87601709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310484401.8A Pending CN116633815A (en) 2023-04-28 2023-04-28 Debugging method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116633815A (en)

Similar Documents

Publication Publication Date Title
WO2021238006A1 (en) Artificial intelligence chip verification
CN109361562B (en) Automatic testing method based on associated network equipment access
CN108984389B (en) Application program testing method and terminal equipment
US20080098359A1 (en) Manipulation of trace sessions based on address parameters
CN107145437B (en) Java annotation test method and device
CN109871326A (en) A kind of method and apparatus that script is recorded
CN108459850B (en) Method, device and system for generating test script
CN109324975B (en) Continuous integration method based on mobile cloud measurement platform
CN113672441B (en) Method and device for testing intelligent equipment
CN106713011B (en) Method and system for obtaining test data
CN110688313B (en) Fault injection method for software testing under VxWorks operating system
CN109977012B (en) Joint debugging test method, device, equipment and computer readable storage medium of system
CN112650676A (en) Software testing method, device, equipment and storage medium
CN103593293A (en) Parallel automated testing method
CN113360386B (en) Method and device for testing driving of switching chip, electronic equipment and storage medium
CN105550103B (en) A kind of automated testing method based on self-defined test script
US20050203717A1 (en) Automated testing system, method and program product using testing map
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN105260257B (en) Settlement procedure stops response method and apparatus during running
CN116431522A (en) Automatic test method and system for low-code object storage gateway
CN111427582A (en) Management method, device and equipment of RT L code and computer readable storage medium
CN116633815A (en) Debugging method, device, electronic equipment and storage medium
CN115993937A (en) Method and device for realizing simulation environment of multi-process solid state disk
CN113934619A (en) Sound source testing method, system and storage medium based on Robot Framework testing Framework
CN113868116A (en) Test dependent data generation method and device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication