CN112783748B - Program debugging method, device, equipment and computer readable storage medium - Google Patents

Program debugging method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN112783748B
CN112783748B CN201911076001.3A CN201911076001A CN112783748B CN 112783748 B CN112783748 B CN 112783748B CN 201911076001 A CN201911076001 A CN 201911076001A CN 112783748 B CN112783748 B CN 112783748B
Authority
CN
China
Prior art keywords
program
debugged
debugging
server
parameter information
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
CN201911076001.3A
Other languages
Chinese (zh)
Other versions
CN112783748A (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 CN201911076001.3A priority Critical patent/CN112783748B/en
Publication of CN112783748A publication Critical patent/CN112783748A/en
Application granted granted Critical
Publication of CN112783748B publication Critical patent/CN112783748B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • 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

Abstract

The embodiment of the application provides a program debugging method, a device, equipment and a computer readable storage medium, wherein the method comprises the following steps: the method comprises the steps that a management platform receives a debugging request sent by a client, wherein the debugging request comprises an identification of a program to be debugged; requesting an IDL file of the program to be debugged from a server according to the identification of the program to be debugged; analyzing the IDL file to obtain parameter entering and exiting information of the program to be debugged; encoding the access parameter information to form a debugging instruction with the access parameter information; and sending the debugging instruction to the server so that the server debugs the program to be debugged based on the access parameter information. By the method and the device, the complexity of program debugging can be reduced, and the efficiency of program debugging is improved.

Description

Program debugging method, device, equipment and computer readable storage medium
Technical Field
The embodiment of the application relates to the technical field of internet, and relates to a program debugging method, a device, equipment and a computer readable storage medium.
Background
Currently, in a distributed system, when a program at a server side is changed, a client side corresponding to the server needs to acquire the program, compile the program, obtain a service of the client side according to a compiled file, write the service of the client side, then, debug the program at the client side according to the written service, if a problem occurs in the debugging process, modify the service of the client side, and recompile and release the modified service, so that the whole process is complex and time-consuming.
Disclosure of Invention
The embodiment of the application provides a program debugging method, device and equipment and a computer readable storage medium, which can reduce the complexity of program debugging and improve the efficiency of program debugging.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a program debugging method, which comprises the following steps:
the method comprises the steps that a management platform receives a debugging request sent by a client, wherein the debugging request comprises an identification of a program to be debugged;
requesting an IDL file of the program to be debugged from a server according to the identification of the program to be debugged;
analyzing the IDL file to obtain parameter entering and exiting information of the program to be debugged;
encoding the access parameter information to form a debugging instruction with the access parameter information;
and sending the debugging instruction to the server so that the server debugs the program to be debugged based on the access parameter information.
An embodiment of the present application provides a program debugging device, including:
the receiving module is used for receiving a debugging request sent by the client, wherein the debugging request comprises an identification of a program to be debugged;
the request module is used for requesting an IDL file of the program to be debugged from a server according to the identification of the program to be debugged;
The analysis module is used for analyzing the IDL file to obtain the parameter entering and exiting information of the program to be debugged;
the encoding module is used for encoding the access parameter information to form a debugging instruction with the access parameter information;
and the sending module is used for sending the debugging instruction to the server so that the server can debug the program to be debugged based on the access parameter information.
An embodiment of the present application provides a program debugging device, including:
a memory for storing executable instructions; and the processor is used for realizing the method when executing the executable instructions stored in the memory.
Embodiments of the present application provide a computer readable storage medium storing executable instructions for causing a processor to perform the above-described method.
The embodiment of the application has the following beneficial effects: the management platform analyzes the IDL file of the program to be debugged to obtain access parameter information of the program to be debugged, codes the access parameter information to obtain a debugging instruction, and sends the debugging instruction to the server to instruct the server to debug the program to be debugged based on the access parameter information in the debugging instruction. Therefore, as the IDL file is analyzed through the management platform of the third party to obtain the access information, the program to be debugged does not need to be operated, and the acquired IDL file does not need to be compiled, the complexity of program debugging is reduced, and the efficiency of program debugging is improved.
Drawings
FIG. 1 is a schematic diagram of an alternative architecture of a program debug system provided by embodiments of the present application;
fig. 2 is a schematic structural diagram of a management terminal according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of an alternative method for debugging a program according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of an alternative method for debugging a program according to an embodiment of the present application;
FIG. 5 is a schematic flow chart of an alternative method for debugging a program according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of an alternative method for debugging a program according to an embodiment of the present application;
FIG. 7 is a schematic flow chart of an alternative method for debugging a program according to an embodiment of the present application;
FIG. 8 is a schematic flow chart of an alternative method for debugging a program according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a process flow for performing program debugging in the related art;
FIG. 10 is a schematic diagram of an implementation flow of program debugging in an embodiment of the present application;
FIG. 11 is a schematic diagram of a procedure for calling a program based on the TARS protocol in the related art;
fig. 12 is a schematic diagram of a procedure call procedure based on a management platform in an embodiment of the application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail with reference to the accompanying drawings, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict. Unless defined otherwise, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of the present application belong. The terminology used in the embodiments of the present application is for the purpose of describing the embodiments of the present application only and is not intended to be limiting of the present application.
Before further describing embodiments of the present application in detail, the terms and expressions that are referred to in the embodiments of the present application are described, and are suitable for the following explanation.
1) Interface description language (IDL, interface description language), a computer language used to describe the interfaces of software components, describes the interfaces in a neutral manner so that objects running on different platforms and programs written in different languages can communicate with each other, is a necessary technique for communication between distributed systems.
2) A distributed system is a software system built on top of a network. In a distributed system, a group of independent computers presents to the user a unified whole as if it were a system. The system has various general physical and logical resources, can dynamically allocate tasks, and the scattered physical and logical resources realize information exchange through a computer network.
3) Remote procedure calls (RPC, remote Procedure Call) are a necessary technique for distributed inter-system communication, i.e. one node requests another remote node to provide services.
4) And compiling, namely generating a target program from a source program written in a source language by utilizing a compiler. In this application, a corresponding program is required to be written on the client side for a new service developed by the server or a program changed by the server, and when the corresponding program is written, the program on the server side is the source program, the corresponding program on the client side is the target program, and the compiling process is the process of compiling the target program on the client side from the source program on the server side by using the compiling program.
In order to better understand the program debugging method provided in the embodiment of the present application, first, further analysis and explanation are made on the RPC technology:
RPC technology is a technology that requests services from a remote computer program over a network without requiring knowledge of the protocols of the underlying network technology. Among them, the RPC protocol assumes the existence of certain transmission protocols, such as transmission control protocol (TCP, transmission Control Protocol) or user datagram protocol (UDP, user Datagram Protocol), to carry information data between communication programs. In the open systems interconnection (OSI, open System Interconnection) network communication model, the RPC spans a transport layer and an application layer. RPC makes it easier to develop applications, including network distributed applications, where distributed applications refer to: the applications are distributed across different computers to collectively accomplish a task, typically a server/client mode, over a network. Wherein the requesting program is a client and the service provider is a server. First, the client calling process sends a call message with process parameters to the service process and then waits for a response message. At the server side, the process remains dormant until the call information arrives. When one call information arrives, the server obtains the process parameters, calculates the result, sends the reply information, then waits for the next call information, finally, the client calls the process to receive the reply information, obtains the process result, and then calls the execution to continue.
In the related art, when debugging a program, for example, in a distributed system, when the program at the server side is changed or when the server side initiates a new RPC service, if the client side wants to debug or use the RPC service, a service needs to be written at the client side, then an IDL file of the service is obtained and compiled to obtain a compiled file, and then the service of the client side is written according to the compiled file. After the service of the client is written, the program is deployed at the client according to the written service, and is debugged, if a problem occurs in the debugging process, the service of the client needs to be modified, and the modified service needs to be compiled and released again. That is, in the related art, each modification of the RPC program by the server side, when the client runs, the client needs to perform a series of processes such as modification, compiling, publishing, IDL modification, recompilation, and publishing again on the corresponding program. Obviously, this process is complex and time consuming, often taking tens of minutes to debug a server-side change, and is prone to error during the debugging process.
Based on at least one problem existing in the related art, an embodiment of the present application provides a program debugging method, which simulates a client in a management platform, constructs data according to an object converted from an IDL file, and accesses a server through the constructed data. Because no client is needed, offline compiling of IDL files is not needed, the time spent for debugging the change of the server at one time can be greatly shortened, and the program debugging efficiency is improved.
An exemplary application of the program debugging device provided in the embodiment of the present application is described below, where the device provided in the embodiment of the present application is a management platform for managing at least one client, and the management platform may be implemented as a notebook computer, a tablet computer, a desktop computer, a mobile device (for example, a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device), or any type of management terminal capable of running a program. Next, an exemplary application when the device is implemented as a management terminal will be described.
Referring to FIG. 1, FIG. 1 is a schematic diagram of an alternative architecture of a program debug system 10 provided in an embodiment of the present application. In order to realize smooth running of one program on the client, the management terminal 100 is connected to the server 300 through the network 200, and the management terminal 100 is connected to the service terminal 400 running the client 400-1 through the network, so as to manage the service program on the service terminal 400, where the network 200 may be a wide area network or a local area network, or a combination of the two.
The management terminal 100 displays an IDL file of a program to be debugged, which is transmitted from the server, on the current page 110. In this embodiment of the present application, the management terminal 100 may receive a debug request sent by the client 400-1, obtain an IDL file of a program to be debugged sent by the server based on the debug request, parse the IDL file to obtain access parameter information of the program to be debugged, encode the access parameter information to form a debug instruction with the access parameter information, send the debug instruction to the server 300, so that the server 300 debugs the program to be debugged based on the access parameter information, and the server 300 may send the debugged program obtained after the debugging to the service terminal 400, so as to run the debugger on the service terminal 400 to implement a corresponding service.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a management terminal 100 provided in an embodiment of the present application, and the management terminal 100 shown in fig. 2 includes: at least one processor 310, a memory 350, at least one network interface 320, and a user interface 330. The various components in the management terminal 100 are coupled together by a bus system 340. It is understood that the bus system 340 is used to enable connected communications between these components. The bus system 340 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled in fig. 2 as bus system 340.
The processor 310 may be an integrated circuit chip with signal processing capabilities such as a general purpose processor, which may be a microprocessor or any conventional processor, or the like, a digital signal processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
The user interface 330 includes one or more output devices 331 that enable presentation of media content, including one or more speakers and/or one or more visual displays. The user interface 330 also includes one or more input devices 332, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
Memory 350 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard drives, optical drives, and the like. Memory 350 optionally includes one or more storage devices physically located remote from processor 310. Memory 350 includes volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a random access Memory (RAM, random Access Memory). The memory 350 described in embodiments of the present application is intended to comprise any suitable type of memory. In some embodiments, memory 350 is capable of storing data to support various operations, examples of which include programs, modules and data structures, or subsets or supersets thereof, as exemplified below.
The operating system 351 including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
network communication module 352 for reaching other computing devices via one or more (wired or wireless) network interfaces 320, exemplary network interfaces 320 include: bluetooth, wireless compatibility authentication (WiFi), and universal serial bus (USB, universal Serial Bus), etc.;
an input processing module 353 for detecting one or more user inputs or interactions from one of the one or more input devices 332 and translating the detected inputs or interactions.
In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in a software manner, fig. 2 shows a program debugging apparatus 354 stored in a memory 350, where the program debugging apparatus 354 may be a program debugging apparatus in the management terminal 100, and may be software in the form of a program and a plug-in, and the following software modules include: the receiving module 3541, requesting module 3542, parsing module 3543, encoding module 3544 and transmitting module 3545 are logical, and thus may be arbitrarily combined or further split depending on the implemented functions. The functions of the respective modules will be described hereinafter.
In other embodiments, the apparatus provided by the embodiments of the present application may be implemented in hardware, and by way of example, the apparatus provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor that is programmed to perform the program debugging method provided by the embodiments of the present application, e.g., the processor in the form of a hardware decoding processor may employ one or more application specific integrated circuits (ASIC, application Specific Integrated Circuit), DSPs, programmable logic devices (PLD, programmable Logic Device), complex programmable logic devices (CPLD, complex Programmable Logic Device), field programmable gate arrays (FPGA, field-Programmable Gate Array), or other electronic components.
The program debugging method provided in the embodiment of the present application will be described below in connection with exemplary applications and implementations of the management terminal 100 provided in the embodiment of the present application. Referring to fig. 3, fig. 3 is a schematic flowchart of an alternative program debugging method according to an embodiment of the present application, and will be described with reference to the steps shown in fig. 3.
In step S401, the management platform receives the debug request sent by the client.
Here, the debug request includes an identification of a program to be debugged, and the debug request is used for requesting to debug the program to be debugged of the server.
In this embodiment of the present application, when a program of a server changes or when the server initiates a new service, if a client wants to use the service, a program corresponding to the service needs to be debugged, where the program corresponding to the service is the program to be debugged. In the embodiment of the application, when the program to be debugged is debugged, the client is not required to debug, and the client only needs to send the debugging request to the management platform, so that the program to be debugged can be debugged through the management platform. In addition, in the embodiment of the application, the debugging of the program to be debugged is realized through the management platform, so that the program to be debugged does not need to be compiled at the client to form a program capable of running at the client.
The management platform is an online platform, can manage all service terminals corresponding to the server, is a platform for uniformly managing IDL files and programs to be debugged, and is deployed with the client.
For example, for an instant messaging APP, the server of the instant messaging APP corresponds to at least one user terminal, and each user terminal is deployed with a client of the instant messaging APP. When the instant messaging APP initiates a new instant messaging service, for example, a service that can send a red packet through a voice command during chat, a developer needs to write a program corresponding to the service on the instant messaging APP server and inform a client on a user terminal of the new service, at this time, the client can send the debug request to a management platform to request the management platform to debug the program corresponding to the service, so that the program corresponding to the service can be run on the client to realize the service.
Step S402, according to the identification of the program to be debugged, requesting the IDL file of the program to be debugged from a server.
When receiving the debugging request, the management platform analyzes the debugging request to obtain the identification of the program to be debugged in the debugging request, and sends a request message to a server according to the identification of the program to be debugged, wherein the request message comprises the identification of the program to be debugged and is used for requesting an IDL file corresponding to the program to be debugged from the server.
In this embodiment of the present invention, the management platform may directly obtain an IDL file of the program to be debugged from a server, where the IDL file includes information such as a communication protocol, a communication method, a communication parameter, a parameter type, a service parameter, a service type, and a communication module defined by the server, where the IDL file is used to define a communication manner between a client and the server, and the IDL file is a standard for implementing the service.
Step S403, analyzing the IDL file to obtain the parameter information of the program to be debugged.
The management platform directly analyzes the access parameter information of the program to be debugged from the IDL file, which may be that the management platform firstly analyzes the IDL file to obtain the information such as the communication protocol, the communication method, the communication parameter, the parameter type, the service parameter, the service type, the communication module and the like in the IDL file, then constructs the access parameter information according to the information in the IDL file, and constructs the information such as the communication protocol, the communication method, the communication parameter, the parameter type, the service parameter, the service type, the communication module and the like in the IDL file into the easy-to-read access parameter information, so that personnel on the management platform side can quickly and conveniently determine the parameters of the program to be debugged at the server side by referring to the access parameter information, and determine the content to be debugged.
In the embodiment of the application, the management platform can directly analyze the information in the IDL file, construct the access parameter information based on the information in the IDL file without compiling the IDL file, compile the IDL file into the proxy class with detailed access parameter information, and then determine the access parameter information based on the proxy class and realize the subsequent debugging process. Obviously, compared with the method in the related art that the proxy class is obtained by compiling first, the scheme of determining the access parameter information based on the proxy class is more concise to implement.
Step S404, encoding the access parameter information to form a debugging instruction with the access parameter information.
Here, since the access parameter information includes a debug parameter for indicating to debug a program to be debugged on the server side, after the access parameter information is obtained, the access parameter information may be encoded, and format conversion is performed on the access parameter information to form a debug instruction including the access parameter information, where the debug instruction is used to instruct to debug the program to be debugged on the server according to the debug parameter.
Step S405, sending the debug instruction to the server, so that the server debugs the program to be debugged based on the parameter access information.
After the debugging instruction is obtained through encoding, the management platform sends the debugging instruction to the server, so that a debugging person at the server side can obtain the debugging parameters in the debugging instruction, and debug the program to be debugged according to the debugging parameters to obtain a debugged program, wherein the debugged program can effectively run at the client side, and the function corresponding to the service can be normally realized.
According to the program debugging method, the management platform analyzes the acquired ID file of the program to be debugged to obtain the access parameter information of the program to be debugged, codes the access parameter information to obtain the debugging instruction, and sends the debugging instruction to the server to instruct the server to debug the program to be debugged based on the access parameter information in the debugging instruction. Therefore, as the IDL file is analyzed through the management platform of the third party to obtain the access information, the program to be debugged does not need to be operated, and the acquired IDL file does not need to be compiled, the complexity of program debugging is reduced, and the efficiency of program debugging is improved.
Referring to fig. 4, fig. 4 is a schematic flowchart of an alternative program debugging method provided in an embodiment of the present application, where the method includes the following steps:
in step S501, the client sends a debug request to the management platform.
Here, when the client on the service terminal determines that the program of the server is changed or determines that the server initiates a new service, the client sends a debug request to the management platform, where the debug request includes an identifier of the program to be debugged. The program to be debugged is a program changed on the server or a program corresponding to a new service initiated by the server.
In step S502, the management platform requests the IDL file of the program to be debugged to the server according to the identifier of the program to be debugged.
Here, when the management platform receives the debug request and analyzes the identification of the program to be debugged, a request message is sent to the server, the request message includes the identification of the program to be debugged, and the server is requested to send an IDL file of the program to be debugged through the request message.
In step S503, the server sends the IDL file of the program to be debugged to the management platform.
Here, after receiving the request message sent by the management platform, the server sends the IDL file of the program to be debugged to the management platform in response to the request message, so that the management platform can realize the debugging of the program to be debugged based on the received IDL file.
Step S504, the management platform analyzes the IDL file to obtain the parameter information of the program to be debugged.
Here, after the IDL file is obtained, the management platform parses the IDL file to obtain information in the IDL file, and constructs access information based on the information in the IDL file, without compiling the IDL file.
In the embodiment of the application, after the IDL file is acquired, the management platform does not need to compile the IDL file to run the program to be debugged, and can directly analyze the IDL file to obtain the information in the IDL file. For the client, after the client obtains the IDL file, the IDL file needs to be compiled, and then the program obtained after the compiling is executed, so that it can be seen that the management platform in the embodiment of the present application is a completely different platform from the client, and is a third party management platform between the server and the client.
In step S505, the management platform converts the access parameter information into access parameter information with JSON format.
Here, the access information can be converted into a JS Object numbered musical Notation (JSON, javaScript Object notification) format, which is a lightweight data exchange format that stores and represents data in a text format completely independent of a programming language, and the concise and clear hierarchical structure makes JSON an ideal data exchange language, easy for people to read and write, easy for machines to parse and generate, and effectively improves network transmission efficiency.
In the embodiment of the application, the access parameter information is converted into the JSON format, so that the user can conveniently read and write the access parameter information, and meanwhile, the management platform can conveniently analyze the access parameter information, and the program debugging efficiency is further improved.
Step S506, the management platform adopts a data stream coding mode based on a preset frame to code the access parameter information with the JSON format, so as to form a debugging instruction with the access parameter information.
Here, encoding the access parameter information with the JSON format by adopting a data stream encoding mode based on a preset frame, wherein the access parameter information is used for indicating a debugging parameter for debugging a program to be debugged at a server side, so after the access parameter information with the JSON format is obtained, the access parameter information with the JSON format can be encoded to realize format conversion of the access parameter information with the JSON format, and a debugging instruction containing the access parameter information is formed, wherein the debugging instruction is used for indicating the debugging of the program to be debugged of the server according to the debugging parameter.
In some embodiments, step S506 may be implemented by:
step S5061, adopting a data stream coding mode based on a TARS framework to code the access parameter information with JSON format on line, so as to form a debug instruction with the access parameter information.
Here, the preset framework is a TARS framework, which is a high-performance RPC development framework using a TARS protocol based on name service, and is matched with an integrated service management platform, so that individuals or enterprises can be helped to quickly construct stable and reliable distributed application in a micro-service mode. The TARS framework is an open source project summarizing the practical results of the total application framework (TAF, total Application Framework) of the microservice architecture. The TARS framework is a framework which has the advantages of easy use, high performance and service management. The design idea of the protocol layer at the bottommost layer of the TARS framework is to unify the protocols of service network communication, and develop a unified protocol which supports multiple platforms, expandability and automatic generation of protocol codes in an IDL mode. In the development process, a developer only needs to pay attention to the content of a protocol field of communication and does not need to pay attention to the implementation details of the protocol field, so that the problems of whether the protocol to be considered can be used in a cross-platform manner, whether compatibility, expansion and the like are possibly required in the process of developing the service are greatly solved.
In this embodiment of the present application, when encoding the access parameter information having JSON format by adopting a data stream encoding manner based on the tar framework, the access parameter information may be directly encoded on the line without downloading the access parameter information to the local area, so as to form a debug instruction having the access parameter information, which can greatly save network resources and improve encoding efficiency.
In step S507, the management platform sends the debug instruction to the server.
Step S508, the server debugs the program to be debugged based on the access parameter information.
Here, the debug instruction is used for indicating to debug the to-be-debugged program of the server according to the parameter access information, and when the server receives the debug instruction, the to-be-debugged program is debugged according to the parameter access information in the debug instruction, so as to obtain a debugged program which can be operated at the client normally.
In step S509, the server sends the debugged program obtained after the debugging to the client.
In step S510, the client runs the debugger.
According to the program debugging method provided by the embodiment of the application, after receiving the debugging request sent by the client, the management platform acquires the IDL file of the program to be debugged from the server according to the identification of the program to be debugged in the debugging request, analyzes the IDL file to obtain the access parameter information of the program to be debugged, encodes the access parameter information to obtain the debugging instruction, and sends the debugging instruction to the server, so that the server can debug the program to be debugged based on the debugging instruction. In addition, the access parameter information has a JSON format, so that the user can conveniently read and write the access parameter information, and meanwhile, the management platform can conveniently analyze the access parameter information, and the program debugging efficiency is further improved.
Based on fig. 4, fig. 5 is a schematic flowchart of an alternative program debugging method provided in an embodiment of the present application, as shown in fig. 5, after forming a debugging instruction with the access information in step S506, the method further includes the following steps:
in step S601, the management platform stores the debug instruction in a buffer.
Here, the buffer is an output buffer of the management platform, and after obtaining the debug instruction, the management platform may store the debug instruction in its own output buffer, so as to avoid a debug failure caused by directly sending the debug instruction to the server if the server is currently busy or is processing other services. When the server is idle, the debugging instruction is actively acquired from the buffer.
Step S602, the server obtains the debugging instruction from the buffer when idle, and debugs the program to be debugged based on the parameter entering and exiting information in the debugging instruction.
Here, the server includes at least any one of the following states: an idle state and a non-idle state, when the server is in the non-idle state, the server cannot immediately respond to a new debug instruction, and thus the debug instruction may be stored in a buffer; the server may respond to new debug instructions when the server is in an idle state, and therefore, the server may obtain new debug instructions from the buffer to respond when the server is idle, i.e., the server is currently in an idle state.
According to the program debugging method, the buffer is adopted to buffer the debugging instructions, when the server is in an idle state, the debugging instructions can be obtained from the buffer and responded, so that the server can be guaranteed to effectively respond to each debugging instruction, normal debugging of a program to be debugged is achieved, and response failure to a new debugging instruction caused by busy server is avoided.
Fig. 6 is a schematic flow chart of an alternative program debugging method provided in an embodiment of the present application, where the parameter information includes a debugging parameter of the program to be debugged, and as shown in fig. 6, the method includes the following steps:
in step S701, the management platform receives a debug request sent by the client, where the debug request includes an identifier of a program to be debugged.
Step S702, according to the identification of the program to be debugged, requesting the IDL file of the program to be debugged from the server.
Step S703, parsing the IDL file to obtain the parameter information of the program to be debugged.
Step S704, encoding the access parameter information to form a debugging instruction with the access parameter information.
Here, steps S701 to S704 are the same as steps S401 to S404 described above, and the embodiments of the present application will not be repeated.
Step S705, transmitting the debug instruction to the server, so that the server debugs the program to be debugged based on the debug parameter.
Here, the access parameter information includes a debug parameter of the program to be debugged, where the debug parameter is a parameter for debugging the program to be debugged at the server, and the server may debug the program to be debugged according to the debug parameter.
Fig. 7 is a schematic flow chart of an alternative program debugging method provided in an embodiment of the present application, where the access parameter information includes a predefined operation protocol of the program to be debugged, and as shown in fig. 7, the method includes the following steps:
in step S801, the management platform receives a debug request sent by the client, where the debug request includes an identifier of a program to be debugged.
Step S802, according to the identification of the program to be debugged, requesting an IDL file of the program to be debugged from a server.
Step 803, analyzing the IDL file to obtain the parameter information of the program to be debugged.
Step S804, encoding the access parameter information to form a debug instruction with the access parameter information.
Here, steps S801 to S804 are the same as steps S401 to S404 described above, and the embodiments of the present application will not be repeated.
And step S805, transmitting the debug instruction to the server, so that the server runs the program to be debugged according to the running protocol.
Here, the access parameter information includes a predefined operation protocol of the program to be debugged, where the operation protocol is used to specify an operation mode when the program to be debugged is operated. In this embodiment of the present application, after receiving a debug instruction, a server parses the debug instruction to obtain the running protocol, and runs the program to be debugged based on the running protocol.
In other embodiments, the running protocol may also be used to specify a running mode when the client runs the program to be debugged, and after the server receives the debug instruction, the server debugs the program to be debugged to obtain a debugger, and sends the debugger and the running protocol to the client, where the client runs the debugger according to the running mode specified by the running protocol.
Fig. 8 is a schematic flow chart of an alternative program debugging method provided in an embodiment of the present application, where the program to be debugged is an RPC program, as shown in fig. 8, and the method includes the following steps:
in step S901, the management platform receives a debug request sent by the client, where the debug request includes an identifier of the RPC program.
Step S902, according to the identification of the RPC program, requesting the IDL file of the RPC program from a server.
Step S903, analyzing the IDL file to obtain the parameter information of the RPC program.
Step S904, encoding the access parameter information to form a debug instruction with the access parameter information.
Here, step S901 to step S904 correspond to the above-described step S401 to step S404, except that, of the above-described step S401 to step S404, the step performed for the program to be debugged, and step S901 to step S904 are the steps performed for the RPC program.
Step S905, transmitting the debug instruction to the server by using an RPC communication manner, so that the server performs debugging on the RPC program based on the parameter access information in the debug instruction.
Here, the RPC program is a program corresponding to a service implemented by using an RPC technology. In this embodiment of the present application, for communication of the RPC program, communication between the management platform and the server, between the management platform and the client, and between the client and the server are generally implemented by adopting an RPC communication manner.
In this embodiment of the present invention, since the program to be debugged is an RPC program, the debug instruction is sent to the server by adopting an RPC communication method, and after the server receives the debug instruction, the server debugs the RPC program according to the parameter entering and exiting information in the debug instruction.
In the following, an exemplary application of the embodiments of the present application in a practical application scenario will be described.
The embodiment of the application provides a program debugging method, which constructs a data access server by simulating a client and converting an IDL file into a JSON object through a management platform, omits a large amount of time required for recompilation, client release, compiling and IDL file release, and achieves the aim of rapidly debugging an RPC program.
Fig. 9 is a schematic diagram of an implementation flow of program debugging in the related art, as shown in fig. 9, in which a client program is written, and a server program is accessed through an IDL-language compiled proxy file (i.e., proxy class), the method includes the following steps:
in step S1001, a client program is written in the client.
Step S1002, compiling the IDL file to generate a proxy file.
Here, when the IDL file is updated, the method further includes the steps of:
step S1003, recompile the IDL file.
In step S1004, the program on the server side is accessed through the proxy file.
Then, it is easy to get that, in the related art, for each modification of the server side, the client needs to be modified again, compiled, released, IDL modified, compiled, and released again. Obviously, this process is very time consuming, often taking tens of minutes to debug a change, and is prone to error.
According to the program debugging method, a management platform is adopted to simulate a client, and a data access server is constructed through JSON objects converted from IDL files. Because no client is provided and offline compiling of IDL files is not needed, the time for debugging a change of a server can be greatly shortened.
Fig. 10 is a schematic flowchart of an implementation process of program debugging in the embodiment of the present application, as shown in fig. 10, including the following steps:
in step S1101, the management platform converts the acquired IDL file into JSON objects.
In step S1102, the server is accessed through JSON object.
The IDL file of the RPC program generally supports manual decoding, and the embodiment of the application can omit the process of developing the client and compiling the IDL file in the client by manually decoding the access parameter information according to the requirement of the IDL file and then transmitting the called interface and method to the RPC protocol, thereby realizing the purpose of quickly debugging the RPC program.
This procedure will be described in detail below taking the TARS protocol (an RPC protocol) as an example:
fig. 11 is a schematic diagram of a procedure for invoking a program based on the TARS protocol in the related art, as shown in fig. 11, in the conventional method, for an IDL file 121 (for example, may be a xxx. TARS file), an IDL file compiling tool 122 (for example, a TARS2node tool) is required to convert the IDL file 121 into a proxy class (tarsProxy) 124 with detailed parameter information (params) 123, and then all parameter information is strictly defined by the proxy class, and the parameter information is encoded into a debug instruction by a data stream encoding tool (TARS-stream) 125 based on a TARS frame and stored in a buffer (buffer) 126 to perform RPC communication with a server 127. However, developing a client and compiling an IDL file take a lot of time.
Fig. 12 is a schematic diagram of a procedure call procedure based on a management platform in the embodiment of the present application, where the management platform is a platform for uniformly managing IDL files and RPC programs. As shown in fig. 12, the management platform 130 directly and automatically analyzes information such as modules, interfaces, methods and the like from the IDL file, and constructs the access parameter information 131 through the information, and the access parameter information in the embodiment of the present application uses JSON format, which is convenient and easy to read. After constructing the access parameter information 131, the access parameter information is encoded into debug instructions by the tors-stream tool 132, stored in the buffer 133, and RPC communication is performed with the server 134. Compared with the scheme in fig. 11, the method of the embodiment of the application has the advantages that a platform which needs to be developed and realized by a client is omitted, and the step of compiling IDL files to generate proxy classes in the client is omitted, so that the aim of quickly debugging RPC programs and improving development efficiency is fulfilled.
In the embodiment of the application, when the management platform is used for debugging the RPC program, the management platform can develop an interface debugging function, and then in the function, the information of a method, parameters and a module defined in an IDL file provided by the server can be directly communicated with and debugged by a service developed by the server, namely, the debugging of the RPC program can be directly carried out on the management platform, and the communication of a server side can be simulated according to the IDL file sent by the server.
In some embodiments, the management platform may also manage services of all clients, for example, some services need to be deployed on the management platform, and then provide the interface debug function directly to this service when deployed.
The program debugging method of the embodiment of the application can be applied to the following scenes: the management platform is equivalent to a website, and the server-side service can be deployed in the background of the website, i.e. the server-side service can be deployed on the management platform. For the method in the related art, if the service is to be debugged, some services need to be written to call the service, but by adopting the method provided by the embodiment of the application, the management platform can directly provide the interface debugging function, the service at the server side is deployed on the management platform, and the service can be directly debugged on the management platform without writing a new service to debug.
According to the program debugging method, on one hand, the problem that debugging is long in time consumption because the IDL file needs to be recompiled due to the fact that the server updates the program in the RPC program debugging process is solved, the client is omitted, the IDL file does not need to be compiled offline, and the time consumption for debugging once changing of the server is greatly shortened. On the other hand, since the program modification of the primary server side in the related art needs to undergo the complex processes of client side re-modification, compiling, publishing, IDL modification, re-compiling and re-distributing, the method of the embodiment of the application omits the steps, avoids potential error opportunities in the steps, and further avoids security risks.
Continuing with the description below of an exemplary architecture of the program debugging device 354 implemented as a software module provided in embodiments of the present application, in some embodiments, as shown in fig. 2, the software module stored in the program debugging device 354 of the memory 350 may be a program debugging device in the management terminal 100, including:
a receiving module 3541, configured to receive a debug request sent by a client, where the debug request includes an identifier of a program to be debugged;
a request module 3542, configured to request, from a server, an IDL file of the program to be debugged according to the identifier of the program to be debugged;
the parsing module 3543 is configured to parse the IDL file to obtain parameter information of the program to be debugged;
the encoding module 3544 is configured to encode the access parameter information to form a debug instruction with the access parameter information;
and the sending module 3545 is configured to send the debug instruction to the server, so that the server debugs the program to be debugged based on the parameter access information.
In some embodiments, the encoding module is further to: converting the access parameter information into access parameter information with a JSON format; and encoding the access parameter information with the JSON format by adopting a data stream encoding mode based on a preset frame to form a debugging instruction with the access parameter information.
In some embodiments, the encoding module is further to: and encoding the access parameter information with the JSON format on line by adopting a data stream encoding mode based on a TARS framework to form a debugging instruction with the access parameter information.
In some embodiments, the apparatus further comprises: and the storage module is used for storing the debugging instruction in a buffer after the debugging instruction is formed, so that the server obtains the debugging instruction from the buffer when idle, and debugs the program to be debugged based on parameter entering and exiting information in the debugging instruction.
In some embodiments, the access parameter information includes debug parameters of the program to be debugged; correspondingly, the sending module is further configured to: and sending the debugging instruction to the server so that the server can debug the program to be debugged based on the debugging parameters.
In some embodiments, the access parameter information includes a predefined running protocol of the program to be debugged; correspondingly, the sending module is further configured to: and sending the debugging instruction to the server so that the server runs the program to be debugged according to the running protocol.
In some embodiments, the program to be debugged is an RPC program; correspondingly, the sending module is further configured to: and sending the debugging instruction to the server by adopting an RPC communication mode, so that the server debugs the RPC program based on the parameter entering and exiting information in the debugging instruction.
It should be noted that, the description of the apparatus in the embodiment of the present application is similar to the description of the embodiment of the method described above, and has similar beneficial effects as the embodiment of the method, so that a detailed description is omitted. For technical details not disclosed in the embodiments of the present apparatus, please refer to the description of the embodiments of the method of the present application for understanding.
The present embodiments provide a computer readable storage medium having stored therein executable instructions that, when executed by a processor, cause the processor to perform a method provided by the embodiments of the present application, for example, as shown in fig. 3.
In some embodiments, the computer readable storage medium may be a ferroelectric Memory (FRAM, ferro magnetic Random Access Memory), a Read Only Memory (ROM), a programmable Read Only Memory (PROM, programmable Read Only Memory), an erasable programmable Read Only Memory (EPROM, erasable Programmable Read Only Memory), an electrically erasable programmable Read Only Memory (EEPROM, electrically Erasable Programmable Read Only Memory), a flash Memory, a magnetic surface Memory, an optical Disk, or a Compact Disk-Read Only Memory (CD-ROM), among others; but may be a variety of devices including one or any combination of the above memories.
In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, the executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code). As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or, alternatively, distributed across multiple sites and interconnected by a communication network.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. that are within the spirit and scope of the present application are intended to be included within the scope of the present application.

Claims (9)

1. A program debugging method, comprising:
the method comprises the steps that a management platform receives a debugging request sent by a client, wherein the debugging request comprises an identification of a program to be debugged;
requesting an IDL file of the program to be debugged from a server according to the identification of the program to be debugged;
analyzing the IDL file to obtain parameter entering and exiting information of the program to be debugged;
converting the access parameter information into access parameter information with a JSON format;
encoding the access parameter information with the JSON format by adopting a data stream encoding mode based on a preset frame to form a debugging instruction with the access parameter information;
and sending the debugging instruction to the server so that the server debugs the program to be debugged based on the access parameter information.
2. The method of claim 1, wherein the encoding the parameter information in JSON format by using a data stream encoding manner based on a preset frame to form a debug instruction with the parameter information comprises:
And encoding the access parameter information with the JSON format on line by adopting a data stream encoding mode based on a TARS framework to form a debugging instruction with the access parameter information.
3. The method according to claim 1, wherein the method further comprises:
after the debugging instructions are formed, the debugging instructions are stored in a buffer, so that the server obtains the debugging instructions from the buffer when in idle state, and the program to be debugged is debugged based on parameter entering and exiting information in the debugging instructions.
4. A method according to any one of claims 1 to 3, wherein the access parameter information comprises debugging parameters of the program to be debugged;
correspondingly, the sending the debug instruction to the server, so that the server debugs the program to be debugged based on the access parameter information, including:
and sending the debugging instruction to the server so that the server can debug the program to be debugged based on the debugging parameters.
5. A method according to any one of claims 1 to 3, wherein the access parameter information comprises a predefined running protocol of the program to be debugged;
Correspondingly, the sending the debug instruction to the server, so that the server debugs the program to be debugged based on the access parameter information, including:
and sending the debugging instruction to the server so that the server runs the program to be debugged according to the running protocol.
6. A method according to any one of claims 1 to 3, wherein the program to be debugged is an RPC program;
correspondingly, the sending the debug instruction to the server, so that the server debugs the program to be debugged based on the access parameter information, including:
and sending the debugging instruction to the server by adopting an RPC communication mode, so that the server debugs the RPC program based on the parameter entering and exiting information in the debugging instruction.
7. A program debugging device, comprising:
the receiving module is used for receiving a debugging request sent by the client, wherein the debugging request comprises an identification of a program to be debugged;
the request module is used for requesting an IDL file of the program to be debugged from a server according to the identification of the program to be debugged;
The analysis module is used for analyzing the IDL file to obtain the parameter entering and exiting information of the program to be debugged;
the encoding module is used for converting the access parameter information into access parameter information with a JSON format; encoding the access parameter information with the JSON format by adopting a data stream encoding mode based on a preset frame to form a debugging instruction with the access parameter information;
and the sending module is used for sending the debugging instruction to the server so that the server can debug the program to be debugged based on the access parameter information.
8. A program debugging device, comprising:
a memory for storing executable instructions; a processor for implementing the method of any one of claims 1 to 6 when executing executable instructions stored in said memory.
9. A computer readable storage medium storing executable instructions for causing a processor to perform the method of any one of claims 1 to 6.
CN201911076001.3A 2019-11-06 2019-11-06 Program debugging method, device, equipment and computer readable storage medium Active CN112783748B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911076001.3A CN112783748B (en) 2019-11-06 2019-11-06 Program debugging method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911076001.3A CN112783748B (en) 2019-11-06 2019-11-06 Program debugging method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112783748A CN112783748A (en) 2021-05-11
CN112783748B true CN112783748B (en) 2024-02-20

Family

ID=75747515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911076001.3A Active CN112783748B (en) 2019-11-06 2019-11-06 Program debugging method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112783748B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113364747B (en) * 2021-05-24 2022-10-21 深圳市航顺芯片技术研发有限公司 Debugging method, device and system and data set generation method and device
CN114328197A (en) * 2021-12-17 2022-04-12 中国银联股份有限公司 Applet plug-in debugging method, system and computer readable storage medium
CN116069668B (en) * 2023-03-07 2023-06-09 中科方德软件有限公司 Debugging method, device, equipment and storage medium for distributed compiling construction task

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1320012A2 (en) * 2001-12-12 2003-06-18 Pervasive Security Systems Inc. System and method for providing distributed access control to secured items
CN103226504A (en) * 2013-04-19 2013-07-31 中国科学院自动化研究所 Distributed on-chip debugging system
CN104035859A (en) * 2013-03-07 2014-09-10 腾讯科技(深圳)有限公司 Visualized automatic testing method and system thereof
CN107832045A (en) * 2017-10-16 2018-03-23 北京京东尚科信息技术有限公司 Across the method and apparatus of programming language interface conversion
US10466981B1 (en) * 2017-06-06 2019-11-05 Prattle Analytics, LLC System and method for generative programming in an integrated development environment (IDE)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1320012A2 (en) * 2001-12-12 2003-06-18 Pervasive Security Systems Inc. System and method for providing distributed access control to secured items
CN104035859A (en) * 2013-03-07 2014-09-10 腾讯科技(深圳)有限公司 Visualized automatic testing method and system thereof
CN103226504A (en) * 2013-04-19 2013-07-31 中国科学院自动化研究所 Distributed on-chip debugging system
US10466981B1 (en) * 2017-06-06 2019-11-05 Prattle Analytics, LLC System and method for generative programming in an integrated development environment (IDE)
CN107832045A (en) * 2017-10-16 2018-03-23 北京京东尚科信息技术有限公司 Across the method and apparatus of programming language interface conversion

Also Published As

Publication number Publication date
CN112783748A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
CN112783748B (en) Program debugging method, device, equipment and computer readable storage medium
WO2020233369A1 (en) Method for improving software integration system on basis of simulated port, and related device
US7739697B2 (en) System and method for creating web services from an existing web site
US20120233589A1 (en) Software development kit for blended services
CN111177617A (en) Web direct operation and maintenance method and device based on operation and maintenance management system and electronic equipment
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN102323880A (en) Mobile phone application interface development method and terminal based on browser parsing mode
EP4119207A1 (en) Vibration control method and apparatus, and electronic device and computer-readable storage medium
JP2021197153A (en) Method and apparatus for recognizing word slot, electronic apparatus, storage medium and computer program
US20180275957A1 (en) Assistive technology for code generation using voice and virtual reality
CN114117190A (en) Data processing method, data processing device, storage medium and electronic equipment
KR20230079348A (en) Cloud code development system, method, device, device and storage medium
CN113778897B (en) Automatic test method, device and equipment for interface and storage medium
Mendes et al. Experiment lab server architecture: A web services approach to supporting interactive LabVIEW-based remote experiments under MIT's iLab shared architecture
Touhafi et al. CoderLabs: A cloud‐based platform for real‐time online labs with user collaboration
KR20210042283A (en) Data processing method, device, equipment and medium for applet
KR102555258B1 (en) Method and apparatus for identifying user, storage medium, and electronic device
CN110548285B (en) Game communication control method and device, medium and electronic equipment
CN114637531A (en) Method and device for dynamically generating application program interface
JP2024508412A (en) Generating natural language interfaces from graphical user interfaces
CN113542323B (en) Service processing method, device, equipment and computer readable storage medium
CN111813407B (en) Game development method, game running device and electronic equipment
CN113485927A (en) Test data generation method, device, equipment and storage medium
CN111949265A (en) Data processing method and device and electronic equipment
CN111782196A (en) MVP architecture-based development method and device

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