CN111061623B - Method, device, middle server, storage medium and system for debugging program - Google Patents

Method, device, middle server, storage medium and system for debugging program Download PDF

Info

Publication number
CN111061623B
CN111061623B CN201910631678.2A CN201910631678A CN111061623B CN 111061623 B CN111061623 B CN 111061623B CN 201910631678 A CN201910631678 A CN 201910631678A CN 111061623 B CN111061623 B CN 111061623B
Authority
CN
China
Prior art keywords
program
target
program segment
client
result
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
CN201910631678.2A
Other languages
Chinese (zh)
Other versions
CN111061623A (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.)
Huakong Tsingjiao Information Technology Beijing Co Ltd
Original Assignee
Huakong Tsingjiao Information Technology Beijing 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 Huakong Tsingjiao Information Technology Beijing Co Ltd filed Critical Huakong Tsingjiao Information Technology Beijing Co Ltd
Priority to CN201910631678.2A priority Critical patent/CN111061623B/en
Publication of CN111061623A publication Critical patent/CN111061623A/en
Application granted granted Critical
Publication of CN111061623B publication Critical patent/CN111061623B/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/366Software debugging using diagnostics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • 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)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application provides a method, a device, a middle server, a storage medium and a system for debugging a program, and aims to more accurately locate an abnormal position in the program when writing the program based on ciphertext. The method is applied to a middle server in a program debugging system, and comprises the following steps: receiving a program segment execution request sent by the client, wherein the program segment execution request carries a target program segment in a program to be debugged; the target program segment is sent to a background server; obtaining a program segment execution result from the background server, wherein the program segment execution result is a plaintext result obtained after the background server sequentially executes a part of program and a result display function when the target program segment comprises the part of program and the result display function; and sending the plaintext result to the client.

Description

Method, device, middle server, storage medium and system for debugging program
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for debugging a program, a middle server, a storage medium and a system.
Background
In a program scenario where ciphertext is written, variables in the program are encrypted. When a developer writes a program by using programming software, the developer usually debugs a section of the program after the section of the program is written. The specific debugging method is as follows: and by executing the section of program and observing the plaintext result of the ciphertext variable output after the program is executed, determining whether the section of program has an abnormality or not. If the section of program has an exception, the developer needs to look at the code line by line to locate the exception location.
In the case of shorter programs, the developer may be able to locate the exception location from a small number of code lines with less effort. However, in general, the length of the program is long, and the number of code lines in the program is huge. Therefore, in general, a developer needs to pay more labor to locate an abnormal position from a huge number of code lines, which results in low debugging efficiency, affects programming efficiency, and is difficult to ensure the correctness of codes in a program.
Disclosure of Invention
The embodiment of the application provides a method, a device, a middle server, a storage medium and a system for debugging a program, and aims to more accurately and more rapidly locate an abnormal position in the program when writing the program based on ciphertext.
The first aspect of the embodiment of the application provides a method for debugging a program, which is applied to a middle server in a program debugging system, wherein the program debugging system further comprises a client and a background server, the client is in communication connection with the middle server, and the middle server is in communication connection with the background server; the method comprises the following steps:
receiving a program segment execution request sent by the client, wherein the program segment execution request carries a target program segment in a program to be debugged, and the target program segment is any one of a plurality of program segments obtained by the client after the program to be debugged is segmented according to the received breakpoint setting information;
responding to the program segment execution request, and sending the target program segment to a background server;
obtaining a program segment execution result from the background server, wherein the program segment execution result is a plaintext result obtained after the background server sequentially executes a part of program and a result display function when the target program segment comprises the part of program and the result display function, the value of a ciphertext variable is obtained by executing the part of program, and the plaintext result is obtained by converting the value of the ciphertext variable by executing the result display function;
And sending the plaintext result to the client.
Optionally, the background server includes a plurality of computing nodes and a plurality of data nodes; the method further comprises the steps of:
distributing a target computing node for the program to be debugged from the plurality of computing nodes;
distributing target data nodes for the program to be debugged from the plurality of data nodes;
wherein, responding to the program segment execution request, the target program segment is sent to a background server, comprising:
transmitting the target program segment to the target computing node in response to the program segment execution request;
the method for obtaining the program segment execution result from the background server comprises the following steps:
receiving value prompt information sent by the target computing node;
responding to the value prompt information and sending a value request to the target data node;
and obtaining the program segment execution result stored by the target data node, wherein the program segment execution result is stored after the target data node responds to the value-taking request to obtain the program segment execution result from the target computing node.
Optionally, the method further comprises:
Configuring a first identifier for the program to be debugged, and sending the first identifier to the client;
the receiving the program segment execution request sent by the client comprises the following steps:
receiving a program segment execution request carrying the first identifier and a target program segment sent by the client;
wherein, responding to the program segment execution request, the target program segment is sent to a background server, comprising:
responding to the program segment execution request, and sending the first identifier and the target program segment to the background server, so that the background server returns a program segment execution result carrying the first identifier after the target program segment is executed;
the method for obtaining the program segment execution result from the background server comprises the following steps:
obtaining a program segment execution result carrying the first identifier from the background server;
wherein sending the plaintext result to the client comprises:
and determining the client corresponding to the first identifier, and sending the program segment execution result to the determined client.
Optionally, the background server includes a plurality of computing nodes and a plurality of data nodes; the method further comprises the steps of:
Distributing target computing nodes corresponding to the first identifiers from the plurality of computing nodes, and distributing target data nodes corresponding to the first identifiers from the plurality of data nodes;
transmitting the first identifier and the target program segment to the background server in response to the program segment execution request, including:
determining a target computing node and a target data node corresponding to the first identifier in response to the program segment execution request;
and sending the first identifier and the target program segment to the target computing node, so that the target computing node finishes executing the target program segment, and the target data node stores a program segment execution result carrying the first identifier.
Optionally, sending the plaintext result to the client, including:
obtaining a state result representing the running state of the background server;
combining the plaintext result with the state result to obtain a calculation result;
and sending the calculation result comprising the plaintext result to the client.
Optionally, the method further comprises:
under the condition that a data set query request sent by the client is received, sending a data set list to the client, wherein the data set list comprises a plurality of data sets and a second identifier corresponding to each data set;
And under the condition that a data set binding request sent by the client is received, binding a target data set corresponding to a second identifier with a ciphertext variable in the program to be debugged according to the second identifier carried by the data set binding request so as to initialize the value of the ciphertext variable by using the target data set through the background server.
Optionally, the method further comprises:
and setting a storage area for storing the plaintext results for the program to be debugged, wherein the storage area is not overlapped with the storage areas for storing the plaintext results corresponding to other programs to be debugged.
Optionally, the method further comprises:
when the target program segment is a calculation program, obtaining a null result obtained by executing the calculation program from the background server, and sending the null result to the client;
and when the target program segment is the exit program, acquiring a null result obtained by executing the exit program from the background server, and transmitting the null result to the client.
The second aspect of the embodiment of the application provides a device for debugging a program, which is applied to a middle server in a program debugging system, wherein the program debugging system further comprises a client and a background server, the client is in communication connection with the middle server, and the middle server is in communication connection with the background server; the device comprises:
The receiving module is used for receiving a program segment execution request sent by the client, wherein the program segment execution request carries a target program segment in a program to be debugged, and the target program segment is any one of a plurality of program segments obtained after the client segments the program to be debugged according to the received breakpoint setting information;
the first sending module is used for responding to the program segment execution request and sending the target program segment to a background server;
the acquisition module is used for acquiring a program segment execution result from the background server, wherein the program segment execution result is a plaintext result obtained after the background server sequentially executes a part of program and a result display function when the target program segment comprises the part of program and the result display function, the value of a ciphertext variable is obtained by executing the part of program, and the plaintext result is obtained by converting the value of the ciphertext variable by executing the result display function; the method comprises the steps of,
and the second sending module is used for sending the plaintext result to the client.
Optionally, the background server includes a plurality of computing nodes and a plurality of data nodes; the apparatus further comprises:
The first distribution module is used for distributing target computing nodes for the program to be debugged from the plurality of computing nodes;
the second allocation module is used for allocating a target data node for the program to be debugged from the plurality of data nodes;
wherein, the first sending module includes:
a first sending sub-module, configured to send the target program segment to the target computing node in response to the program segment execution request;
wherein, the acquisition module includes:
the first receiving sub-module is used for receiving the value prompt information sent by the target computing node;
the second sending submodule is used for responding to the value prompt information and sending a value request to the target data node;
and the first acquisition sub-module is used for acquiring the program segment execution result stored by the target data node, wherein the program segment execution result is stored after the target data node responds to the value request to acquire the program segment execution result from the target computing node.
Optionally, the apparatus further comprises:
the identification configuration module is used for configuring a first identification for the program to be debugged and sending the first identification to the client;
Wherein the receiving module comprises:
the second receiving sub-module is used for receiving a program segment execution request carrying the first identifier and the target program segment sent by the client;
wherein, the first sending module includes:
the second sending submodule is used for responding to the program segment execution request and sending the first identifier and the target program segment to the background server so that the background server returns a program segment execution result carrying the first identifier after the target program segment is executed;
wherein, the acquisition module includes:
the second acquisition sub-module is used for acquiring a program segment execution result carrying the first identifier from the background server;
wherein the second transmitting module includes:
and the first determining submodule is used for determining the client corresponding to the first identifier and sending the program segment execution result to the determined client.
Optionally, the background server includes a plurality of computing nodes and a plurality of data nodes; the apparatus further comprises:
a third allocation module, configured to allocate a target computing node corresponding to the first identifier from the plurality of computing nodes, and allocate a target data node corresponding to the first identifier from the plurality of data nodes;
Wherein, the first sending module includes:
a second determining submodule, configured to determine a target computing node and a target data node corresponding to the first identifier in response to the program segment execution request;
and the third sending sub-module is used for sending the first identifier and the target program segment to the target computing node so that the target computing node can execute the target program segment and the target data node can store the program segment execution result carrying the first identifier.
Optionally, the second sending module includes:
the third acquisition sub-module is used for acquiring a state result representing the running state of the background server;
the combining sub-module is used for combining the plaintext result with the state result to obtain a calculation result;
and the fourth sending submodule is used for sending the calculation result comprising the plaintext result to the client.
Optionally, the apparatus further comprises:
the third sending module is used for sending a data set list to the client under the condition that a data set query request sent by the client is received, wherein the data set list comprises a plurality of data sets and a second identifier corresponding to each data set;
And the data set binding module is used for binding a target data set corresponding to a second identifier with the ciphertext variable in the program to be debugged according to the second identifier carried by the data set binding request under the condition that the data set binding request sent by the client is received, so that the background server utilizes the target data set to initialize the value of the ciphertext variable.
Optionally, the apparatus further comprises:
the storage area setting module is used for setting a storage area for storing the plaintext results for the program to be debugged, and the storage area is not overlapped with the storage area for storing the plaintext results corresponding to other programs to be debugged.
Optionally, the apparatus further comprises:
a fourth sending module, configured to obtain, when the target program segment is a calculation program, a null result obtained by executing the calculation program from the background server, and send the null result to the client;
and the fifth sending module is used for obtaining a null result obtained by executing the exit program from the background server and sending the null result to the client when the target program segment is the exit program.
A third aspect of the embodiments of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method according to the first aspect of the present application.
A fourth aspect of the embodiment of the present application provides a middle server, including a memory, a processor and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect of the application when executing the computer program.
A fifth aspect of an embodiment of the present application provides a program debug system, including: the system comprises a client, a middle server and a background server, wherein the client is in communication connection with the middle server, and the middle server is in communication connection with the background server; the intermediate server is configured to perform the steps of the method according to the first aspect of the present application.
By adopting the method for debugging the program, which is provided by the embodiment of the application, after the middle server receives the target program segment in the multi-segment program segments of the program to be debugged, which is sent by the client, the target program segment is sent to the background server for execution. Under the condition that the target program segment comprises a result display function, the background server obtains the value of the ciphertext variable by executing part of the program and the result display function in sequence, converts the value of the ciphertext variable into a plaintext result, and the middle server obtains the plaintext result from the background server and transfers the plaintext result to the client.
In a program scene based on ciphertext, by executing the method for debugging the program provided by the embodiment of the application, for each program segment in a plurality of program segments of the program to be debugged, a plaintext result after the execution of the program segment can be obtained under the condition that the program segment comprises a result display function, and after the plaintext result is transferred to a client side from a background server, a program developer can judge the correctness of the small program segment according to the plaintext result. Therefore, the method provided by the embodiment of the application is beneficial to locating the abnormal position from the whole program to be debugged more quickly and accurately, thereby improving the programming efficiency and ensuring the correctness of codes in the program.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for debugging a program according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a program debug system according to an embodiment of the present application;
FIG. 3 is an example of a program to be debugged according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a program debug system according to another embodiment of the present application;
FIG. 5 is a flow chart of a method for debugging a program according to another embodiment of the present application;
FIG. 6 is a flow chart of a method for debugging a program according to another embodiment of the present application;
FIG. 7 is a schematic diagram of a program debug system according to another embodiment of the present application;
FIG. 8 is a schematic diagram of a device for debugging a program according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described below are some, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Applicants have found that in the related art, in the context of writing a ciphertext-based program, variables in the program are typically encrypted by an encryption function. When debugging the program, a developer can obtain the plaintext result calculated in the last step in the program only after the whole program is completely executed, namely, can check plaintext data of ciphertext variables only after the whole program is completely executed. If the program has abnormality, the developer has difficulty in accurately and rapidly locating the abnormality position in the program, influencing the programming efficiency and ensuring the correctness of the codes in the program.
Based on the above findings, the applicant has proposed some solutions to the above problems, and has an objective of locating the abnormal position in the program more accurately and more quickly when writing the ciphertext-based program.
Referring to fig. 1, fig. 1 is a flowchart of a method for debugging a program according to an embodiment of the present application. The method is applied to a middle server in a program debugging system, and referring to fig. 2, fig. 2 is a schematic diagram of the program debugging system according to an embodiment of the present application. As shown in fig. 2, the program debugging system includes a client, a middle server, and a background server. The number of the clients can be one or more, each client is in communication connection with a middle server, and the middle server is in communication connection with a background server.
As shown in fig. 1 and 2, the method comprises the steps of:
step S11: and receiving a program segment execution request sent by the client, wherein the program segment execution request carries a target program segment in a program to be debugged, and the target program segment is any one of a plurality of program segments obtained by the client after the program to be debugged is segmented according to the received breakpoint setting information.
In this embodiment, the client is software that can interact with a user and can segment a program to be debugged into a plurality of program segments according to breakpoint setting information input by the user. For example, the client may be jupyter notbook, ipython, or the like programming software.
In this embodiment, the target program segment received by the middle server may be one program segment that the client sequentially sends to the middle server according to the sequence of the program segments.
Referring to fig. 3, fig. 3 is an example of a program to be debugged according to an embodiment of the present application. Taking the program shown in fig. 3 as an example, a developer writes the program in a ciphertext-based scene by using a client, so as to encrypt variables a1, a2, a3, a4, and a5 in the program. As shown in fig. 3, the developer encrypts the variable using encryption functions of pp.sint (), pp.iarr (), and the like. The developer inputs breakpoint setting information to the client, and the client segments the program into a plurality of program segments according to the breakpoint setting information. As shown in FIG. 3, the program is split into five program segments, i.e., in [5], in [6], in [7], in [8], and in [9], respectively, wherein in [5], in [6], etc. are displayed as a UI element on a screen as a client, so that a user can more quickly distinguish the position of each breakpoint. It should be understood that the encryption functions pp.sint (), pp.iarr (), etc. shown in fig. 3 are only examples of one of a variety of alternative encryption functions, and are not intended to limit the present application.
When the program to be debugged shown in FIG. 3 is debugged, the middle server sequentially receives program segments such as in [5], in [6], in [7], in [8] and in [9] sent by the client. Specifically, the middle server firstly receives the in [5] program segment sent by the client, and after the in [5] program segment is debugged, receives the in [6] program segment sent by the client, so that the in [6] program segment is debugged.
Step S12: and responding to the program segment execution request, and sending the target program segment to a background server.
Taking the program to be debugged shown in fig. 3 as an example, assuming that the program segment execution request carries the in [6] program segment, the middle server sends the in [6] program segment to the background server for execution.
Step S13: and obtaining a program segment execution result from the background server, wherein the program segment execution result is a plaintext result obtained after the background server sequentially executes the partial program and the result display function under the condition that the target program segment comprises the partial program and the result display function, the value of a ciphertext variable is obtained by executing the partial program, and the plaintext result is obtained by converting the value of the ciphertext variable by executing the result display function.
In this embodiment, a part of the program is used to calculate the ciphertext variable, thereby obtaining the value of the ciphertext variable; the result presentation function is used to convert the values of the ciphertext variable into plaintext results.
Taking in [6] program segment in the to-be-debugged program shown in fig. 3 as an example, where res, a1 and a2 are all ciphertext variables, the background server calculates to obtain a value of the ciphertext variable res by executing a code "res=a1×a2", and then converts the value of the ciphertext variable res into a plaintext result by executing a code "pp. It should be understood that the pp.debug_real () function shown in fig. 3 is only an example of one of a variety of alternative result presentation functions and is not intended to limit the present application.
Step S14: and sending the plaintext result to the client.
In the above method including steps S11 to S14, information interaction may be performed between the middle server and the client based on the HTTP protocol, and information interaction may be performed between the middle server and the back server based on the GRPC protocol (Google Remote Procedure Call Protocol). It should be understood that the information interaction protocol adopted among the client, the middle server and the background server is not limited to the above examples, which should not be construed as limiting the present application.
In the case of writing a ciphertext-based program scenario, by executing the method including steps S11 to S14, for each of a plurality of program segments of a program to be debugged, a test may be performed separately, and in the case that a result display function is included in the program segment, a plaintext result after the program segment is executed may be obtained, and after the foreground server obtains the plaintext result from the background server and forwards the plaintext result to the client, a program developer may determine the correctness of the small program segment according to the plaintext result. Therefore, the method provided by the embodiment of the application is beneficial to locating the abnormal position from the whole program to be debugged more quickly and accurately, thereby improving the programming efficiency and ensuring the correctness of codes in the program.
Referring to fig. 4, fig. 4 is a schematic diagram of a program debugging system according to another embodiment of the present application. The background server of the program debug system may comprise a plurality of compute nodes and a plurality of data nodes, only one compute node (for example, the compute node is a target compute node) and one data node (for example, the data node is a target data node) being schematically shown in fig. 4 for simplicity of the drawing.
The target computing node is used for executing codes of target program segments, and the target data node is used for temporarily storing program segment execution results, such as plaintext results, of the target computing node. The plurality of computing nodes may be distributed among a plurality of computers, and the plurality of data nodes may also be distributed among a plurality of computers. The same computer may include at least one computing node, or may further include at least one data node. In the above case, the background server may be understood as a sum of a plurality of computers.
In the case that the background server includes a plurality of computing nodes and a plurality of data nodes, referring to fig. 5, fig. 5 is a flowchart of a method for debugging a program according to another embodiment of the present application.
As shown in fig. 4 and 5, the method comprises the steps of:
Step S51: and distributing a target computing node for the program to be debugged from the plurality of computing nodes.
Considering that the middle server may simultaneously face multiple clients and perform parallel processing for respective programs to be debugged of the multiple clients, by executing step S51, a target computing node is allocated to each program to be debugged, so that not only can parallel computing be implemented, but also the debugging efficiency can be improved, and the running stability of the inside of the background server can be ensured.
In this embodiment, the middle server selects at least one computing node in an available state from a plurality of computing nodes, and determines the selected computing node as a target computing node to be allocated to the program to be debugged. Wherein, the available state refers to the computing node not in the shutdown or downtime state.
The middle server can periodically receive and store heartbeat information sent by each computing node, wherein the heartbeat information characterizes the state of the computing node. For example, in the case that the intermediate server does not receive heartbeat information of a certain computing node for a plurality of times, the state of the computing node can be updated from the available state to the unavailable state, and when the computing node is allocated to a subsequent program to be debugged, the computing node in the unavailable state is not allocated to the program to be debugged.
Step S52: and distributing target data nodes for the program to be debugged from the plurality of data nodes.
In this embodiment, the allocated target data node is used to temporarily store a program segment execution result obtained by the target computing node after the target program segment is executed.
In the present embodiment, the order of step S51 and step S52 is interchangeable. Steps S51 and S52 can be regarded as a preparation work performed by the intermediate server by the program debugging system before debugging the program to be debugged. Taking the program to be debugged shown in fig. 3 as an example, the middle server allocates at least one computing node and at least one data node to the program to be debugged in advance through step S51 and step S52. After step S51 and step S52, the program debugging system starts debugging for program segments in [5] to in [9], respectively.
Step S53: and transmitting the target program segment to the target computing node in response to the program segment execution request.
In this embodiment, by executing step S53, the middle server is caused to transmit the target program segment to the background server.
Taking the program to be debugged shown in fig. 3 as an example, assume that the middle server allocates the 12 th computing node of the 50 computing nodes to the program to be debugged. When the middle server receives a program segment execution request carrying an in 6 program segment sent by a client, the middle server sends the in 6 program segment to a 12 th computing node for execution.
Step S54: and receiving the value prompt information sent by the target computing node.
In this embodiment, the value prompt information received by the middle server is sent to the middle server by the target computing node after the target program segment is executed.
Step S55: and responding to the value prompt information, and sending a value request to the target data node.
In this embodiment, after receiving the value prompt information, the middle server characterizes that the target computing node has executed the target program segment, and generates a program segment execution result, that is, a plaintext result. The middle server sends a value-taking request to the target data node, so that the target data node obtains a program segment execution result from the target computing node after receiving the value-taking request.
Step S56: and obtaining the program segment execution result stored by the target data node, wherein the program segment execution result is stored after the target data node responds to the value-taking request to obtain the program segment execution result from the target computing node.
In this embodiment, the target data node responds to the value request sent by the middle server, and determines, from a plurality of computing nodes in the background server, a target computing node serving the same program to be debugged through computing node identification information sent in advance by the middle server, so that the target data node can communicate with the target computing node, and a program segment execution result is obtained. The computing node identification information may be an IP address, a port number, etc. of the computing node. The middle server stores the computing node identification information of each computing node, and the computing node identification information acquired by the target data node can be information carried by the configuration information when the middle server sends the configuration information to the target data node after distributing the target computing node and the target data node for the program to be debugged. Or the computer identification information may be information carried by the value request when the middle server sends the value request to the target data node.
In this embodiment, by executing steps S54 to S56, the middle server obtains the program segment execution result from the background server. And in steps S54 to S56, the target computing node and the target data node operate in a split-work manner, wherein the target computing node is used for executing the target program segment, and the target data node is used for temporarily storing the execution result of the program segment and interacting with the intermediate server, so that the execution result of the program segment is returned to the intermediate server. Under the condition of the division cooperation of the target computing node and the target data node, the parallel performance of the program debugging system is improved, the debugging efficiency is improved, and the stability of a background server is enhanced.
Considering that the middle server may face a plurality of clients at the same time, and parallel processing is performed for each program to be debugged of the plurality of clients. In order to enable the middle server to distinguish the multiple programs to be debugged in parallel, in this embodiment, the middle server may configure a first identifier for each program to be debugged, where the first identifiers of the programs to be debugged are different from each other. With reference to fig. 6, fig. 6 is a flowchart illustrating a method for debugging a program according to another embodiment of the present application.
As shown in fig. 6, the method may include step S10 in addition to steps S11 to S14. Wherein, step S10: and configuring a first identifier for the program to be debugged, and sending the first identifier to the client.
In this embodiment, step S10 may be regarded as a preparation task performed by the middle server by the program debugging system before debugging the program to be debugged. Taking the program to be debugged shown in fig. 3 as an example, the middle server configures a first identifier for the program to be debugged in advance through step 10. After step S10, the program debugging system starts debugging for program segments in [5] to in [9], respectively.
For example, before the client performs debugging on the program to be debugged through the middle server and the background server, the client may send a debugging request to the middle server in advance, and the middle server responds to the debugging request, so as to configure a first identifier for the program to be debugged of the client.
Or, for example, before the client performs debugging on the program to be debugged through the middle server and the background server, the client sends a data set binding request to the middle server in advance, so that the middle server responds to the data set binding request, and a data set list is sent to the client, so that the client can bind the data set for the ciphertext variable in the program to be debugged according to the data set list, and when the background server executes the program section, the ciphertext variable is initialized according to the bound data set. The middle server responds to the data set binding request, so that a first identifier can be configured for the program to be debugged of the client.
After the first identifier is configured for the program to be debugged in step S10, in order to enable the middle server to perform information interaction with the client or the background server later, the middle server can determine which specific program to be debugged in the multiple programs to be debugged according to the received information sent by the client or the background server. Therefore, when the middle server performs information interaction with the client or the background server, the first identification of the corresponding program to be debugged can be carried in each piece of interaction information.
For example, in step S11, the middle server receives the program segment execution request sent by the client, which may specifically include: and the middle server receives a program segment execution request carrying the first identifier and the target program segment sent by the client.
For example, in step S12, the middle server sends the target program segment to the background server in response to the program segment execution request, which may specifically include: the middle server responds to the program segment execution request and sends the first identifier and the target program segment to the background server, so that the background server returns a program segment execution result carrying the first identifier after the target program segment is executed.
The background server can comprise a plurality of computing nodes and a plurality of data nodes, the middle server allocates a target computing node for the program to be debugged from the computing nodes in advance, and allocates a target data node for the program to be debugged from the data nodes. The first identification of the program to be debugged corresponds to the target computing node, and the first identification of the program to be debugged corresponds to the target data node.
When the middle server responds to the program segment execution request and sends the first identifier and the target program segment to the background server, the method specifically comprises the following steps:
determining a target computing node and a target data node corresponding to the first identifier in response to the program segment execution request; and sending the first identifier and the target program segment to the target computing node, so that the target computing node finishes executing the target program segment, and the target data node stores a program segment execution result carrying the first identifier.
For example, in step S13, the middle server obtains the program segment execution result from the background server, which may specifically include: and obtaining a program segment execution result carrying the first identifier from the background server.
For example, in step S14, the middle server sends the plaintext result to the client, which may specifically include: and determining the client corresponding to the first identifier, and sending the program segment execution result to the determined client.
Taking the program to be debugged shown in fig. 3 as an example, assume that the first identifier configured by the middle server for the program to be debugged is ts0021, and after the middle server sends the first identifier ts0021 to the client, the preparation process of the middle server before the program is debugged is characterized to be completed. After receiving the first identifier ts0021, the client starts to send program segments from in [5] to in [9] to the middle server one by one, so that the program segments are transferred to the background server for execution through the middle server. Taking the program segment in [6] as an example, the client sends a program segment execution request carrying a first identifier ts0021 and the program segment in [6] to the middle server.
After receiving the program segment execution request, the middle server determines a target computing node corresponding to the first identifier ts0021 in a plurality of computing nodes of the background server according to the first identifier ts0021 carried by the program segment execution request. The intermediate server transmits the first identification ts0021 and the program segment in [6] to the target computing node. After the target computing node executes the program section in [6], the target computing node sends a value prompt message to the middle server. And the middle server responds to the value prompt information and sends a value request to the target data node corresponding to the first identifier ts 0021. The target data node responds to the value request, and obtains and stores the program segment execution result carrying the first identifier ts0021 from the target computing node. The middle server obtains the program segment execution result carrying the first identifier ts0021 from the target data node, and determines a corresponding program to be debugged according to the first identifier ts0021, thereby determining a client corresponding to the program to be debugged. And the middle server sends the program segment execution result to the client.
It should be understood that the application is not limited to the examples described above. For example, after receiving a program segment execution request carrying a first identifier ts0021 and a program segment in [6], the intermediate server determines, according to the first identifier ts0021, a target computing node corresponding to the first identifier ts0021 from a plurality of computing nodes of the background server, and then may send only the program segment in [6] to the target computing node. After receiving the value prompt information sent by the target computing node, the intermediate server may send a value request carrying the first identifier ts0021 to the corresponding target data node. The target data node responds to the value request, acquires a program segment execution result from the target computing node, and returns the program segment execution result and a first identifier ts0021 carried by the value request to the middle server.
It is considered that before debugging is performed on a program to be debugged, ciphertext variables in the program to be debugged need to be initialized. One possible implementation is: ciphertext variables are manually initialized. Another possible implementation is: the debugging efficiency is improved by executing the method in advance through the middle server. Specifically, the middle server may perform the following steps in advance before performing the above step S11, or before performing the above step S10, or before performing the above step S51:
Under the condition that a data set query request sent by the client is received, sending a data set list to the client, wherein the data set list comprises a plurality of data sets and a second identifier corresponding to each data set;
and under the condition that a data set binding request sent by the client is received, binding a target data set corresponding to a second identifier with a ciphertext variable in the program to be debugged according to the second identifier carried by the data set binding request so as to initialize the value of the ciphertext variable by using the target data set through the background server.
Taking the program to be debugged shown in fig. 3 as an example, the client sends a data set query request to the middle server. The server responds to the data set query request and sends a data set list to the client, and the client receives and displays the data set list to a developer. And the client receives the binding information input by the developer and forms a data set binding request according to the binding information. Assuming that the developer selects the second 3 ten thousand artificial resource data set identified as sjj006 in the data set list and binds the data set to the ciphertext variable a1 in the program to be debugged shown in fig. 3, the data set binding request carries at least the second identifier sjj006. The client sends the data set binding request to the middle server, and the middle server binds the ciphertext variable a1 with the 3 ten thousand artificial resource data set according to a second identifier sjj006 carried by the data set binding request. When debugging is performed on a specific program segment later, the target computing node executing the program segment obtains a second identifier sjj006 corresponding to the ciphertext variable a1, and determines a corresponding data node according to the second identifier sjj006, wherein the data node stores specific values of the 3 ten thousand manual resource data set. The target computing node reads the specific numerical value of the 3 ten thousand human resource data set, so as to initialize the ciphertext variable a 1.
The middle server performs the steps, so that a developer can directly utilize the existing data set of the program debugging system or the data set from other databases. On one hand, the debugging efficiency can be improved, and the labor cost is reduced; on the other hand, the data sets can comprise a plurality of numerical values, and the data sets comprising the numerical values are utilized for initializing the ciphertext variable, so that the initial value of the ciphertext variable is random, the false detection risk caused by single detection data can be effectively reduced, and the detection accuracy is improved.
In the case that the error code exists in the target program segment when the background server executes the target program segment, the execution of the error code may cause the state of the background server to change. Therefore, the state result representing the running state of the background server can reflect the correctness of the target program segment to a certain extent. Based on the above consideration, the middle server may specifically include the following steps when sending the plaintext result to the client:
obtaining a state result representing the running state of the background server;
combining the plaintext result with the state result to obtain a calculation result;
and sending the calculation result comprising the plaintext result to the client.
Illustratively, characterizing the operating state of the background server may be: the target computing node, upon executing the error code in the target program segment, causes a disconnection of communication with the intermediate server, such as a disconnection of a GRPC connection between the target data node and the intermediate server. Alternatively, characterizing the operating state of the background server may also be: and the target computing node does not match the corresponding data set from the data nodes according to the second identifier corresponding to the ciphertext variable.
The middle server combines the plaintext result and the state result and sends the combined calculation result to the client, so that a developer can more comprehensively grasp the execution condition of the target program section, and the abnormal position is more accurately positioned from the program to be debugged.
Considering that the middle server may face a plurality of clients at the same time, parallel processing is performed on each program to be debugged of the plurality of clients, and program segment execution results of target program segments of each program to be debugged are stored at the same time. Since variable names of ciphertext variables in each target program segment may overlap, in order to avoid confusion of program segment execution results when variable names of a plurality of ciphertext variables are the same, the middle server may execute the following steps:
And setting a storage area for storing the plaintext results for the program to be debugged, wherein the storage area is not overlapped with the storage areas for storing the plaintext results corresponding to other programs to be debugged.
For example, the middle server may set a storage area for the program to be debugged in advance before debugging is performed for all program segments of the program to be debugged. Taking the program to be debugged shown in fig. 3 as an example, the middle server sets a storage area for the program to be debugged in advance, and then starts to debug program segments in [5] to in [9] one by one.
The above embodiments are based on the case where a result presentation function is included in the target program segment. While some program segments in the program to be debugged may not include the result presentation function.
For example, in the case that the target program segment is a calculation program, the middle server obtains a null result obtained by executing the calculation program from the background server, and sends the null result to the client.
For example, when the target program segment is the exit program, the middle server obtains a null result obtained by executing the exit program from the background server, and transmits the null result to the client. In addition, the background server can release the corresponding relation with the program to be debugged after the execution of the exit program. Similarly, the target data node may also release the correspondence with the program to be debugged.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a program debugging system according to another embodiment of the present application, and fig. 7 shows an information interaction process among a client, a middle server and a background server in the above embodiments. In fig. 7, the center server may be specifically divided into a first center and a second center. The first middle station is mainly responsible for information interaction with the client. The second middle stage is mainly responsible for interacting with a target computing node and a target data node of the background server under the condition that the target program segment comprises a part of programs and a result display function, so that the execution result of the program segment is obtained. And after the second intermediate station acquires the program segment execution result, the program segment execution result is sent to the first intermediate station, so that the program segment execution result is transferred to the client through the first intermediate station.
As shown in fig. 7, the client sends a data set query request to the first intermediate station, and the first intermediate station queries its own stored data set list in response to the data set query request and returns it to the client. The client side displays the data set list to the developer, and forms a data set binding request according to the selection information input by the developer, wherein the data set binding request carries a second identification of the data set selected by the developer. And then, the first middle stage allocates a target computing node for the program to be debugged of the client from a plurality of computing nodes of the background server, and allocates a target data node for the program to be debugged of the client from a plurality of data nodes of the background server.
As shown in fig. 7, in order to distinguish respective programs to be debugged of the plurality of clients, the first intermediate station configures a first identifier for each program to be debugged of the client. In addition, the first intermediate station sends initialization information to the second intermediate station, so that the second intermediate station allocates storage space for the program to be debugged, and the second intermediate station establishes communication connection, such as grpc long connection, with the target data node. After the initialization is completed, the second intermediate station sends first response execution information to the first intermediate station, and the first intermediate station characterizes that the initialization is executed.
As shown in fig. 7, the first intermediate station further sends first configuration information to the target computing node, so that the target computing node is configured, and returns second response execution information to indicate that the target computing node is configured. The first configuration information may include an IP address or a port number of the target data node. The first intermediate station also sends second configuration information to the target data node to enable the target data node to be configured, and returns third response execution information to characterize that the target data node is configured. The second configuration information may include an IP address or a port number of the target computing node. After that, the first middle station returns the configured first identification to the client, and the preparation work of the characterization middle station server is finished.
The interaction process can be regarded as a preparation process of the middle server before debugging the program to be debugged. Thereafter, as shown in fig. 7, the client starts to send a program segment execution request to the first intermediate station, where each program segment execution request sent by the client carries not only the target program segment but also the first identifier. And under the condition that the target program segment is a calculation program, the first middle station transfers the target program segment to a corresponding target calculation node and receives a null result obtained by the target calculation node after the target program segment is executed. The first intermediate station returns the null result to the client.
In the case where the target program segment includes a result presentation function, the first intermediate station transmits the target program segment to the target computing node. And after the target computing node executes the target program segment and obtains a plaintext result, sending a value prompt message to the second middle station. And the second middle station responds to the value prompt information and sends a first value request to the target data node. And the target data node responds to the first value request, and sends a second value request to the target computing node, so that a plaintext result is obtained, and the plaintext result is returned to the second middle station. The second intermediate station stores the plaintext results and concatenates them with state results characterizing the operating state of the backend server. And the second intermediate station sends the spliced plaintext result to the first intermediate station, so that the first intermediate station transfers the plaintext result to the client.
And under the condition that the target program segment is an exit program, the first middle station transfers the target program segment to a corresponding target computing node and receives a null result obtained by the target computing node after the target program segment is executed. The first intermediate station returns the null result to the client.
Based on the same inventive concept, an embodiment of the present application provides an apparatus for debugging a program. Referring to fig. 8, fig. 8 is a schematic diagram of an apparatus for debugging a program according to an embodiment of the present application. The device is applied to a middle server in a program debugging system, and the program debugging system further comprises a client and a background server, wherein the client is in communication connection with the middle server, and the middle server is in communication connection with the background server. As shown in fig. 8, the apparatus includes:
a receiving module 81, configured to receive a program segment execution request sent by the client, where the program segment execution request carries a target program segment in a program to be debugged, where the target program segment is any one of a plurality of program segments obtained by the client after cutting the program to be debugged according to the received breakpoint setting information;
a first sending module 82, configured to send the target program segment to a background server in response to the program segment execution request;
An obtaining module 83, configured to obtain a program segment execution result from the background server, where the program segment execution result is a plaintext result obtained after the background server sequentially executes a part of a program and a result display function when the target program segment includes the part of the program and the result display function, where a value of a ciphertext variable is obtained by executing the part of the program, and the value of the ciphertext variable is converted to obtain the plaintext result by executing the result display function; the method comprises the steps of,
a second sending module 84, configured to send the plaintext result to the client.
Optionally, the background server includes a plurality of computing nodes and a plurality of data nodes; the apparatus further comprises:
the first distribution module is used for distributing target computing nodes for the program to be debugged from the plurality of computing nodes;
the second allocation module is used for allocating a target data node for the program to be debugged from the plurality of data nodes;
wherein, the first sending module includes:
a first sending sub-module, configured to send the target program segment to the target computing node in response to the program segment execution request;
Wherein, the acquisition module includes:
the first receiving sub-module is used for receiving the value prompt information sent by the target computing node;
the second sending submodule is used for responding to the value prompt information and sending a value request to the target data node;
and the first acquisition sub-module is used for acquiring the program segment execution result stored by the target data node, wherein the program segment execution result is stored after the target data node responds to the value request to acquire the program segment execution result from the target computing node.
Optionally, the apparatus further comprises:
the identification configuration module is used for configuring a first identification for the program to be debugged and sending the first identification to the client;
wherein the receiving module comprises:
the second receiving sub-module is used for receiving a program segment execution request carrying the first identifier and the target program segment sent by the client;
wherein, the first sending module includes:
the second sending submodule is used for responding to the program segment execution request and sending the first identifier and the target program segment to the background server so that the background server returns a program segment execution result carrying the first identifier after the target program segment is executed;
Wherein, the acquisition module includes:
the second acquisition sub-module is used for acquiring a program segment execution result carrying the first identifier from the background server;
wherein the second transmitting module includes:
and the first determining submodule is used for determining the client corresponding to the first identifier and sending the program segment execution result to the determined client.
Optionally, the background server includes a plurality of computing nodes and a plurality of data nodes; the apparatus further comprises:
a third allocation module, configured to allocate a target computing node corresponding to the first identifier from the plurality of computing nodes, and allocate a target data node corresponding to the first identifier from the plurality of data nodes;
wherein, the first sending module includes:
a second determining submodule, configured to determine a target computing node and a target data node corresponding to the first identifier in response to the program segment execution request;
and the third sending sub-module is used for sending the first identifier and the target program segment to the target computing node so that the target computing node can execute the target program segment and the target data node can store the program segment execution result carrying the first identifier.
Optionally, the second sending module includes:
the third acquisition sub-module is used for acquiring a state result representing the running state of the background server;
the combining sub-module is used for combining the plaintext result with the state result to obtain a calculation result;
and the fourth sending submodule is used for sending the calculation result comprising the plaintext result to the client.
Optionally, the apparatus further comprises:
the third sending module is used for sending a data set list to the client under the condition that a data set query request sent by the client is received, wherein the data set list comprises a plurality of data sets and a second identifier corresponding to each data set;
and the data set binding module is used for binding a target data set corresponding to a second identifier with the ciphertext variable in the program to be debugged according to the second identifier carried by the data set binding request under the condition that the data set binding request sent by the client is received, so that the background server utilizes the target data set to initialize the value of the ciphertext variable.
Optionally, the apparatus further comprises:
the storage area setting module is used for setting a storage area for storing the plaintext results for the program to be debugged, and the storage area is not overlapped with the storage area for storing the plaintext results corresponding to other programs to be debugged.
Optionally, the apparatus further comprises:
a fourth sending module, configured to obtain, when the target program segment is a calculation program, a null result obtained by executing the calculation program from the background server, and send the null result to the client;
and the fifth sending module is used for obtaining a null result obtained by executing the exit program from the background server and sending the null result to the client when the target program segment is the exit program.
Based on the same inventive concept, another embodiment of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method according to any of the above embodiments of the present application.
Based on the same inventive concept, another embodiment of the present application provides a middle server, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor executes the computer program to implement the steps in the method according to any one of the foregoing embodiments of the present application.
Based on the same inventive concept, another embodiment of the present application provides a program debugging system, the program debugging system comprising: the system comprises a client, a middle server and a background server, wherein the client is in communication connection with the middle server, and the middle server is in communication connection with the background server; the middle server is used for executing the steps in the method according to any embodiment of the application.
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 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 referred to 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.
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 method, the device, the middle server, the storage medium and the system for debugging the program provided by the application are described in detail, and specific examples are applied to the explanation of the principle and the implementation mode of the application, and the explanation of the above examples is only used for helping to understand the method and the core idea of the 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 (11)

1. The method for debugging the program is characterized by being applied to a middle server in a program debugging system, wherein the program debugging system further comprises a client and a background server, the client is in communication connection with the middle server, and the middle server is in communication connection with the background server; the method comprises the following steps:
receiving a program segment execution request sent by the client, wherein the program segment execution request carries a target program segment in a program to be debugged, and the target program segment is any one of a plurality of program segments obtained by the client after the program to be debugged is segmented according to the received breakpoint setting information;
Responding to the program segment execution request, and sending the target program segment to a target computing node of a background server; the background server comprises a plurality of computing nodes and a plurality of data nodes;
distributing a target computing node for the program to be debugged from the plurality of computing nodes;
distributing target data nodes for the program to be debugged from the plurality of data nodes;
obtaining a program segment execution result from the background server, including: receiving value prompt information sent by the target computing node; responding to the value prompt information and sending a value request to the target data node; obtaining the program segment execution result stored by the target data node, wherein the program segment execution result is stored after the target data node responds to the value-taking request and obtains the program segment execution result from the target computing node;
the program segment execution result is a plaintext result obtained after the background server sequentially executes the partial program and the result display function under the condition that the target program segment comprises the partial program and the result display function, wherein the partial program is executed to obtain a value of a ciphertext variable, and the result display function is executed to convert the value of the ciphertext variable to obtain the plaintext result;
And sending the plaintext result to the client.
2. The method according to claim 1, wherein the method further comprises:
configuring a first identifier for the program to be debugged, and sending the first identifier to the client;
the receiving the program segment execution request sent by the client comprises the following steps:
receiving a program segment execution request carrying the first identifier and a target program segment sent by the client;
wherein, responding to the program segment execution request, the target program segment is sent to a background server, comprising:
responding to the program segment execution request, and sending the first identifier and the target program segment to the background server, so that the background server returns a program segment execution result carrying the first identifier after the target program segment is executed;
the method for obtaining the program segment execution result from the background server comprises the following steps:
obtaining a program segment execution result carrying the first identifier from the background server;
wherein sending the plaintext result to the client comprises:
and determining the client corresponding to the first identifier, and sending the program segment execution result to the determined client.
3. The method of claim 2, wherein the background server comprises a plurality of computing nodes and a plurality of data nodes; the method further comprises the steps of:
distributing target computing nodes corresponding to the first identifiers from the plurality of computing nodes, and distributing target data nodes corresponding to the first identifiers from the plurality of data nodes;
wherein, in response to the program segment execution request, sending the first identifier and the target program segment to the background server includes:
determining a target computing node and a target data node corresponding to the first identifier in response to the program segment execution request;
and sending the first identifier and the target program segment to the target computing node, so that the target computing node finishes executing the target program segment, and the target data node stores a program segment execution result carrying the first identifier.
4. The method of claim 1, wherein sending the plaintext result to the client comprises:
obtaining a state result representing the running state of the background server;
combining the plaintext result with the state result to obtain a calculation result;
And sending the calculation result comprising the plaintext result to the client.
5. The method according to claim 1, wherein the method further comprises:
under the condition that a data set query request sent by the client is received, sending a data set list to the client, wherein the data set list comprises a plurality of data sets and a second identifier corresponding to each data set;
and under the condition that a data set binding request sent by the client is received, binding a target data set corresponding to a second identifier with a ciphertext variable in the program to be debugged according to the second identifier carried by the data set binding request so as to initialize the value of the ciphertext variable by using the target data set through the background server.
6. The method according to claim 1, wherein the method further comprises:
and setting a storage area for storing the plaintext results for the program to be debugged, wherein the storage area is not overlapped with the storage areas for storing the plaintext results corresponding to other programs to be debugged.
7. The method according to claim 1, wherein the method further comprises:
When the target program segment is a calculation program, obtaining a null result obtained by executing the calculation program from the background server, and sending the null result to the client;
and when the target program segment is the exit program, acquiring a null result obtained by executing the exit program from the background server, and transmitting the null result to the client.
8. The device for debugging the program is characterized by being applied to a middle server in a program debugging system, wherein the program debugging system further comprises a client and a background server, the client is in communication connection with the middle server, and the middle server is in communication connection with the background server; the device comprises:
the receiving module is used for receiving a program segment execution request sent by the client, wherein the program segment execution request carries a target program segment in a program to be debugged, and the target program segment is any one of a plurality of program segments obtained after the client segments the program to be debugged according to the received breakpoint setting information;
the first sending module is used for responding to the program segment execution request and sending the target program segment to a target computing node of a background server; the background server comprises a plurality of computing nodes and a plurality of data nodes;
The first distribution module is used for distributing target computing nodes for the program to be debugged from the plurality of computing nodes;
the second allocation module is used for allocating a target data node for the program to be debugged from the plurality of data nodes;
the acquisition module is used for acquiring a program segment execution result from the background server, and is specifically used for: receiving value prompt information sent by the target computing node; responding to the value prompt information and sending a value request to the target data node; obtaining the program segment execution result stored by the target data node, wherein the program segment execution result is stored after the target data node responds to the value-taking request and obtains the program segment execution result from the target computing node;
the program segment execution result is a plaintext result obtained after the background server sequentially executes the partial program and the result display function under the condition that the target program segment comprises the partial program and the result display function, wherein the partial program is executed to obtain a value of a ciphertext variable, and the result display function is executed to convert the value of the ciphertext variable to obtain the plaintext result; the method comprises the steps of,
And the second sending module is used for sending the plaintext result to the client.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
10. A mid-range server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
11. A program debugging system, the program debugging system comprising: the system comprises a client, a middle server and a background server, wherein the client is in communication connection with the middle server, and the middle server is in communication connection with the background server; said intermediate server being adapted to perform the steps of the method according to any one of claims 1 to 7.
CN201910631678.2A 2019-07-12 2019-07-12 Method, device, middle server, storage medium and system for debugging program Active CN111061623B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910631678.2A CN111061623B (en) 2019-07-12 2019-07-12 Method, device, middle server, storage medium and system for debugging program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910631678.2A CN111061623B (en) 2019-07-12 2019-07-12 Method, device, middle server, storage medium and system for debugging program

Publications (2)

Publication Number Publication Date
CN111061623A CN111061623A (en) 2020-04-24
CN111061623B true CN111061623B (en) 2023-08-22

Family

ID=70297408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910631678.2A Active CN111061623B (en) 2019-07-12 2019-07-12 Method, device, middle server, storage medium and system for debugging program

Country Status (1)

Country Link
CN (1) CN111061623B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297218B (en) * 2021-05-20 2022-01-07 广州光点信息科技有限公司 Multi-system data interaction method, device and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598599A (en) * 2016-12-15 2017-04-26 王弘远 Program execution method and device
CN107678938A (en) * 2017-08-24 2018-02-09 阿里巴巴集团控股有限公司 The adjustment method and equipment of a kind of application program
CN109976997A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 Test method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10613964B2 (en) * 2017-05-04 2020-04-07 Microsoft Technology Licensing, Llc Conditional debugging of server-side production code

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598599A (en) * 2016-12-15 2017-04-26 王弘远 Program execution method and device
CN107678938A (en) * 2017-08-24 2018-02-09 阿里巴巴集团控股有限公司 The adjustment method and equipment of a kind of application program
CN109976997A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 Test method and device

Also Published As

Publication number Publication date
CN111061623A (en) 2020-04-24

Similar Documents

Publication Publication Date Title
US9658942B2 (en) Dynamic tracing framework for debugging in virtualized environments
CN104765678B (en) The method and device tested the application on mobile terminal device
CN111159049B (en) Automatic interface testing method and system
CN111026635B (en) Software project testing system, method, device and storage medium
CN109376088B (en) Automatic test system and automatic test method
CN110032507B (en) Application program testing method, device and system, electronic equipment and storage medium
CN106383764B (en) A kind of collecting method and equipment
CN111045919B (en) Method, device, background server, storage medium and system for debugging program
CN110413329A (en) IOT equipment remote debugging method, apparatus and system
CN112988608B (en) Data testing method and device, computer equipment and storage medium
CN113672441B (en) Method and device for testing intelligent equipment
CN110532021B (en) Processing method of configuration file of distributed control system, client and service device
CN110582750A (en) system and method for task scheduling and device management
CN110493028A (en) A kind of clustered deploy(ment) method, system, device and computer readable storage medium
CN111026627A (en) Pressure testing method and device and server
CN111061623B (en) Method, device, middle server, storage medium and system for debugging program
CN110018956A (en) Using adjustment method and relevant apparatus
CN111966556A (en) Performance pressure measurement method and device, server and computer readable storage medium
CN110380936B (en) Test method and device
CN111045918B (en) Method, device, client, storage medium and system for debugging program
CN111008143B (en) Coverage rate scheduling test method, terminal equipment and computer readable storage medium
CN107015906B (en) Test method and device, port generation method, port generator and test system
JP7157335B2 (en) API adapter test system, API adapter test support device, API adapter test support method, and API adapter test support program
CN108874596A (en) server stability test method and server
CN115993977A (en) Application deployment 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