CN116521225A - Code repairing method and device and computing device cluster - Google Patents

Code repairing method and device and computing device cluster Download PDF

Info

Publication number
CN116521225A
CN116521225A CN202310376365.3A CN202310376365A CN116521225A CN 116521225 A CN116521225 A CN 116521225A CN 202310376365 A CN202310376365 A CN 202310376365A CN 116521225 A CN116521225 A CN 116521225A
Authority
CN
China
Prior art keywords
repair
code
suggestion
user
repairing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310376365.3A
Other languages
Chinese (zh)
Inventor
曾沐焓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huawei Cloud Computing Technology Co ltd
Original Assignee
Shenzhen Huawei Cloud Computing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Huawei Cloud Computing Technology Co ltd filed Critical Shenzhen Huawei Cloud Computing Technology Co ltd
Priority to CN202310376365.3A priority Critical patent/CN116521225A/en
Publication of CN116521225A publication Critical patent/CN116521225A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/72Code refactoring

Abstract

The application provides a code repairing method, a device and a computing device cluster, wherein the method comprises the following steps: acquiring a first code and a first repair suggestion provided by a user, wherein the first repair suggestion corresponds to the first code; repairing the first code according to the first repair suggestion. Since the repair suggestion provided by the user can be referred to in the repair process of the first code, the code repair method meeting the repair wish of the user can be provided, and thus the repair accuracy can be improved.

Description

Code repairing method and device and computing device cluster
Technical Field
The present disclosure relates to the field of cloud services, and in particular, to a method and an apparatus for repairing codes, and a computing device cluster.
Background
The automatic defect repairing technology is an important research direction of modern software engineering. The method aims to automatically repair defects in the program, so that the repaired program can normally operate. The accurate defect repair technology can greatly save the time consumed by a developer in repairing defects, and is beneficial to aspects such as software development and testing. Depending on cloud service, the defect automatic repair technology can be applied to an online evaluation (OJ) system to realize online repair of codes.
Current code repair techniques perform automatic repair of codes based on test defects of the code to be repaired. For example, in the repairing process, the correct code can be referred to repair the code to be repaired, at least one repaired code is obtained, and the repairing result is selected from the repaired codes through the existing code set. However, in the current automatic repair scheme, the repair will of the code by the user is not fully considered, so that the repair result is inconsistent with the repair result expected by the user, and the repair accuracy is reduced.
Disclosure of Invention
The application provides a code repairing method, a code repairing device and a computing device cluster, which are used for providing the code repairing method meeting user repairing will and improving repairing accuracy.
In a first aspect, a code repair method is provided. The method may be implemented by a repair device (or code repair device). The repair means may be a cloud service device running a code repair cloud service or a terminal device running a code repair application, or may be a component of a cloud service device or a component of a terminal device. The components in the present application may include, for example, at least one of a chip, a chip system, a processor, a transceiver, a processing unit, or a transceiver unit. Taking the example that the execution subject is a repairing device, the method can be realized by the following steps: the method comprises the steps that a repairing device obtains a first code and a first repairing suggestion provided by a user, wherein the first repairing suggestion corresponds to the first code; the restoration device restores the first code according to the first restoration suggestion.
Based on the method, the repairing device refers to the first repairing suggestion provided by the user in the repairing process of the first code, and can provide the code repairing method meeting the repairing wish of the user, so that the repairing accuracy can be improved, and the participation of the user in the code repairing process can be improved.
In one possible implementation, the first repair suggestion may include a repair location suggestion and/or a repair manner suggestion.
The repair location suggestion is used for indicating a location to be repaired, and the repair mode suggestion can be used for indicating a repair mode.
In one possible implementation, the repair device may obtain a reference code, obtain a second repair suggestion based on the reference code, and repair the first code based on the first repair suggestion and the second repair suggestion.
Based on the implementation mode, the repairing device can repair the first code according to the historical reference code so as to improve repairing accuracy.
Wherein the reference code comprises a correct code and/or an error code.
In a possible implementation, the reference code includes an error code, and the repair device may determine the second repair suggestion according to a repair record corresponding to the error code.
Based on the implementation mode, the repairing device can repair the first code according to the history repairing scheme corresponding to the history error code so as to improve repairing accuracy.
In one possible implementation manner, the repairing device may further determine a first repairing scheme according to the first repairing proposal and the first code, provide the first repairing scheme to a user, obtain a third repairing proposal provided by the user for the first repairing scheme, and repair the first code according to the third repairing proposal.
Based on the implementation mode, the repairing device can further consider a third repairing suggestion from a user in the process of repairing the first code, so that a repairing result meets the user wish, the repairing accuracy is improved, and the participation of the user in the process of repairing the code is improved.
In one possible implementation, the repair device may determine a first repair scheme based on the first repair suggestion, the reference code, and the first code.
In one possible implementation, the repair device may further determine a second repair scheme according to the reference code and the first code, and provide the second repair scheme to a user, wherein the first repair suggestion is a repair suggestion for the second repair scheme.
Based on this implementation, the first repair suggestion may be a suggestion that the user proposes for a second repair solution provided by the repair device.
In one possible implementation, the repairing device may further determine the reference code according to a feature of the first code, where the feature includes a code statement feature and/or a code execution information feature.
Based on the implementation, the repairing device can determine the reference code according to the characteristic query of the first code so as to improve the efficiency and accuracy of the reference code acquisition process.
In one possible implementation, the repair device may also present the repair result of the first code to the user.
In a second aspect, a code repair method is provided. The method may be implemented by a cloud service device (or a component of a cloud service device) and a terminal device (or a component of a terminal device). Taking the example that the execution subject is cloud service equipment and terminal equipment, the method can be realized by the following steps: the cloud service equipment acquires a first code and a first repair suggestion provided by a user from terminal equipment, wherein the first repair suggestion corresponds to the first code; the cloud service equipment repairs a first code according to the first repair suggestion; the cloud service equipment sends a repair result of the first code to the terminal equipment; and the terminal equipment displays the repair result of the first code to a user.
In one possible implementation, the first repair suggestion may include a repair location suggestion and/or a repair manner suggestion.
In one possible implementation, the cloud service apparatus may obtain a reference code, and obtain a second repair suggestion according to the reference code. The cloud service device may also repair the first code according to the first repair suggestion and the second repair suggestion.
Wherein the reference code comprises a correct code and/or an error code.
In one possible implementation, the reference code includes an error code, and the cloud service apparatus may determine the second repair suggestion according to a repair record corresponding to the error code.
In one possible implementation manner, the cloud service device may determine a first repair scheme according to the first repair proposal and the first code, and send the first repair scheme to the terminal device. The terminal device can provide the first repair scheme for a user and acquire a third repair suggestion provided by the user for the first repair scheme. The terminal device may also send the third repair suggestion to the cloud service device. The cloud service apparatus may further repair the first code according to the third repair suggestion.
In one possible implementation, the cloud service apparatus may further determine a first repair scheme according to the first repair suggestion, the reference code, and the first code.
In one possible implementation manner, the cloud service device may determine a second repair scheme according to the reference code and the first code, and send the second repair scheme to the terminal device, where the first repair suggestion is a repair suggestion for the second repair scheme. The terminal device may also provide the second repair scheme to the user.
In one possible implementation manner, the cloud service device may further determine the reference code according to a feature of the first code, where the feature includes a code statement feature and/or a code execution information feature.
The effects of the above second aspect and the various possible implementations thereof may be referred to the description of the effects of the first aspect and the various possible implementations thereof, and are not repeated.
In a third aspect, a code repair apparatus is provided. The apparatus may implement the method of the first aspect and any possible designs thereof. The device has the function of the repairing device.
In an alternative implementation manner, the apparatus may include modules corresponding to the methods/operations/steps/actions described in the first aspect, where the modules may be implemented by hardware circuits, by software, or by a combination of hardware circuits and software. In an alternative implementation, the apparatus includes a processing unit (sometimes also referred to as a processing module) and a communication unit (sometimes also referred to as a transceiver module, a communication module, etc.). The transceiver unit can realize a transmission function and a reception function, and may be referred to as a transmission unit (sometimes referred to as a transmission module) when the transceiver unit realizes the transmission function, and may be referred to as a reception unit (sometimes referred to as a reception module) when the transceiver unit realizes the reception function. The transmitting unit and the receiving unit may be the same functional module, which is called a transceiver unit, and which can implement a transmitting function and a receiving function; alternatively, the transmitting unit and the receiving unit may be different functional modules, and the transmitting and receiving unit is a generic term for these functional modules.
For example, when the apparatus is used to perform the method described in the first aspect, the apparatus may comprise a communication unit and a processing unit.
In a fourth aspect, embodiments of the present application also provide a code repair apparatus comprising a processor for executing a computer program (or computer executable instructions) stored in a memory, which when executed, causes the apparatus to perform a method as in the first aspect and its respective possible implementations.
In one possible implementation, the processor and memory are integrated together;
in another possible implementation, the memory is located outside the device.
The apparatus also includes a communication interface for the apparatus to communicate with other devices, such as the transmission or reception of data and/or signals. By way of example, the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface.
In a fifth aspect, there is provided a computer readable storage medium storing a computer program or instructions which, when executed, cause the method of the first or second aspect and any possible implementation thereof to be carried out.
In a sixth aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the method of the first or second aspect and any possible implementation thereof to be carried out.
In a seventh aspect, embodiments of the present application further provide a code repairing apparatus, configured to perform the method in the first aspect or the second aspect and various possible implementations thereof.
In an eighth aspect, a cluster of computing devices is provided, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is configured to perform the method of the above-described first or second aspect and its various possible implementations.
A ninth aspect provides a communication system, which may comprise a cloud service device and a terminal device, such that the communication system implements the method as in the second aspect and its various possible implementations.
Technical effects brought about by the second to ninth aspects may be referred to the description of the first aspect, and are not repeated here.
Drawings
Fig. 1 is a schematic architecture diagram of a cloud service system provided in the present application;
fig. 2 is a schematic flow chart of a code repairing method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a processing procedure of a reference code according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another code repair method according to an embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating another code repair method according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a deployment method of a repair device according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a deployment method of another repair device according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of a web interface of an online evaluation system according to an embodiment of the present application;
FIG. 9 is a schematic illustration of an IDE interface provided in an embodiment of the present application;
fig. 10 is a schematic structural diagram of a repairing device according to an embodiment of the present application;
FIG. 11 is a schematic structural diagram of a repair system according to an embodiment of the present disclosure;
FIG. 12 is a schematic diagram of a computing device according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a computing device cluster according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of another computing device cluster according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a communication method and device. The method and the device are based on the same inventive concept, and because the principles of solving the problems by the method and the device are similar, the implementation of the device and the method can be referred to each other, and the repetition is not repeated. In the description of the embodiment of the present application, "and/or" describing the association relationship of the association object indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. Reference to at least one in this application refers to one or more; plural means two or more. In addition, it should be understood that in the description of this application, the words "first," "second," and the like are used merely for distinguishing between the descriptions and not for indicating or implying any relative importance or order.
The communication method provided by the embodiment of the application can be applied to a cloud service (or called cloud computing service) system. The cloud service refers to a cloud computing product which can be provided as a service, and comprises a cloud host, cloud storage, a database, a network, software, analysis, intelligence and other services. The service results of the cloud service may be provided to the user over a network.
As shown in fig. 1, a user may request and acquire a cloud service through a carrier such as a terminal device. The terminal equipment is connected with the server corresponding to the cloud service through a network. In fig. 1, a terminal apparatus 10 and a server 20 are illustrated as an example. The terminal device 10 may be a mobile phone, a tablet computer, a notebook computer, a personal computer, or the like, and the server 20 may be any server device and software system capable of supporting corresponding cloud resource allocation.
The network may be a local area network, a wide area network through relay (relay) equipment, or the like. When the network is a local area network, the communication network may be a wireless fidelity (wireless fidelity, wifi) hotspot network, a Bluetooth (BT) network, a near field communication technology (near field communication, NFC) network, or the like, by way of example. When the communication network is a wide area network, the network may be, for example, a third generation mobile communication technology (3 rd-generation wireless telephone technology, 3G) network, a fourth generation mobile communication technology (the 4th generation mobile communication technology,4G) network, a fifth generation mobile communication technology (5 th-generation mobile communication technology, 5G) network, a future evolution public land mobile network (public land mobile network, PLMN) or the internet, etc., or applied to various communication systems in the future, such as a sixth generation (6th generation,6G) communication system, etc. In addition, the network may be a long range radio (LoRa) network or a car networking. The method provided by the embodiment of the application can also be applied to a satellite communication system. Wherein the satellite communication system may be integrated with the communication system described above.
The method and the device can be applied to an online evaluation system. The online evaluation system is a system for providing online test and evaluation for users by pointers, and can be used for compiling and executing the job contents such as program codes submitted by users and verifying the accuracy of the program codes to realize the test. The online evaluation system can also return the test result to the terminal equipment and display the test result to the user through the terminal equipment. In addition, the online evaluation system can also be used for repairing the program codes, for example, the codes are repaired by adopting the defect automatic repair technology.
In the application, the online evaluation system can be deployed in a cloud service server, namely, the online evaluation system is used as the cloud service to provide service for users, and correspondingly, the terminal equipment can communicate with the cloud service server in the modes of application programs or applets and the like, so that the prior evaluation function is realized. The online evaluation system can also be realized by an application program of the terminal equipment.
The current automatic code defect repairing technology is mainly used for automatically repairing codes based on test defects of the codes to be repaired. The technique is applicable to codes with test suite (test suite). The test suite may be used to verify whether the code passes the test. The test can be used for guiding a defect repair tool to repair the code to be repaired, so that the repaired code finally obtained after repair can pass through all the tests. It will be appreciated that the on-line evaluation system may perform an exhaustive test on each code to be identified (which may be referred to as a job title), and thus test-based defect repair techniques may be applied in this field for obtaining a repaired code that can pass all the tests through repair. In addition, the present application may refer to code submitted by other existing processes to repair the currently defective code.
However, the current automatic repair technology generally does not need user participation, that is, the automatic repair technology can automatically repair the code according to the test result, so that the repair will of the user on the code is not considered in the repair process, the repair result is inconsistent with the repair result expected by the user, and the repair accuracy is reduced. For example, in the case where there are multiple repair schemes, the automatic repair technique may automatically select one repair scheme to repair the code, and the repair scheme may not conform to the code habit of the user, so that the repair result may not be the best repair result, which has a problem of low repair accuracy.
In order to improve reliability of automatic code repair, the embodiment of the application provides a code repair method. Wherein the method may be performed by a prosthetic device. The repairing device may be a server of a cloud service or other devices capable of providing the cloud service (for example, referred to as a cloud service device), a terminal device where an application program is located, and the like. The repair device may also be a component in a server or terminal device. In the present application, the component may comprise, for example, at least one of a chip, a chip system, a processor, a transceiver, a processing unit, or a transceiver unit.
As shown in fig. 2, a code repairing method provided in an embodiment of the present application may include the following steps:
s101: the repair device obtains a first code provided by a user and a first repair suggestion, wherein the first repair suggestion corresponds to the first code.
Alternatively, the first repair suggestion may include a user repair location suggestion and/or a repair manner suggestion for the first code.
The repair location suggestion may indicate a location where the user considers that an error exists in the first code or a location where the user considers that an error does not exist in the first code, and the repair device may repair the location where the user considers that an error exists in the first code or does not repair the location where the user considers that an error does not exist, so that a repair result meets a user wish. In this application, the location where an error exists may also be referred to as an error location, and may be at least one line in the first code and/or at least one word or symbol in the line.
For example, when the user completes writing the first code, it is not determined whether there is an error in one or more positions in the first code, the user may mark, in the user interface of the terminal device, a position where there is a possibility of an error or where the user considers that there is no error, and accordingly, the terminal device generates a position repair suggestion. The method for marking the position in the first code by the user may be to mark the position where the text or the text is located by color, to bold the text, to underline or annotate the text, to input the text which the user believes to be in error in the text box indicating the position where the error is present, to input the text which the user believes to be in error in the text box indicating the position where the error is not present, or the like, and the present application is not particularly limited.
Further, the repair style suggestion may indicate a user suggested repair scheme for the first code. For example, where multiple repair schemes exist, the repair device may repair the first code using a user-suggested repair scheme. For example, when the word "if" in the code is misplaced as "uf," the repair suggestion may indicate that the "uf" is modified to "if. Alternatively, there may be multiple repair scenarios suggested by the user, wherein different repair scenarios may correspond to different repair locations.
For another example, when the online evaluation system provides the user with a plurality of repair schemes of the first code, the user may input the repair scheme selected by the user through the user interface of the terminal device, and accordingly, the terminal device generates a repair mode suggestion for guiding the online evaluation system to repair the first code.
Alternatively, the user interface of the terminal device may be the user interface of an online evaluation system, or may be a programming software interface that is programmed locally by the user, such as an integrated development environment (integrated development environment, IDE) interface.
Alternatively, the first code and the first repair suggestion may be entered by the user into the terminal device. If the method shown in the application is implemented by using cloud service, the repairing device may be a server of the cloud service or a component in the server, and in S101, the repairing device may acquire a first code and a first repairing suggestion input by a user from a terminal device. If the code is modified by an application, the repair device may be the terminal device or a component in the terminal device, so that the repair device may obtain the first code and the first repair suggestion via an input module or interface of the terminal device.
S102: the repair device repairs the first code according to the first repair suggestion.
Based on the method shown in fig. 2, the repairing device can repair the first code according to the first repairing suggestion provided by the user, so that the user will can be fully considered in the process of repairing the first code, and the repairing is more accurate and is closer to the user intention.
Optionally, if the method shown in the application is implemented by using cloud service, the cloud service device may repair the first code, and send the repair result to the terminal device. The terminal device may present the repair result to the user. Optionally, the terminal device may further obtain feedback of the repair result from the user, where the feedback may be used for the cloud service device to update the repair scheme or the repair result.
As one possible implementation of S102, the repair device may obtain the reference code and repair the first code according to the reference code and the first repair suggestion. For example, the repair device may determine a second repair suggestion based on the reference code and repair the first code based on the first repair suggestion and the second repair suggestion. Alternatively, the second repair suggestion may include a repair location suggestion and/or a repair manner suggestion obtained from the reference code.
In this application, the reference code may include at least one code having a reference meaning to the repair of the first code. In particular, the reference code may comprise a correct code and/or an error code stored by the repair device. Wherein the correct code may be program code without errors. The error code may be program code in which at least one error exists.
Alternatively, the reference code may have the same characteristics as the first code, or the reference code may be determined from the characteristics of the first code. Therefore, when the repairing device repairs the first code, only the reference code with the same characteristics as the first code is needed to be referred, and the repairing efficiency and the repairing accuracy can be improved.
In this application, the features of code may include code statement features (or referred to as code static features) and/or code execution information features (or referred to as code dynamic information).
Wherein the code statement features comprise statement features at the code line level and/or statement features at the function level.
The code execution information features may include at least one of a pass condition of a code run-time test on the test suite, a line of code executed, or a value of a program variable in execution. Wherein the pass status of the code as it is run on the test suite may indicate whether the code passes each test corresponding to the test suite. The code lines executed may indicate all code lines executed before the test is stopped when the code is tested according to the test suite. The values of program variables in execution may indicate the values of variables contained in the code when the code is tested according to the test suite.
Alternatively, the repair device may categorize the at least one correct code and/or the at least one error code based on the characteristics of the reference code, so that the characteristics may be used as a retrieval factor for retrieving the reference code. For example, correct codes and/or error codes having the same code statement feature may be categorized into one type by the code statement feature so as to facilitate retrieval of reference codes having the same feature from the code statement feature of the first code. For another example, correct codes and/or error codes having the same code execution information feature may be categorized by the code execution information feature to facilitate retrieval of a reference code based on the code execution information feature of the first code. Accordingly, after the repairing device obtains the first code, the characteristics of the first code can be determined through analysis, and at least one reference code with the same characteristics is searched according to the characteristics of the first code, so that the first code is repaired only by referring to a part of the reference codes with the same characteristics in all codes.
The manner in which the prosthetic device collects and processes the reference code will now be described with reference to fig. 3, taking the example that the reference code is the correct code. Alternatively, the repair device may collect the correct code online and/or offline. The correct code may be a code that was previously submitted by the user with no errors in the confirmation. In addition, the repair device may also collect repair actions that the correct code performs during the repair process prior to submission. Depending on the preprocessing of the correct code, the repair device may format the correct code, e.g., may convert a complex writing to a standard writing in order to extract the features of the correct code. In addition, the repair device may perform correct code analysis to extract features of the correct code, classify the correct code according to the features, and/or number (or index) correct codes having the same features. The repair device may also analyze the repair actions of the correct code to obtain repair pattern information, thereby supporting classification and/or retrieval of the correct code based on the repair pattern information. The repair mode information may indicate a repair action performed when the error code is repaired to the correct code. For example, the repair style information may include an index and/or parameters of the repair style. Wherein, the correct code characteristics and/or the repair mode information of the correct code can be stored as the original data of the correct code. When a repair is required for the first code, the repair device may retrieve the reference code from the original data based on the characteristics of the first code and/or the user provided repair scheme suggests retrieving the correct code. It will be appreciated that the actions performed by the prosthetic device shown in fig. 3 may also be performed by a cloud service or other device.
As a possible way of repairing the first code from the reference code, if the reference code comprises a correct code, the repairing means may compare the first code with the correct code in the process of repairing the first code, the first code differing from the correct code in terms of the code content of the first code possibly being an error, and thus the difference being a repair location determined from the correct code, and in addition the content of the correct code there being a recommendation of the repair way determined from the correct code. That is, the second repair suggestion may suggest repairing the erroneous location of the first code to coincide with the corresponding location of the correct code.
Furthermore, as another possible way of repairing the first code from the reference code, if the reference code includes an error code, the repairing means may compare the first code with the error code, with the same position of the first code as the content of the error code as the repairing position determined from the correct code. In addition, the repair device may determine the second repair suggestion based on repair mode information (or referred to as repair record) when the error code is repaired to the correct code. For example, if the first code and the error code have errors in the same position, the repairing device can be used as a suggested repairing mode according to the repairing mode of the error code. For example, the repair style information may include an index and/or parameters of the repair style.
Optionally, if the first repair suggestion includes a repair location suggestion and the second repair suggestion includes a repair location suggestion, the repair device may intersect to determine a final repair location based on the repair location suggestion included in the first repair suggestion and the repair location suggestion included in the second repair suggestion; alternatively, the repair device may determine the final repair location based on the repair location advice contained in the first repair advice, when the repair location advice contained in the first repair advice and the second repair advice respectively correspond to different repair locations, or when the second repair advice does not contain the repair location advice. Furthermore, for the same repair location, if the first repair suggestion includes a repair mode suggestion and the second repair suggestion includes a repair mode suggestion, the repair device may take an intersection to determine a final repair location based on the repair mode suggestion included in the first repair suggestion and the repair mode suggestion included in the second repair suggestion; alternatively, when the first repair suggestion and the second repair suggestion respectively include different repair mode suggestions, the repair device may also determine the final repair mode according to the repair mode suggestion included in the first repair suggestion.
As another possible implementation of S102, the repairing apparatus may determine the first repairing scheme according to the first repairing suggestion and the first code, and provide the first repairing scheme to the user, and then repair the first code according to the third repairing suggestion of the user for the first repairing scheme.
The first repair scheme may indicate a repair manner of at least one location to be repaired of the first code. Alternatively, the repairing device may determine the first repairing scheme according to the first code, the reference code and the first repairing suggestion, and specifically reference may be made to the description of the repairing device repairing the first code according to the reference code and the first repairing suggestion in the foregoing embodiment, where the repairing scheme is output and the user confirms whether to execute the repairing scheme before repairing the first code.
Alternatively, the first repair scheme may be determined based on the first repair suggestion, the reference code, and the first code. The determination manner of the reference code may refer to the description in the present application, and will not be described herein.
In an alternative implementation of determining the first repair scheme, the repair device may determine the first repair scheme based on the first repair scheme and the first code. For example, when the first repair suggestion includes a repair location suggestion, the repair device may determine at least one error location in the first code according to the repair location suggestion and determine at least one repair pattern according to the error location, the first repair pattern may indicate the repair pattern, e.g., the first repair pattern may ask a user whether to repair the error location indicated by the first repair suggestion in accordance with the at least one repair pattern. For another example, when the first repair suggestion includes a repair style suggestion, the repair device may identify at least one error location in the first code (e.g., match the first code based on the reference code) to determine the at least one error location, the first repair plan may indicate the error location, e.g., the first repair plan may ask the user whether to repair the location, and/or ask the user whether to repair the location in a repair style indicated by the first repair suggestion.
In another alternative implementation of determining the first repair plan, the repair device may determine the second repair suggestion based on the reference code and determine the first repair plan based on the first repair suggestion and the second repair suggestion. If the first repair suggestion includes a repair location suggestion and the second repair suggestion includes a repair location suggestion, the repair device may intersect to determine a repair location indicated by the first repair plan based on the repair location suggestion included by the first repair suggestion and the repair location suggestion included by the second repair suggestion; alternatively, when the repair location suggestions contained in the first repair suggestion and the second repair suggestion respectively correspond to different repair locations, or the second repair suggestion does not contain the repair location suggestion, the repair device may also determine the repair location indicated by the first repair scheme according to the repair location suggestion contained in the first repair suggestion. In addition, for the same repair location, if the first repair suggestion includes a repair mode suggestion and the second repair suggestion includes a repair mode suggestion, the repair device may take an intersection according to the repair mode suggestion included in the first repair suggestion and the repair mode suggestion included in the second repair suggestion to determine a repair mode indicated by the first repair scheme; alternatively, when the repair mode suggestions included in the first repair suggestion and the second repair suggestion are different, the repair device may also determine the repair mode indicated by the first repair scheme according to the repair mode suggestion included in the first repair suggestion.
Alternatively, the third repair suggestion may be user-determined in accordance with the first repair plan. For example, the third repair suggestion may indicate that the user agrees to the first repair scheme, and the repair device may perform repair of the first code according to the first repair scheme in S102. Furthermore, if the user does not agree to the first repair plan, the third repair suggestion may include a repair location suggestion and/or a repair manner suggestion that is different from the first repair suggestion, and accordingly, the repair device may perform repair of the first code according to these repair location suggestion and/or repair manner suggestion. For example, the third repair suggestion includes a repair location suggestion that does not include the repair location indicated by the first repair plan and/or the third repair suggestion includes a repair mode suggestion that does not include the repair mode indicated by the first repair plan.
Further optionally, the repairing device may further correct the first repairing scheme according to the third repairing suggestion, and display the corrected first repairing scheme to the user again. Correspondingly, the repairing device can also acquire a fourth repairing proposal of the user for the corrected first repairing proposal. The implementation of the fourth repair suggestion may refer to the third repair suggestion, and will not be described in detail.
It will be appreciated that if the above implementation is implemented by a cloud service, the above-described first repair scheme may be determined by the cloud service device according to the first repair scheme and the first code. The first repair solution may also be sent to the terminal device by the cloud service device, and provided (or presented) to the user by the terminal device, so that the user inputs a repair suggestion for the first repair solution, i.e., a third repair suggestion, through the terminal device. The terminal device may also send a third repair suggestion to the cloud service device, such that the cloud service device repairs the first code according to the third repair suggestion.
Optionally, in the process of repairing the first code according to the third repairing suggestion, the cloud service device may further perform one or more interactions with the user through the terminal device, so that a repairing result of the first code better accords with an expectation of the user.
As another possible implementation manner of S102, the repairing apparatus may determine the second repairing scheme according to the reference code and the first code, and provide the second repairing scheme to the user, and then acquire a first repairing suggestion of the user for the second repairing scheme, and repair the first code according to the first repairing suggestion.
The second repair scheme may indicate a repair mode of at least one location to be repaired of the first code, wherein the location to be repaired and/or the repair mode are determined according to the reference code. The manner of determining the second repair plan may be referred to herein as the manner of determining the second repair suggestion based on the reference code, except that the repair location and/or repair manner need to be provided to the user as the second repair plan. For example, the same location of the first code as the error code may be the location to be repaired and/or the code content of the first code differs from the correct code by the location to be repaired. For another example, the content of the correct code at the location to be repaired may be suggested as a repair mode, and/or the historical repair mode of the error code (or the historical repair mode information of the correct code) may be used as a repair mode of the location to be repaired.
In this implementation, the first repair suggestion may be determined in accordance with the second repair scheme. For example, the second repair scheme may indicate at least one repair-ready location and a corresponding repair manner, and the first repair suggestion may be used to indicate whether the first code is agreed to be repaired in accordance with the at least one repair-ready location and its corresponding repair manner. In addition, when the user does not agree to repair the to-be-repaired device according to the corresponding repair mode of the to-be-repaired device indicated by the second repair scheme, the first repair suggestion can also include at least one other repair mode of the to-be-repaired device, so that the repair device can repair the to-be-repaired device according to the repair mode suggestion provided by the user. In addition, the first repair suggestion may also provide a repair mode suggestion of the to-be-repaired location that is not included in the lost repair scheme, which is not specifically limited in this application.
Optionally, in various embodiments of the present application, the repair device may further determine a repair scheme of the first code for a first repair suggestion of the user. The repair scheme herein may include the aforementioned first repair scheme. Furthermore, if obtained from the first repair scheme at the time of the first repair suggestion, the repair scheme herein may also include an updated repair scheme for the first repair scheme.
It will be appreciated that if the above implementation is implemented by a cloud service, the second repair scheme may be determined by the cloud service device from the reference code and the first code. The second repair scheme may also be sent to the terminal device by the cloud service device, and provided (or presented) to the user by the terminal device, so that the user inputs a repair suggestion for the second repair scheme, i.e., the first repair suggestion, through the terminal device. The terminal device may also send the first repair suggestion to the cloud service device, such that the cloud service device repairs the first code according to the first repair suggestion.
Optionally, in the process of repairing the first code according to the first repairing suggestion, the cloud service device may further perform one or more interactions with the user through the terminal device, so that a repairing result of the first code better accords with an expectation of the user.
It will also be appreciated that in this implementation, the repair device may refer to the description of other embodiments in this application in terms of the procedure for repairing the first code according to the first repair suggestion corresponding to the third repair scheme. For example, the repair device may determine a first repair plan based on the first repair suggestion and the first code and provide the first repair plan to the user, after which the first code is repaired based on a third repair suggestion for the first repair plan by the user.
The following describes the flow of the code repairing method provided in the present application in connection with the embodiments shown in fig. 4 to 7.
Alternatively, in the embodiments shown in fig. 4 to 7, the repair device may include an error localization module and a program repair module.
As shown in fig. 4, the error localization module may be configured to extract a feature of the first code to be repaired, and perform error localization according to at least one of the feature of the first code, a reference code (e.g., the raw data shown in fig. 3), and a user's repair location suggestion (e.g., the repair location suggestion may be an exemplary content of the aforementioned first repair suggestion) to determine the location to be repaired. Thereafter, the error localization module may also present the location to be repaired to the user (e.g., the location to be repaired may be an exemplary content included in the aforementioned first repair scenario) and obtain an indication that the user agrees to the location to be repaired (e.g., the information indicating agreement to the location to be repaired may be an exemplary content in the aforementioned third repair suggestion), or update the location to be repaired based on the indication that the user disagrees to the location to be repaired (e.g., the indication that the user disagrees to the location to be repaired may be an exemplary content in the aforementioned third repair suggestion). In addition, the error positioning module can also send the to-be-repaired reset device to the program repairing module.
As shown in fig. 5, the program repairing module may be configured to determine a repairing manner according to the to-be-repaired setting provided by the error positioning module. The program repair module may determine a repair mode of the location to be repaired according to repair mode suggestions (e.g., repair mode suggestions indicated by the first repair suggestion or the third repair suggestion described in the present application) provided by the user and/or repair mode information corresponding to the reference code. Optionally, the program repair module may further provide repair mode information of the location to be repaired to the user (for example, the repair mode information provided to the user of the location to be repaired may be exemplary content of one of the foregoing first repair scheme or the second repair scheme). The program fix module may further obtain an indication that the user agrees with the fix (e.g., the information indicating agreement with the fix may be an exemplary content of the aforementioned third fix suggestions), or update the fix information according to an indication that the user disagrees with the fix (e.g., the information indicating disagreement with the fix may be an exemplary content of the aforementioned third fix).
In addition, the program repairing module can be used for repairing the position to be repaired according to the repairing mode. The repair method may refer to the description of S102 in this application, and will not be described herein. The program repair module may also present the repair results to the user.
Optionally, the repairing device may further include a user interaction module for implementing interaction between the repairing device and a user. For example, in fig. 4, the repair device may obtain a repair location suggestion of the user through the user interaction module, display a location to be repaired to the user, obtain an indication that the user agrees to the location to be repaired, or obtain an indication that the user does not agree to the location to be repaired. For another example, in fig. 5, the program repair module may obtain, through the user interaction module, a repair mode suggestion provided by the user, provide repair mode information of the location to be repaired to the user, obtain an indication that the user agrees with the repair mode, obtain an indication that the user does not agree with the repair mode, or display a final repair result to the user.
Further alternatively, the user interaction module may include an input module and an output module. Alternatively, the input module may be used to obtain information input by the user, and the output module may be used to present information to the user. Specifically, the user interaction module may be implemented through a touch screen or other man-machine interaction modules, which is not specifically limited in this application.
As a possible implementation manner, as shown in fig. 6, in a scenario of cloud service or the like, the repairing device is separately set from the client device. The user interaction module may be a module that communicates with the user-side device used by the user, such as a communication interface or a communication module. In this implementation, the ue and the repairing device are generally not the same physical entity, so the repairing device may transmit information that needs to interact with the user through the user interaction module and the ue.
As another possible implementation manner, as shown in fig. 7, in a scenario of an application program or the like, the user side device may be disposed in the same physical entity as the repairing device. The user interaction module may be a man-machine interaction module of a user terminal device used by a user, such as an input/output device of a touch screen, a mouse, a keyboard, a virtual key or a physical key.
Based on the embodiments of fig. 4 to 7, the repairing device in the application supports repairing according to the repairing suggestion of the user, so that the repairing process is more fit with the habit of the user, and the accuracy of code repairing can be improved. In addition, in the repairing process, the repairing device can provide a repairing scheme for one or more times for a user, so that the repairing process is prompted, and error positioning and repairing mode determination are improved through interaction with the user, so that repairing accuracy is further improved. In addition, the code repairing process can comprise a plurality of interaction processes with the user, so that the problem that the user waits for a repairing result for a long time can be avoided, and the user experience can be improved.
In the application, the user side device can interact with the user through a service interface (such as a network (web) interface) of the online evaluation system or a user interface of the integrated development environment (integrated development environment, IDE).
In the online evaluation system, the web interface can be used for displaying evaluation interfaces such as a code submission interface of the online evaluation system. FIG. 8 is a schematic diagram of a web interface of an online evaluation system. In fig. 8, on the basis of the existing online evaluation code submitting interface, the user side device may additionally display a button for prompting the wrong position, so as to display or stow the to-be-repaired position information determined by the repairing device. In addition, the user side device can additionally display a repair mode button for displaying or collecting the repair mode information determined by the repair device. Optionally, the user may trigger the user side device to expand or collapse the display content corresponding to the button by clicking the button, and when the display content corresponding to the button is expanded, the highlighting of the content corresponding to the button may be given on the basis of the code written by the user (i.e. the code before repair and/or the code after repair). For example, the pre-repair code may be "uf", and the post-repair code may be, for example, "if", i.e., may indicate that "uf" is modified to "if". The user can trigger the repairing device to give different feedback through the interaction of the online web page. Optionally, the user side device may display the code before repair and the code after repair according to the method shown in the application in the web interface, respectively. Further alternatively, the user may input user suggestions by modifying the repaired code.
Optionally, the user may input an indication indicating whether to agree with the corresponding repair location and/or repair mode to the user terminal device by clicking on the repaired code, for example, clicking on any code location of the repaired code may trigger an option of displaying approval or disapproval of the repair location and/or repair mode in the interface. In addition, the user can click on a position which is not repaired, and trigger the user to input a new repair position suggestion, wherein the new repair position does not comprise the position which is repaired or provided with repair sending suggestion in the first code.
Additionally, the IDE interface may be used for code editing by the user. In the application, the user side device can communicate with a server of the cloud service through the IDE plug-in, or communicate with the application program, acquire content required to be displayed to the user, and provide information input by the user to the server or the application program.
Illustratively, as shown in FIG. 9, in the IDE interface, user-written code may be displayed as well as an alternate repair list area.
Wherein the alternate repair list area may contain function buttons and/or setup buttons. The function button is used for at least one of an attempt submitting function, an operation testing function, an error prompting function and a repairing scheme prompting function. For example, when the user clicks the error function button corresponding to the function button, the IDE interface may present the location to be repaired to the user in the list of alternatives for repair. For another example, when the user clicks the function button of the repair scheme, the IDE interface may display repair mode information of the location to be repaired to the user in the alternative repair list. The set button may be used to expose or stow tool configuration or user preferences of the IDE plug-in, etc. Alternatively, the repair list may also display the repair location and/or repair mode information directly, without triggering the display via a function button.
In addition, as shown in fig. 9, the alternative repair list area may further include an information display area for displaying an area of the position to be repaired and/or repair mode information. Optionally, the user may input an indication indicating whether to approve the corresponding repair location and/or repair mode to the user terminal device by clicking on the location to be repaired in the area, for example, clicking on any code location in the area may trigger an option to display approval or disapproval of the repair location and/or repair mode in the interface. In addition, the user can click on the position which is not repaired, and trigger the user to input new repair position suggestions. Wherein the new repair location does not include a location in the first code where a repair has been made or where a repair transmission suggestion has been given.
Based on the same conception, the embodiment of the application also provides a repairing device. The repair device may include corresponding hardware structures and/or software modules that perform the functions shown in the above methods. Those of skill in the art will readily appreciate that the elements and method steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application scenario and design constraints imposed on the solution.
Fig. 10 is a schematic structural diagram of a possible code repairing device according to an embodiment of the present application. The code repairing device can be used for realizing the functions of the repairing device (comprising cloud service equipment or terminal equipment) or the terminal equipment interacting with the cloud service equipment in the method embodiment, so that the beneficial effects of the method embodiment can be realized. In one possible implementation, the communication means may be a terminal device or a server as shown in fig. 1. Details and effects relating to the foregoing embodiments may be found in the description of the foregoing embodiments.
As shown in fig. 10, a code repairing apparatus provided in the present application may include an acquisition module and a repairing module. The acquisition module may be configured to acquire a first code provided by a user and a first repair suggestion. The fix module may be operable to fix the first code according to the first fix suggestion.
The acquiring module and/or the repairing module may be implemented by software or may be implemented by hardware. Illustratively, the implementation of the acquisition module is described next as an example of the acquisition module. Similarly, the implementation of the repair module may refer to the implementation of the acquisition module.
Module as an example of a software functional unit, the acquisition module may comprise code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container, among others. Further, the above-described computing examples may be one or more. For example, the acquisition module may include code running on multiple hosts/virtual machines/containers. It should be noted that, multiple hosts/virtual machines/containers for running the code may be distributed in the same region (region), or may be distributed in different regions. Further, multiple hosts/virtual machines/containers for running the code may be distributed in the same availability zone (availability zone, AZ) or may be distributed in different AZs, each AZ comprising a data center or multiple geographically close data centers. Wherein typically a region may comprise a plurality of AZs.
Also, multiple hosts/virtual machines/containers for running the code may be distributed in the same virtual private cloud (virtual private cloud, VPC) or in multiple VPCs. In general, one VPC is disposed in one region, and a communication gateway is disposed in each VPC for implementing inter-connection between VPCs in the same region and between VPCs in different regions.
Module as an example of a hardware functional unit, the acquisition module may comprise at least one computing device, such as a server or the like. Alternatively, the acquisition module may be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (programmable logic device, PLD), etc. The PLD may be implemented as a complex program logic device (complex programmable logical device, CPLD), a field-programmable gate array (FPGA), a general-purpose array logic (generic array logic, GAL), or any combination thereof.
Multiple computing devices included in the acquisition module may be distributed in the same region or may be distributed in different regions. The plurality of computing devices included in the acquisition module may be distributed in the same AZ or may be distributed in different AZ. Likewise, multiple computing devices included in the acquisition module may be distributed in the same VPC, or may be distributed among multiple VPCs. Wherein the plurality of computing devices may be any combination of computing devices such as servers, ASIC, PLD, CPLD, FPGA, and GAL.
It should be noted that, in other embodiments, the obtaining module may be configured to perform any step in the foregoing code repair method, and the repair module may be configured to perform any step in the foregoing code repair method. The steps of the acquisition module and the repair module which are respectively responsible for implementation can be designated according to the needs, and all functions of the code repair device are realized by respectively implementing different steps in the code repair method through the acquisition module and the repair module.
The application also provides a code repairing system for realizing the method implemented by the cloud service. As shown in fig. 11, the system may include a cloud service apparatus and a terminal apparatus. The terminal equipment can be used for sending a first code and a first repair suggestion provided by a user to the cloud service equipment; the cloud service device can be used for acquiring a first code provided by a user and a first repair suggestion from the terminal device, wherein the first repair suggestion corresponds to the first code; the cloud service device may be further configured to repair the first code according to the first repair suggestion; the cloud service device may be further configured to send a repair result of the first code to the terminal device. The terminal device may be configured to present the repair result of the first code to the user.
Referring to the description in the present application, the cloud service apparatus in the present application may be replaced with a cloud service device, and the terminal apparatus may be replaced with a terminal device.
Alternatively, both the cloud service device and the terminal device may be implemented by software, or may be implemented by hardware. By way of example, the implementation of the cloud service apparatus is described next. Similarly, the implementation manner of the terminal device may refer to the implementation manner of the cloud service device.
Modules as one example of a software functional unit, a cloud service device may include code that runs on a computing instance. Wherein the computing instance may be at least one of a physical host (computing device), a virtual machine, a container, etc. computing device. Further, the computing device may be one or more. For example, a cloud service device may include code that runs on multiple hosts/virtual machines/containers. It should be noted that, multiple hosts/virtual machines/containers for running the application may be distributed in the same region, or may be distributed in different regions. Multiple hosts/virtual machines/containers for running the code may be distributed among the same AZ or among different AZs, each AZ including one data center or multiple geographically close data centers. Wherein typically a region may comprise a plurality of AZs.
Also, multiple hosts/virtual machines/containers for running the code may be distributed in the same VPC, or may be distributed among multiple VPCs. Where typically one VPC is placed within one region. The inter-region communication between two VPCs in the same region and between VPCs in different regions needs to set a communication gateway in each VPC, and the interconnection between the VPCs is realized through the communication gateway.
As an example of a hardware functional unit, a cloud service device may include at least one computing device, such as a server or the like. Alternatively, the cloud service device may be a device implemented by ASIC or PLD. Wherein, the PLD can be CPLD, FPGA, GAL or any combination thereof.
Multiple computing devices included in a cloud service device may be distributed in the same region or may be distributed in different regions. The plurality of computing devices included in the cloud service device may be distributed in the same AZ or may be distributed in different AZ. Also, multiple computing devices included in the cloud service device may be distributed in the same VPC, or may be distributed in multiple VPCs. Wherein the plurality of computing devices may be any combination of computing devices such as servers, ASIC, PLD, CPLD, FPGA, and GAL.
The present application also provides a computing device 100 to implement the actions of the prosthetic device of the present application. As shown in fig. 12, the computing device 100 includes: bus 102, processor 104, memory 106, and communication interface 108. Communication between the processor 104, the memory 106, and the communication interface 108 is via the bus 102. Computing device 100 may be a server or a terminal device. It should be understood that the present application is not limited to the number of processors, memories in computing device 100.
Bus 102 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one line is shown in fig. 12, but not only one bus or one type of bus. Bus 104 may include a path to transfer information between various components of computing device 100 (e.g., memory 106, processor 104, communication interface 108).
The processor 104 may include any one or more of a central processing unit (central processing unit, CPU), a graphics processor (graphics processing unit, GPU), a Microprocessor (MP), or a digital signal processor (digital signal processor, DSP).
The memory 106 may include volatile memory (RAM), such as random access memory (random access memory). The processor 104 may also include non-volatile memory (ROM), such as read-only memory (ROM), flash memory, a mechanical hard disk (HDD), or a solid state disk (solid state drive, SSD).
The memory 106 has stored therein executable program code that the processor 104 executes to implement the functions of the aforementioned acquisition module and/or repair module, respectively, to implement the aforementioned code repair method. That is, the memory 106 has instructions stored thereon for performing the code repair method.
Alternatively, the memory 106 stores executable codes, and the processor 104 executes the executable codes to implement the functions of the cloud service apparatus and/or the terminal apparatus, respectively, thereby implementing the code repair method. That is, the memory 106 has stored thereon instructions for performing the aforementioned code repair method.
Communication interface 108 enables communication between computing device 100 and other devices or communication networks using a transceiver module such as, but not limited to, a network interface card, transceiver, or the like.
The embodiment of the application also provides a computing device cluster. The cluster of computing devices includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop, notebook, or smart phone.
As shown in fig. 13, the cluster of computing devices includes at least one computing device 100. The same instructions for performing the aforementioned code repair method may be stored in memory 106 in one or more computing devices 100 in the computing device cluster.
In some possible implementations, part of the instructions for performing the foregoing code repair method may also be stored separately in the memory 106 of one or more computing devices 100 in the computing device cluster. In other words, a combination of one or more computing devices 100 may collectively execute instructions for performing the foregoing code repair method.
It should be noted that the memories 106 of different computing devices 100 in the computing device cluster may store different instructions for performing part of the functions of the acquisition module and/or the repair module, respectively. That is, the instructions stored by the memory 106 in the different computing devices 100 may implement the functionality of one or more of the cloud service device and the terminal device or one or more of the acquisition module and the repair module.
In some possible implementations, one or more computing devices in a cluster of computing devices may be connected through a network. Wherein the network may be a wide area network or a local area network, etc. Fig. 14 shows one possible implementation. As shown in fig. 14, two computing devices 100A and 100B are connected by a network. Specifically, the connection to the network is made through a communication interface in each computing device. In this type of possible implementation, instructions to perform the functions of the acquisition module are stored in memory 106 in computing device 100B. Meanwhile, instructions to perform the functions of the repair module are stored in the memory 106 in the computing device 100B.
The manner of connection between clusters of computing devices shown in fig. 14 may be in view of the large amount of data storage and computation required by the code repair method provided herein, and thus in view of the delivery of the functionality implemented by the repair module to computing device 100B.
It should be appreciated that the functionality of computing device 100A shown in fig. 14 may also be performed by multiple computing devices 100. Likewise, the functionality of computing device 100B may also be performed by multiple computing devices 100.
It is understood that computing device 100A may correspond to a terminal device in a cloud service scenario and computing device 100B may correspond to a cloud service device in a cloud service scenario.
The embodiment of the application also provides another computing device cluster. The connection between computing devices in the computing device cluster may be similar to the connection of the computing device cluster described with reference to fig. 13 and 14. In contrast, the same instructions for performing the code repair method may be stored in memory 106 in one or more computing devices 100 in the computing device cluster.
In some possible implementations, portions of the instructions for performing the code repair method may also be stored separately in the memory 106 of one or more computing devices 100 in the computing device cluster. In other words, a combination of one or more computing devices 100 may collectively execute instructions for performing a code repair method.
It should be noted that the memory 106 in different computing devices 100 in a computing device cluster may store different instructions for performing part of the functionality of the code repair system. That is, the instructions stored by the memory 106 in the different computing devices 100 may implement the functionality of one or more of the means in the terminal device and the cloud service device.
Some or all of the operations and functions performed by the communications device described in the above method embodiments of the present application may be performed using a chip or integrated circuit.
The present application provides a computer readable storage medium storing a computer program comprising instructions for performing the above-described method embodiments.
Embodiments of the present application provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the above-described method embodiments.
The embodiment of the application provides a communication system which comprises cloud service equipment and terminal equipment in a cloud service scene. The at least one terminal device may perform the actions of the first terminal device and/or the second terminal device in the present application. The network device may be configured to perform the actions of the network device in the method of any of figures 2 to 6.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes or substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (21)

1. A method of code repair, comprising:
acquiring a first code and a first repair suggestion provided by a user, wherein the first repair suggestion corresponds to the first code;
repairing the first code according to the first repairing suggestion.
2. The method of claim 1, wherein the first repair suggestion comprises at least one of:
repair location advice;
the repair mode is suggested.
3. The method of claim 1, wherein the repairing the first code according to the first auxiliary repair information comprises:
acquiring a reference code;
acquiring a second repair suggestion according to the reference code;
repairing the first code according to the first repair suggestion and the second repair suggestion.
4. The method of claim 3, wherein the reference code comprises an error code, the obtaining the second repair suggestion based on the reference code comprising:
and determining the second repair suggestion according to the repair record corresponding to the error code.
5. The method of claim 1, wherein the repairing the first code according to the first repair suggestion comprises:
Determining a first repair solution according to the first repair solution and the first code;
providing the first repair solution to a user;
acquiring a third repair suggestion provided by a user and aiming at the first repair scheme;
repairing the first code according to the third repairing suggestion.
6. The method of claim 5, wherein the determining a first repair scheme from the first repair proposal and the first code comprises:
a first repair plan is determined based on the first repair suggestion, a reference code, and the first code.
7. The method of any one of claims 1-6, wherein the method further comprises:
determining a second repair scheme according to the reference code and the first code;
providing the second repair proposal to a user, the first repair proposal being a repair proposal for the second repair proposal.
8. The method of any one of claims 3 or 6-7, wherein the method further comprises:
and determining the reference code according to the characteristics of the first code, wherein the characteristics comprise code statement characteristics and/or code execution information characteristics.
9. The method of any of claims 3 or 5-8, wherein the reference code comprises at least one of:
An error code;
correct code.
10. The method of any one of claims 1-9, wherein the method further comprises:
and displaying the repair result of the first code to a user.
11. A code repair device, comprising:
the system comprises an acquisition module, a first restoration module and a restoration module, wherein the acquisition module is used for acquiring a first code and a first restoration suggestion provided by a user, and the first restoration suggestion corresponds to the first code;
and the repair module is used for repairing the first code according to the first repair suggestion.
12. The apparatus of claim 11, wherein the repair module is specifically configured to:
acquiring a reference code;
acquiring a second repair suggestion according to the reference code;
repairing the first code according to the first repair suggestion and the second repair suggestion.
13. The apparatus of claim 12, wherein the reference code comprises an error code, the repair module being specifically configured to:
and determining the second repair suggestion according to the repair record corresponding to the error code.
14. The apparatus of claim 11, wherein the repair module is specifically configured to:
determining a first repair solution according to the first repair solution and the first code;
Providing the first repair solution to a user;
acquiring a third repair suggestion provided by a user and aiming at the first repair scheme;
repairing the first code according to the third repairing suggestion.
15. The apparatus of claim 14, wherein the repair module is specifically configured to:
a first repair plan is determined based on the first repair suggestion, a reference code, and the first code.
16. The apparatus of any of claims 11-14, wherein the repair module is further to:
determining a second repair scheme according to the reference code and the first code;
providing the second repair proposal to a user, the first repair proposal being a repair proposal for the second repair proposal.
17. The apparatus of any one of claims 12 or 15-16, wherein the repair module is further to:
and determining the reference code according to the characteristics of the first code, wherein the characteristics comprise code statement characteristics and/or code execution information characteristics.
18. The apparatus of any of claims 11-17, wherein the repair module is further to:
and displaying the repair result of the first code to a user.
19. A cluster of computing devices, comprising at least one computing device, each computing device comprising a processor and a memory;
the processor of the at least one computing device is configured to execute instructions stored in a memory of the at least one computing device to cause the cluster of computing devices to perform the method of any of claims 1-10.
20. A computer program product containing instructions that, when executed by a cluster of computing devices, cause the cluster of computing devices to perform the method of any of claims 1-10.
21. A computer readable storage medium comprising computer program instructions which, when executed by a cluster of computing devices, perform the method of any of claims 1-10.
CN202310376365.3A 2023-03-30 2023-03-30 Code repairing method and device and computing device cluster Pending CN116521225A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310376365.3A CN116521225A (en) 2023-03-30 2023-03-30 Code repairing method and device and computing device cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310376365.3A CN116521225A (en) 2023-03-30 2023-03-30 Code repairing method and device and computing device cluster

Publications (1)

Publication Number Publication Date
CN116521225A true CN116521225A (en) 2023-08-01

Family

ID=87407435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310376365.3A Pending CN116521225A (en) 2023-03-30 2023-03-30 Code repairing method and device and computing device cluster

Country Status (1)

Country Link
CN (1) CN116521225A (en)

Similar Documents

Publication Publication Date Title
EP3563243B1 (en) Determining application test results using screenshot metadata
CN108959059B (en) Test method and test platform
CN111506444A (en) Form approval method and device, storage medium and electronic equipment
CN111026394B (en) Method for carrying out flow docking by utilizing self-service docking platform
US20190163499A1 (en) Simulating human interface interaction resilient to user interface changes
CN103984626A (en) Method and device for generating test-case script
CN109614325B (en) Method and device for determining control attribute, electronic equipment and storage medium
CN107015912A (en) Realize system, method, device and the electronic equipment of remote debugging
CN110737548B (en) Data request method and server
CN108287648A (en) Feedback management method, apparatus, electronic equipment and the computer storage media of software
CN113821433A (en) Method, device, equipment, medium and product for testing cloud mobile phone application program
CN112988578A (en) Automatic testing method and device
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN116521225A (en) Code repairing method and device and computing device cluster
CN105447580A (en) Floating window based registration reservation method
CN111865726B (en) Service message testing method, device, computer system and storage medium
CN113704114A (en) Automatic testing method, device, equipment and medium for functional interface
CN109410077B (en) Method and device for defining rule flow, computer storage medium and electronic equipment
CN112380118A (en) Unit testing method, unit testing device, medium and electronic equipment
CN113656022B (en) Software development method and device, computer equipment and storage medium
CN115774662A (en) Business process testing method, device, equipment and storage medium
CN111488283B (en) Task generation method and device, electronic equipment and storage medium
CN116305019A (en) Authority configuration method and device, electronic equipment and storage medium
CN114756473A (en) Test method, test device, electronic equipment and storage medium
CN115952137A (en) Information processing method, information processing apparatus, electronic device, storage medium, and program product

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