Code editing method and device

By establishing an authentication and information transmission channel between the service side and the code development terminal and synchronizing the code editing content, the problem of low code development efficiency in the existing technology is solved, remote code development and resource support is realized, and large-scale projects are improved. Development efficiency.

CN113157263BActive Publication Date: 2024-11-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110459997.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-27
Publication Date
2024-11-26
Estimated Expiration
2041-04-27

AI Technical Summary

Technical Problem

Existing code editing solutions are inefficient in development in large-scale code development projects and are difficult to meet the needs of complex code development.

Method used

By establishing an authentication and information transmission channel between the service side and the code development terminal, synchronizing the code editing content in real time, remote code development is realized and computing resources and storage resources on the service side are used to improve development efficiency.

Benefits of technology

It improves the efficiency of code development, provides computing resources and storage resources support, and is suitable for collaborative development of multiple code development terminals, ensuring the order and efficiency of code editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157263B_ABST
    Figure CN113157263B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a code editing method and device. The method is executed on the service side, and the method includes: verifying the identity of the code development terminal based on the identity authentication request sent by the code development terminal; establishing an information transmission channel with the code development terminal after the identity authentication of the code development terminal is passed; when the code development terminal is in a code editing state, obtaining the code editing content in the code development terminal through the information transmission channel; and synchronously editing the code editing content to the position corresponding to the code editing content in the service side code. The technical solution of the embodiments of the present application can improve the efficiency of code development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer and cloud technology, and more specifically, to a code editing method and device. Background Art

[0002] In code editing scenarios, code editing is usually performed based on a code editor on a single machine. However, this code editing solution has low code development efficiency and is only suitable for simple code development projects, not large code development projects. Therefore, how to improve code development efficiency is a technical problem that needs to be solved urgently. Summary of the invention

[0003] The embodiments of the present application provide a code editing method, apparatus, computer program product or computer program, computer-readable medium and electronic device, which can improve the code development efficiency at least to a certain extent.

[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0005] According to one aspect of an embodiment of the present application, a code editing method is provided, which is executed on a service side, and includes: verifying the identity of the code development terminal based on an identity authentication request sent by the code development terminal; establishing an information transmission channel with the code development terminal after the identity authentication of the code development terminal is passed; when the code development terminal is in a code editing state, obtaining code editing content in the code development terminal through the information transmission channel; and synchronously editing the code editing content to a position in the service side code corresponding to the code editing content.

[0006] According to one aspect of an embodiment of the present application, a code editing method is provided, which is executed on a code development terminal, and the method includes: sending a local identity authentication request to a service side; after the local identity authentication is passed, establishing an information transmission channel with the service side; when the local is in a code editing state, sending the local code editing content to the service side through the information transmission channel, so that the service side synchronously edits the code editing content to a position in the service side code corresponding to the code editing content.

[0007] According to one aspect of an embodiment of the present application, a code editing device is provided, which is arranged on a service side, and includes: a verification unit, which is used to verify the identity of the code development terminal based on an identity authentication request sent by the code development terminal; a first establishment unit, which is used to establish an information transmission channel with the code development terminal after the identity authentication of the code development terminal is passed; a first acquisition unit, which is used to acquire the code editing content in the code development terminal through the information transmission channel when the code development terminal is in a code editing state; and an editing unit, which is used to synchronously edit the code editing content to a position corresponding to the code editing content in the service side code.

[0008] In some embodiments of the present application, based on the aforementioned scheme, the verification unit is configured to: send a first public key generated by the service side to the code development terminal, the first public key is used by the code development terminal to encrypt its own identity authentication information; obtain the identity authentication information encrypted data sent by the code development terminal, and decrypt the identity authentication information encrypted data by the service side's own first private key to obtain the identity authentication information of the code development terminal; verify the identity of the code development terminal through the identity authentication information.

[0009] In some embodiments of the present application, based on the aforementioned scheme, the verification unit is configured to: generate an original string, and encrypt the original string by a second public key generated by the code development terminal to obtain original string encrypted data; send the encrypted data of the original string to the code development terminal; obtain a verification string sent by the code development terminal, and the verification string is obtained by the code development terminal decrypting the original string encrypted data by its own second private key; and verify the identity of the code development terminal by the verification string.

[0010] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a third sending unit, which is used to send the local service side code to the code development terminal through the information transmission channel after establishing an information transmission channel with the code development terminal, so as to display the local service side code in the code editor of the code development terminal.

[0011] In some embodiments of the present application, based on the aforementioned scheme, there are multiple code development terminals, and the device also includes: a locking unit, which is used to lock the editing permission of the position corresponding to the code editing content in the service side code when the code editing content is synchronously edited to the position corresponding to the code editing content in the service side code, and the editing permission is used to uniquely authorize the synchronous editing of the code editing content to the position corresponding to the code editing content in the service side code.

[0012] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a running unit, which is used to run the synchronously edited service-side code after synchronously editing the code editing content to a position in the service-side code corresponding to the code editing content, so as to provide a local access service; a receiving unit, which is used to receive an access request, and the local access service provides a service for the access request; and a forwarding unit, which is used to forward the access request to a third-party service through a reverse proxy server when the service involved in the access request does not fall within the service scope of the local access service.

[0013] According to one aspect of an embodiment of the present application, a code editing device is provided, which is arranged in a code development terminal, and the device includes: a first sending unit, which is used to send a local identity authentication request to a service side; a second establishing unit, which is used to establish an information transmission channel with the service side after the local identity authentication is passed; the second sending unit is used to send the local code editing content to the service side through the information transmission channel when the local is in a code editing state, so that the service side synchronously edits the code editing content to a position in the service side code corresponding to the code editing content.

[0014] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a second acquisition unit, used to acquire local code editing records when the local code is in a code editing state; and a writing unit, used to write the code editing records to a distributed version control system.

[0015] According to one aspect of an embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the code editing method described in the above embodiment.

[0016] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the code editing method as described in the above embodiment is implemented.

[0017] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the code editing method as described in the above embodiments.

[0018] In the technical solutions provided in some embodiments of the present application, the identity of the code development terminal can be verified based on the identity authentication request sent by the code development terminal. After the identity authentication of the code development terminal is passed, an information transmission channel with the code development terminal is established. When the code development terminal is in a code editing state, the code editing content in the code development terminal is obtained through the information transmission channel, and the code editing content is synchronously edited to the position corresponding to the code editing content in the service side code. Since remote code development is implemented on the service side through the code development terminal, the service side can provide and meet the computing resources and storage resources required in the code development process, thereby improving the code development efficiency.

[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0021] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;

[0022] Figure 2 A flowchart of a code editing method according to an embodiment of the present application is shown;

[0023] Figure 3 A detailed flow chart of verifying the identity of the code development terminal according to an embodiment of the present application is shown;

[0024] Figure 4 An interaction diagram between a code development terminal and a service side according to an embodiment of the present application is shown;

[0025] Figure 5 A detailed flow chart of verifying the identity of the code development terminal according to an embodiment of the present application is shown;

[0026] Figure 6 An interaction diagram between a code development terminal and a service side according to an embodiment of the present application is shown;

[0027] Figure 7 A flowchart of a method after synchronously editing the code edited content to a position corresponding to the code edited content in the service side code according to an embodiment of the present application is shown;

[0028] Figure 8 An architectural diagram of a test code according to an embodiment of the present application is shown;

[0029] Fig. 9 A flowchart of a code editing method according to an embodiment of the present application is shown;

[0030] Fig.10 A block diagram of a code editing device according to an embodiment of the present application is shown;

[0031] Fig.11 A block diagram of a code editing device according to an embodiment of the present application is shown;

[0032] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0034] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0037] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the objects used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those shown or described.

[0039] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.

[0040] like Figure 1 As shown, the system architecture may include terminal devices (such as Figure 1 The embodiment of the present invention is a schematic diagram of a mobile phone 101, a tablet computer 102, and a portable computer 103 shown in FIG. 1 ), a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal device and the server 105. The network 104 may include various connection types, such as a wired communication link, a wireless communication link, and the like.

[0041] In one embodiment of the present application, the code editing solution can be implemented by a system consisting of a terminal device and a server 105. Specifically, the terminal device can send an identity authentication request to the server 105. After the server 105 passes the identity authentication of the terminal device, the server 105 establishes an information transmission channel with the terminal device. After the information transmission channel between the server 105 and the terminal device is established, the code in the server 105 can be remotely displayed on the terminal device, and the code can be edited on the terminal device. The server 105 obtains the code editing content in the terminal device through the information transmission channel, and synchronously edits the code editing content to the position in the code of the server 105 corresponding to the code editing content.

[0042] In the system composed of terminal devices and server 105 in this embodiment, there can be multiple terminal devices, that is, the code in server 105 can be edited by multiple terminal devices. The advantage is that the code development efficiency can be greatly improved by collaboratively developing code through multiple terminal devices.

[0043] In this embodiment, the code editing content can also be written into the blockchain. By utilizing the immutability of the blockchain, it is possible to well ensure that the record of the code editing content is retained.

[0044] It should also be noted that Figure 1 The number of terminal devices, networks and servers in the description is only illustrative. According to the implementation requirements, the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this, and this application does not limit it here.

[0045] It should be explained that cloud computing as described above is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, and expanded at any time. By establishing a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform, various types of virtual resources are deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.

[0046] When the server is a cloud server, since the cloud server has large storage space and strong computing power, it can provide and meet the computing resources and storage resources required in the code development process, thereby improving the code development efficiency.

[0047] The following will describe in detail the implementation details of the technical solution of the embodiment of the present application from the perspective of different execution entities:

[0048] From the perspective of the service side (such as cloud server):

[0049] This embodiment provides a code editing method, wherein the method can be executed on the service side.

[0050] See also Figure 2 , shows a flow chart of a code editing method according to an embodiment of the present application, the code editing method at least includes steps 210 to 270, which are described in detail as follows:

[0051] In step 210, based on the identity authentication request sent by the code development terminal, the identity of the code development terminal is verified.

[0052] In one embodiment of step 210, the identity of the code development terminal is verified as follows: Figure 3 Follow the steps shown.

[0053] See also Figure 3 , shows a detailed flow chart of verifying the identity of the code development terminal according to an embodiment of the present application. Specifically including steps 211 to 213:

[0054] In step 211, a first public key generated by the service side is sent to the code development terminal, where the first public key is used by the code development terminal to encrypt its own identity authentication information.

[0055] In step 212, the encrypted data of the identity verification information sent by the code development terminal is obtained, and the encrypted data of the identity verification information is decrypted by the first private key of the service side itself to obtain the identity verification information of the code development terminal.

[0056] In step 213, the identity of the code development terminal is verified using the identity verification information.

[0057] In order to make those skilled in the art better understand this embodiment, the following will refer to Figure 4 This embodiment is described as follows. Figure 4 , shows an interaction diagram between a code development terminal and a service side according to an embodiment of the present application.

[0058] like Figure 4 As shown, first, the service side 120 generates a first key pair, which includes a first public key and a first private key; the code development terminal 110 requests a connection from the service side 120; the service side 120 sends the first public key to the code development terminal 110; after receiving the first public key from the service side, the code development terminal 110 encrypts the identity authentication information by using the first public key to obtain encrypted identity authentication information data, and sends the encrypted identity authentication information data to the service side 120; the service side 120 decrypts the encrypted identity authentication information data by using its own first private key to obtain identity authentication information (such as an account number and a verification password), and verifies the code development terminal by using the identity authentication information.

[0059] If the identity verification information is correct, the service side 120 passes the verification of the code development terminal 110 . If the identity verification information fails, the service side 120 fails the verification of the code development terminal 110 .

[0060] The code development terminal is verified through the above-mentioned interactive method. Since the identity authentication information of the code development terminal is encrypted by the first public key of the service side, the security of the identity authentication information can be guaranteed during the process of transmitting the identity authentication information to the service side.

[0061] In another embodiment of step 210, the identity of the code development terminal is verified as follows: Figure 5 Follow the steps shown.

[0062] See also Figure 5 , shows a detailed flow chart of verifying the identity of the code development terminal according to an embodiment of the present application. Specifically including steps 214 to 217:

[0063] In step 214, an original string is generated, and the original string is encrypted using a second public key generated by the code development terminal to obtain original string encrypted data.

[0064] In step 215, the encrypted data of the original character string is sent to the code development terminal.

[0065] In step 216, a verification string sent by the code development terminal is obtained, wherein the verification string is obtained by the code development terminal decrypting the original string encrypted data using its own second private key.

[0066] In step 217, the identity of the code development terminal is verified using the verification string.

[0067] In order to make those skilled in the art better understand this embodiment, the following will refer to Figure 6 This embodiment is described as follows. Figure 6 , shows an interaction diagram between a code development terminal and a service side according to an embodiment of the present application.

[0068] like Figure 6 As shown, first, the code development terminal 110 generates a second key pair, the second key pair includes a second public key and a second private key, and sends the second public key to the service side 120;

[0069] The code development terminal 110 requests a connection from the service side 120; after receiving the connection request sent by the code development terminal 110, the service side 120 generates an original string, encrypts the original string by a second public key, obtains original string encrypted data, and sends the original string encrypted data to the code development terminal 110; after receiving the original string encrypted data, the code development terminal 110 decrypts the original string encrypted data by a second private key, obtains the original string, and sends the original string to the service side 120; the service side 120 verifies the code development terminal 110 by using the original string obtained from the code development terminal 110.

[0070] Among them, if the original string obtained from the code development terminal 110 is consistent with the original string generated by the service side 120 itself, the service side 120 passes the verification of the code development terminal 110; if the original string obtained from the code development terminal 110 is inconsistent with the original string generated by the service side 120 itself, the service side 120 fails the verification of the code development terminal 110.

[0071] The code development terminal is verified through the above-mentioned interactive method. Since the identity authentication information of the code development terminal is not involved in the process of verifying the code development terminal, there is no need to perform security management on the identity authentication information of the code development terminal, which saves computer resources. At the same time, given the uniqueness of the second private key in the code development terminal, the accuracy of the identity authentication of the code development terminal can also be ensured.

[0072] In other embodiments of step 210, the identity of the code development terminal is verified, and the following steps may also be performed simultaneously: Figure 3 He Ru Figure 5 The verification scheme of the steps shown has the advantage that, through multiple verification schemes, the accuracy and reliability of the identity verification of the code development terminal can be improved.

[0073] In other embodiments of step 210 of the present application, the identity of the code development terminal may be verified by constructing a secure shell protocol (SSH) framework.

[0074] Specifically, the secure shell protocol can be composed of software on the code development terminal and the service side. The service side is a daemon process that runs in the background and responds to connection requests from the code development terminal, specifically providing processing for remote connections, which may include public key authentication, key exchange, symmetric key encryption, and non-secure connections.

[0075] The code development terminal may include a secure shell protocol program and other application programs such as remote copy, remote login, and secure file transfer.

[0076] The working mechanism of the secure shell protocol is roughly that the local code development terminal sends a connection request to the remote service side, the service side checks the request data packet and IP address of the application and then sends the key to the code development terminal, and the local side then sends the key back to the service side, thus completing the verification and connection establishment. Figure 2 In step 230, after the identity authentication of the code development terminal is passed, an information transmission channel with the code development terminal is established.

[0077] In one embodiment of the present application, after establishing an information transmission channel with the code development terminal, the service side can send the local service side code to the code development terminal through the information transmission channel to display the local service side code in the code editor of the code development terminal.

[0078] In the present application, the local service-side code is displayed in the code editor of the code development terminal, so that the code developer can edit the code data through the code editor.

[0079] When a code developer is editing code in a code editor, the code development terminal enters a code editing state.

[0080] Continue to refer to Figure 2 In step 250, when the code development terminal is in a code editing state, the code editing content in the code development terminal is obtained through the information transmission channel.

[0081] In the present application, the service side can detect whether the code development terminal is in a code editing state through the information transmission channel. When the service side detects that the code development terminal is in a code editing state, it can obtain the code editing content in the code development terminal through the information transmission channel.

[0082] In the present application, the service side can detect whether the code development terminal is in the code editing state through the information transmission channel by sending a heartbeat packet to the code development terminal, wherein the heartbeat packet is used to trigger the code development terminal to generate a response.

[0083] Specifically, the service side can send heartbeat packets to the code development terminal at regular intervals. For example, a fixed message can be sent to the code development terminal every few minutes or seconds. After receiving the heartbeat packet, the code development terminal replies with a response message. The service side can determine the code development status of the code development terminal through the response message.

[0084] It should be noted that the heartbeat packet is essentially a detection message, which can be an empty data packet. Generally speaking, the heartbeat packet is sent at the logic layer, and a heartbeat packet is sent to the code development terminal at a certain time interval by a timer. In step 270, the code editing content is synchronously edited to the position corresponding to the code editing content in the service side code.

[0085] In the present application, since the code in the code editor of the code development terminal and the service side code belong to the same code, the contents of the two at various positions in the code are corresponding, for example, the code contents on the same code module are corresponding, and for example, the code contents of the same code line are corresponding.

[0086] Therefore, in the process of synchronizing the code, the service side can synchronize the code editing content in the code development terminal to the position in the service side code corresponding to the code editing content. For example, the code developer modifies the 280th line of code in the code editor of the code development terminal, then the service side can synchronize the code content of the 280th line in the service side code according to the modified content.

[0087] Furthermore, in the present application, the code editing content may be synchronously edited to a position in the service side code corresponding to the code editing content in real time, or may be synchronously edited to a position in the service side code corresponding to the code editing content at a scheduled time.

[0088] In one embodiment of the present application, when the code editing content is synchronously edited to a position in the service side code corresponding to the code editing content, a local code synchronization record of the service side can also be obtained, and the code synchronization record can be written to a distributed version control system for code developers at other code development terminals to browse the code synchronization record.

[0089] In the present application, there may be multiple code development terminals.

[0090] For the code editing content of any one of the multiple code development terminals, when the code editing content is synchronously edited to the position in the service side code corresponding to the code editing content, the editing permission of the position in the service side code corresponding to the code editing content can be locked, and the editing permission is used to uniquely authorize the synchronous editing of the code editing content to the position in the service side code corresponding to the code editing content.

[0091] For example, there are five code development terminals A, B, C, D, and E. When the code developer is modifying the 280th line of code in the code editor of code development terminal A, the service side will also synchronously modify the code content of the 280th line of the service side code. At this time, the service side can lock the editing permission of the 280th line of code in the service side code. Under this editing permission, except for code development terminal A, code development terminals B, C, D, and E are prohibited from editing the 280th line of code.

[0092] In the present application, the editing permissions at the position corresponding to the code editing content in the service-side code are locked. The advantage is that when the code at the same position is edited by multiple code development terminals at the same time, code editing chaos can be avoided, thereby ensuring the order of code editing and improving code development efficiency.

[0093] In the present application, after the code editing content is synchronously edited to the position in the service side code corresponding to the code editing content, the synchronously edited service side code can be reversely synchronized to the editor of other code development terminals connected to the service side, so that code developers of other code development terminals can grasp the code change information in time, coordinate code development, and improve code development efficiency.

[0094] After step 270, that is, after the code editing content is synchronously edited to the position corresponding to the code editing content in the service side code, the service side code needs to be tested.

[0095] In this application, the testing of service-side code, for example, the testing of website code, can be carried out from four aspects: performance testing, security testing, and website optimization testing.

[0096] Specifically, performance testing includes: connection speed testing, which refers to the speed at which users connect to the website system; load testing, which tests the actual performance of the website system under a certain load level; and stress testing, which tests the system's limitations and fault recovery capabilities, that is, whether the website system will crash.

[0097] Specifically, security testing refers to testing the server security and script security of the website, which can include vulnerability testing, offensive testing, and error testing. It tests the client-server application, data, server, network, firewall, etc. of the website system.

[0098] Specifically, website optimization testing refers to testing whether the website system has undergone search engine optimization, website architecture optimization, web page columns and static conditions, etc.

[0099] In one embodiment of the present application, the following can be performed: Figure 7 The steps shown are to implement testing of service-side code.

[0100] See also Figure 7 , shows a flowchart of a method after the code editing content is synchronously edited to a position corresponding to the code editing content in the service side code according to an embodiment of the present application. Specifically comprising steps 281 to 283:

[0101] In step 281, the synchronously edited service-side code is run to provide local access services.

[0102] In step 282, an access request is received and serviced by the local access service.

[0103] In step 283, when the service involved in the access request does not belong to the service scope of the local access service, the access request is forwarded to a third-party service through a reverse proxy server.

[0104] In order to make those skilled in the art better understand this embodiment, the following will refer to Figure 8 This embodiment is described as follows. Figure 8 , shows an architectural diagram of the test code according to an embodiment of the present application.

[0105] like Figure 8 As shown, the service side includes an intermediate code cloud server 802. After each code development terminal 801 edits the service side code in the intermediate code cloud server 802, the intermediate code cloud server 802 can be directly used as a test environment for testing the service side code.

[0106] During the test process, the intermediate code cloud server 802 runs the service-side code that has been synchronously edited to provide local access services. The user access browser 803 accesses the local access service provided by the intermediate code cloud server 802 through the intelligent proxy server 804. The intermediate code cloud server 802 receives the access request, and the local access service provides services for the access request of the user access browser 803. When the service involved in the access request does not fall within the service scope of the local access service, the intermediate code cloud server 802 forwards the access request to the third-party service through the locally set Nginx reverse proxy server.

[0107] In this application, in order to test the service side code, the test environment is built directly from the service side. The advantage is that since the service side has large storage space and strong computing power, building the test environment directly from the service side can enhance the simulation of the test environment and improve the test efficiency of the service side code. Setting the cloud server as the service side can make the code development environment and test environment smoother, more convenient, smarter, and more convenient, and less prone to memory overflow.

[0108] In the present application, remote code development on the service side is achieved through multiple code development terminals, which can coordinate code development resources from multiple parties and improve code development efficiency, especially in large-scale code development projects.

[0109] The following is an explanation from the perspective of the code development terminal:

[0110] This embodiment provides a code editing method, wherein the method can be executed in a code development terminal.

[0111] See also Fig. 9 , shows a flow chart of a code editing method according to an embodiment of the present application, the code editing method at least includes steps 910 to 950, which are described in detail as follows:

[0112] In step 910, a local identity authentication request is sent to the service side.

[0113] In step 930, after the local identity authentication is passed, an information transmission channel with the service side is established.

[0114] In step 950, when the local code is in the editing state, the local code editing content is sent to the service side through the information transmission channel, so that the service side synchronously edits the code editing content to the position corresponding to the code editing content in the service side code.

[0115] In one embodiment of the present application, when the code development terminal (local) is in a code editing state, the local code editing record can also be obtained and the code editing record can be written into the distributed version control system.

[0116] The advantage of writing the code editing record into a distributed version control system is that it is convenient for code developers to browse the code editing history and quickly jump to a certain historical code state, thereby improving code editing efficiency.

[0117] In one embodiment of the present application, when the code development terminal (local) is in a code editing state, the edited code can also be obtained and cached in a cache cluster.

[0118] The advantage of caching the edited code in the cache cluster is that it can prevent the edited code from being lost when the information transmission channel is interrupted. When the information transmission channel is connected, the edited code cached in the cache cluster can be resent to the service side.

[0119] In the technical solution of the above-mentioned embodiment of the present application, since remote code development is implemented on the service side through the code development terminal, the service side can provide and meet the computing resources and storage resources required in the code development process, thereby improving the code development efficiency.

[0120] The following describes an apparatus embodiment of the present application, which can be used to execute the code editing method in the above embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above embodiment of the code editing method of the present application.

[0121] Fig.10 A block diagram of a code editing device according to an embodiment of the present application is shown.

[0122] Reference Fig.10 As shown, according to a code editing device 1000 according to an embodiment of the present application, the device is arranged on the service side, and the device includes: a verification unit 1001, a first establishment unit 1002, a first acquisition unit 1003 and an editing unit 1004.

[0123] Among them, the verification unit 1001 is used to verify the identity of the code development terminal based on the identity authentication request sent by the code development terminal; the first establishment unit 1002 is used to establish an information transmission channel with the code development terminal after the identity authentication of the code development terminal is passed; the first acquisition unit 1003 is used to acquire the code editing content in the code development terminal through the information transmission channel when the code development terminal is in a code editing state; the editing unit 1004 is used to synchronously edit the code editing content to the position corresponding to the code editing content in the service side code.

[0124] In some embodiments of the present application, based on the aforementioned scheme, the verification unit 1001 is configured to: send a first public key generated by the service side to the code development terminal, the first public key is used by the code development terminal to encrypt its own identity authentication information; obtain the identity authentication information encrypted data sent by the code development terminal, and decrypt the identity authentication information encrypted data by using the service side's own first private key to obtain the identity authentication information of the code development terminal; verify the identity of the code development terminal through the identity authentication information.

[0125] In some embodiments of the present application, based on the aforementioned scheme, the verification unit 1001 is configured to: generate an original string, and encrypt the original string by a second public key generated by the code development terminal to obtain original string encrypted data; send the encrypted data of the original string to the code development terminal; obtain a verification string sent by the code development terminal, and the verification string is obtained by the code development terminal decrypting the original string encrypted data by its own second private key; and verify the identity of the code development terminal by the verification string.

[0126] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a third sending unit, which is used to send the local service side code to the code development terminal through the information transmission channel after establishing an information transmission channel with the code development terminal, so as to display the local service side code in the code editor of the code development terminal.

[0127] In some embodiments of the present application, based on the aforementioned scheme, there are multiple code development terminals, and the device also includes: a locking unit, which is used to lock the editing permission of the position corresponding to the code editing content in the service side code when the code editing content is synchronously edited to the position corresponding to the code editing content in the service side code, and the editing permission is used to uniquely authorize the synchronous editing of the code editing content to the position corresponding to the code editing content in the service side code.

[0128] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a running unit, which is used to run the synchronously edited service-side code after synchronously editing the code editing content to a position in the service-side code corresponding to the code editing content, so as to provide a local access service; a receiving unit, which is used to receive an access request, and the local access service provides a service for the access request; and a forwarding unit, which is used to forward the access request to a third-party service through a reverse proxy server when the service involved in the access request does not fall within the service scope of the local access service.

[0129] Fig.11 A block diagram of a code editing device according to an embodiment of the present application is shown.

[0130] Reference Fig.11 As shown, according to an embodiment of the present application, a code editing device 1100 is provided in a code development terminal, and the device includes: a first sending unit 1101 , a second establishing unit 1102 and a second sending unit 1103 .

[0131] Among them, the first sending unit 1101 is used to send a local identity authentication request to the service side; the second establishing unit 1102 is used to establish an information transmission channel with the service side after the local identity authentication is passed; the second sending unit 1103 is used to send the local code editing content to the service side through the information transmission channel when the local is in the code editing state, so that the service side will synchronously edit the code editing content to the position in the service side code corresponding to the code editing content.

[0132] In some embodiments of the present application, based on the aforementioned scheme, the device also includes: a second acquisition unit, used to acquire local code editing records when the local code is in a code editing state; and a writing unit, used to write the code editing records to a distributed version control system.

[0133] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0134] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0135] like Fig.12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method described in the above embodiment. In the RAM 1203, various programs and data required for system operation are also stored. The CPU 1201, the ROM 1202 and the RAM 1203 are connected to each other through the bus 1204. The input / output (I / O) interface 1205 is also connected to the bus 1204.

[0136] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.

[0137] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.

[0138] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0139] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0140] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0141] As another aspect, the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the code editing method described in the above embodiment.

[0142] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the code editing method described in the above embodiment.

[0143] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0144] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0145] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0146] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A code editing method, the method being executed on a service side, characterized in that: The method comprises: Verifying the identity of the code development terminal based on the identity authentication request sent by the code development terminal; After the identity authentication of the code development terminal is passed, establishing an information transmission channel with the code development terminal; When it is detected that the code development terminal is in a code editing state by sending a heartbeat packet to the code development terminal at a fixed time, the code editing content in the code development terminal is obtained through the information transmission channel, wherein there are multiple code development terminals and the heartbeat packet is used to trigger the code development terminal to generate a response; For the code editing content of any one of the multiple code development terminals, the code editing content is synchronously edited to a line position corresponding to the code editing content in the service-side code of the intermediate code cloud server on the service side, and the editing permission of a line position corresponding to the code editing content in the service-side code is locked to realize remote code development on the service side, wherein the editing permission is used to uniquely authorize the synchronous editing of the code editing content to a line position corresponding to the code editing content in the service-side code; Obtaining a local code synchronization record of the service side, and writing the code synchronization record into a distributed version control system so that code developers of other code development terminals can browse the code synchronization record; Using the intermediate code cloud server as a test environment, during the testing of the service side code, the synchronously edited service side code is run through the intermediate code cloud server to provide local access services; receiving an access request, and providing service for the access request by the local access service; When the service involved in the access request does not belong to the service scope of the local access service, the access request is forwarded to a third-party service through a reverse proxy server.

2. The method according to claim 1, characterized in that The verifying the identity of the code development terminal includes: Sending a first public key generated by the service side to the code development terminal, where the first public key is used by the code development terminal to encrypt its own identity authentication information; Obtaining the encrypted data of the identity verification information sent by the code development terminal, and decrypting the encrypted data of the identity verification information by using the first private key of the service side itself to obtain the identity verification information of the code development terminal; The identity of the code development terminal is verified through the identity verification information.

3. The method according to claim 1, characterized in that The verifying the identity of the code development terminal includes: Generate an original string, and encrypt the original string using a second public key generated by the code development terminal to obtain encrypted data of the original string; Sending the encrypted data of the original character string to the code development terminal; Acquire a verification string sent by the code development terminal, wherein the verification string is obtained by the code development terminal decrypting the original string encrypted data using its own second private key; The identity of the code development terminal is verified through the verification string.

4. The method according to claim 1, characterized in that: After establishing an information transmission channel with the code development terminal, the method further includes: The local service-side code is sent to the code development terminal through the information transmission channel, so that the local service-side code is displayed in a code editor of the code development terminal.

5. A code editing method, the method being executed in a code development terminal, characterized in that: The method comprises: Send a local authentication request to the service side; After the local identity authentication is passed, an information transmission channel with the service side is established; When the service side detects that the local is in a code editing state by periodically sending a heartbeat packet to the local, the local code editing content is sent to the service side through the information transmission channel, so that the service side can synchronize the code editing content of any code development terminal among the multiple code development terminals to a line position corresponding to the code editing content in the service side code of the intermediate code cloud server of the service side, lock the editing permission of a line position corresponding to the code editing content in the service side code, so as to realize remote code development on the service side, obtain the code synchronization record of the local where the service side is located, and write the code synchronization record to the distributed version control system for code developers of other code development terminals to browse the code synchronization record, and After the code editing content is synchronously edited to a line position in the service-side code corresponding to the code editing content, the following operations are performed: using the intermediate code cloud server as a test environment, during the testing of the service-side code, the synchronously edited service-side code is run through the intermediate code cloud server to provide local access services; receiving access requests, and having the local access service provide services for the access requests; when the service involved in the access request does not fall within the service scope of the local access service, forwarding the access request to a third-party service through a reverse proxy server; wherein the heartbeat packet is used to trigger the code development terminal to generate a response, and the editing permission is used to uniquely authorize the synchronous editing of the code editing content to a line position in the service-side code corresponding to the code editing content.

6. The method according to claim 5, characterized in that The method further comprises: When the local code is being edited, obtain the local code editing record; The code editing record is written to a distributed version control system.

7. A code editing device, the device being arranged on a service side, characterized in that: The device comprises: A verification unit, used to verify the identity of the code development terminal based on the identity authentication request sent by the code development terminal; A first establishing unit is used to establish an information transmission channel with the code development terminal after the identity authentication of the code development terminal is passed; a first acquisition unit, configured to acquire the code editing content in the code development terminal through the information transmission channel when detecting that the code development terminal is in a code editing state by sending a heartbeat packet to the code development terminal at a fixed time, wherein there are multiple code development terminals and the heartbeat packet is used to trigger the code development terminal to generate a response; An editing unit is used to synchronously edit the code editing content to a line position corresponding to the code editing content in the service side code of the intermediate code cloud server on the service side, so as to realize remote code development on the service side; The device further includes: a locking unit, which is used to lock the editing permission of a line position corresponding to the code editing content in the service side code when the code editing content is synchronously edited to a line position corresponding to the code editing content in the service side code for the code editing content of any one of the multiple code development terminals, wherein the editing permission is used to uniquely authorize the synchronous editing of the code editing content to a line position corresponding to the code editing content in the service side code; A running unit is used to run the synchronously edited service side code through the intermediate code cloud server during the testing of the service side code after synchronously editing the code edited content to a position in the service side code corresponding to the code edited content, using the intermediate code cloud server as a test environment, so as to provide a local access service; A receiving unit, used to receive an access request, and the local access service provides service for the access request; a forwarding unit, configured to forward the access request to a third-party service through a reverse proxy server when the service involved in the access request does not belong to the service scope of the local access service; The device is also used to: obtain the local code synchronization record of the service side, and write the code synchronization record into the distributed version control system so that code developers of other code development terminals can browse the code synchronization record.

8. A code editing device, the device being arranged in a code development terminal, characterized in that: The device comprises: The first sending unit is used to send a local identity authentication request to the service side; The second establishing unit is used to establish an information transmission channel with the service side after the local identity authentication is passed; The second sending unit is used to send the local code editing content to the service side through the information transmission channel when the service side detects that the local is in a code editing state by periodically sending a heartbeat packet to the local, so that the service side can synchronize the code editing content of any code development terminal among the multiple code development terminals to a line position corresponding to the code editing content in the service side code of the intermediate code cloud server of the service side, and lock the editing permission of a line position corresponding to the code editing content in the service side code, so as to realize remote code development on the service side, obtain the code synchronization record of the local where the service side is located, and write the code synchronization record to the distributed version control system for code developers of other code development terminals to browse the code synchronization The step is recorded, and after the code editing content is synchronously edited to a line position in the service side code corresponding to the code editing content, the following operations are performed: using the intermediate code cloud server as a test environment, during the test of the service side code, the synchronously edited service side code is run through the intermediate code cloud server to provide local access service; receiving an access request, and the local access service provides service for the access request; when the service involved in the access request does not belong to the service scope of the local access service, forwarding the access request to a third-party service through a reverse proxy server; wherein, the heartbeat packet is used to trigger the code development terminal to generate a response, and the editing permission is used to uniquely authorize the synchronous editing of the code editing content to a line position in the service side code corresponding to the code editing content.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the code editing method according to any one of claims 1 to 6 is implemented.

10. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the code editing method according to any one of claims 1 to 6.

11. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the code editing method according to any one of claims 1 to 6.