Code processing-based operation execution method and device, equipment and storage medium

By generating a screen watermark in the code editing interface and selecting the encryption method according to the operation, the code in the remote server connection is encrypted, which solves the problem of code leakage and improves the security of the code.

CN118779852APending Publication Date: 2024-10-15ECARX (HUBEI) TECHCO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202410763239.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

When the remote server is connected to the current device, the code lacks security protection, which can easily lead to code leakage and affect the security of the code.

Method used

By generating screen watermarks in the code editing interface, and selecting appropriate encryption methods based on different code trigger operations to encrypt the target code, including obfuscation encryption, graphics encryption and session encryption, ensuring the security of the code during copying, editing and communication. sex.

Benefits of technology

Effectively prevent code leakage, improve the comprehensiveness and effectiveness of the code, and enhance the security of the code during the remote connection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779852A_ABST
    Figure CN118779852A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an operation execution method and device based on code processing, equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: in response to a server connection request initiated by a user, connecting a remote server matched with the server connection request; displaying a code editing interface; obtaining user related information of the user; displaying a screen watermark generated on the basis of the user related information in the code editing interface; if a code triggering operation for a target code in the code editing interface is detected, determining a data encryption mode matched with the code triggering operation, and encrypting the target code based on the matched data encryption mode to obtain an encrypted target code; and based on the encrypted target code, executing a code triggering action matched with the code triggering operation. The method is used for achieving the effects of improving the code security and preventing the code leakage problem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for executing operations based on code processing. Background Art

[0002] With the development of computer technology and the gradual expansion of the application scope of remote servers, more and more users are connecting to remote servers, so that they can complete a series of code processing through current devices and use the resources of remote servers.

[0003] For example, in the field of Internet of Vehicles, the current device can be connected to the remote server to enable remote development and debugging, thereby improving development efficiency. Alternatively, the current device can be connected to the remote server to achieve remote management and control, thereby saving management efficiency and reducing management costs.

[0004] At present, when users connect to and communicate with remote servers through their current devices, they generally only authenticate the user in the current device that is connected to the remote server, but do not take safe and effective protection measures for the code processed after the remote connection is successful, which affects the security of the code. This may lead to code leakage during the code processing after the remote connection, which may easily cause economic losses. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, device and storage medium for executing an operation based on code processing, so as to improve code security and prevent code leakage.

[0006] In a first aspect, an embodiment of the present application provides an operation execution method based on code processing, the method comprising:

[0007] In response to a server connection request initiated by a user, connecting to a remote server matching the server connection request; and displaying a code editing interface; wherein the server connection request is used to request connection to at least one remote server;

[0008] Acquire user related information of the user; and display a screen watermark generated based on the user related information in the code editing interface;

[0009] If a code triggering operation for a target code in the code editing interface is detected, a data encryption method matching the code triggering operation is determined, and the target code is encrypted based on the matching data encryption method to obtain an encrypted target code; wherein the code triggering operation includes at least one of a code copying operation, a code editing operation, and a code communication operation;

[0010] Based on the encrypted target code, a code triggering action matching the code triggering operation is executed.

[0011] In a possible implementation, the code triggering operation indicates a code copying operation; the data encryption method matching the code copying operation indicates an obfuscated encryption method; and the encrypting the target code based on the matching data encryption method to obtain the encrypted target code includes:

[0012] According to the preset printable characters, the target code is encoded to obtain target encoded data;

[0013] Obfuscating the target coded data to obtain obfuscated target coded data;

[0014] The preset identification information is obtained, and the preset identification information is concatenated with the obfuscated target coding data to obtain the encrypted target code.

[0015] In a possible implementation, after executing a code triggering action matching the code triggering operation based on the encrypted target code, the method further includes:

[0016] In response to the code pasting instruction initiated by the user, determining a pasting position indicated by the code pasting instruction;

[0017] If it is determined that the pasting position indicated by the code pasting instruction is located in the code editing interface, the encrypted target code is decrypted and then the target code is pasted to the pasting position indicated by the code pasting instruction;

[0018] If it is determined that the pasting position indicated by the code pasting instruction is not located in the code editing interface, the encrypted target code is pasted to the pasting position indicated by the code pasting instruction.

[0019] In a possible implementation, the code triggering operation indicates a code editing operation; the data encryption method matching the code editing operation indicates a graphic encryption method; and the encrypting the target code based on the matching data encryption method to obtain the encrypted target code includes:

[0020] A target canvas is generated according to a preset canvas generation requirement, and at least a portion of the target code that meets the preset canvas generation requirement is drawn into the target canvas to obtain the encrypted target code; wherein the preset canvas generation requirement indicates the amount of code included in the target canvas.

[0021] In a possible implementation, the code triggering operation indicates a code communication operation; the code communication operation indicates an operation of performing code communication with the remote server; the data encryption method matching the code communication operation indicates a session encryption method; and the encrypting the target code based on the matching data encryption method to obtain the encrypted target code includes:

[0022] Based on the session key generated by the current device, the target code is symmetrically encrypted to obtain the encrypted target code; wherein the session key indicates an encryption key for communication between the current device and the remote server.

[0023] In a possible implementation, after executing a code triggering action matching the code triggering operation based on the encrypted target code, the method further includes:

[0024] Based on the target code, the code triggering operation and the executed code triggering action, a user operation log is generated; and the user operation log is saved to a preset storage location.

[0025] In a possible implementation, before responding to the server connection request initiated by the user, the method further includes:

[0026] In response to the server access request initiated by the user, a server resource list matching the server access rights of the user is displayed; wherein the server resource list includes server related information of at least one remote server that the user is allowed to access.

[0027] In a second aspect, an embodiment of the present application provides an operation execution device based on code processing, including:

[0028] A first response unit, configured to respond to a server connection request initiated by a user, connect to a remote server matching the server connection request, and display a code editing interface; wherein the server connection request is used to request connection to at least one remote server;

[0029] A display unit, used to obtain user related information of the user; and display a screen watermark generated based on the user related information in the code editing interface;

[0030] an encryption unit, configured to, if a code triggering operation for a target code in the code editing interface is detected, determine a data encryption method that matches the code triggering operation, and encrypt the target code based on the matched data encryption method to obtain an encrypted target code; wherein the code triggering operation includes at least one of a code copying operation, a code editing operation, and a code communication operation;

[0031] The execution unit is used to execute a code triggering action matching the code triggering operation based on the encrypted target code.

[0032] In a possible implementation, the code triggering operation indicates a code copying operation; the data encryption mode matching the code copying operation indicates an obfuscated encryption mode; and the encryption unit is used to:

[0033] According to the preset printable characters, the target code is encoded to obtain target encoded data;

[0034] Obfuscating the target coded data to obtain obfuscated target coded data;

[0035] The preset identification information is obtained, and the preset identification information is concatenated with the obfuscated target coding data to obtain the encrypted target code.

[0036] In a possible implementation, the device is also used for:

[0037] After executing a code triggering action matching the code triggering operation based on the encrypted target code, in response to a code pasting instruction initiated by the user, determining a pasting position indicated by the code pasting instruction;

[0038] If it is determined that the pasting position indicated by the code pasting instruction is located in the code editing interface, the encrypted target code is decrypted and then the target code is pasted to the pasting position indicated by the code pasting instruction;

[0039] If it is determined that the pasting position indicated by the code pasting instruction is not located in the code editing interface, the encrypted target code is pasted to the pasting position indicated by the code pasting instruction.

[0040] In a possible implementation, the code triggering operation indicates a code editing operation; the data encryption mode matching the code editing operation indicates a graphic encryption mode; and the encryption unit is used to:

[0041] A target canvas is generated according to a preset canvas generation requirement, and at least a portion of the target code that meets the preset canvas generation requirement is drawn into the target canvas to obtain the encrypted target code; wherein the preset canvas generation requirement indicates the amount of code included in the target canvas.

[0042] In a possible implementation, the code triggering operation indicates a code communication operation; the code communication operation indicates an operation of performing code communication with the remote server; the data encryption mode matching the code communication operation indicates a session encryption mode; the encryption unit is used to:

[0043] Based on the session key generated by the current device, the target code is symmetrically encrypted to obtain the encrypted target code; wherein the session key indicates an encryption key for communication between the current device and the remote server.

[0044] In a possible implementation manner, the device further includes a reporting unit, configured to:

[0045] After executing a code triggering action matching the code triggering operation based on the encrypted target code, a user operation log is generated based on the target code, the code triggering operation and the executed code triggering action; and the user operation log is saved to a preset storage location.

[0046] In a possible implementation manner, the device further includes a second response unit, configured to:

[0047] Before responding to a server connection request initiated by a user, in response to a server access request initiated by the user, a server resource list matching the server access rights of the user is displayed; wherein the server resource list includes server-related information of at least one remote server that the user is allowed to access.

[0048] In a third aspect, an embodiment of the present application provides a computer device, including: a memory, a processor;

[0049] The memory stores computer-executable instructions;

[0050] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0051] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0052] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0053] The operation execution method, device, equipment and storage medium based on code processing provided in the embodiment of the present application can respond to the server connection request initiated by the user, connect to the remote server matching the server connection request, and display the code editing interface. At this time, the user's user-related information can be obtained; and the screen watermark generated based on the user-related information is displayed in the code editing interface. In this way, the code can be prevented from being leaked by screenshots or screen recordings to a certain extent by generating and displaying screen watermarks in the code editing interface, thereby improving the security of the code to a certain extent. If a code triggering operation for the target code in the code editing interface is detected, the data encryption method matching the code triggering operation is determined, and the target code is encrypted based on the matching data encryption method to obtain the encrypted target code. In this way, the target code can be encrypted using a matching data encryption method according to different code triggering operations, and the target code can be encrypted from multiple levels, thereby improving the comprehensiveness and effectiveness of the target code encryption. Afterwards, based on the encrypted target code, a code triggering action matching the code triggering operation can be executed, which can further improve the code security and prevent the problem of code leakage. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0055] Figure 1 A flowchart of a method for executing an operation based on code processing provided by the present application;

[0056] Figure 2 A flowchart of another method for executing an operation based on code processing provided by the present application;

[0057] Figure 3 A flowchart of an implementation of displaying a screen watermark in a code editing interface provided by an embodiment of the present application;

[0058] Figure 4 A schematic diagram of a process for generating a session key provided in an embodiment of the present application;

[0059] Figure 5 A schematic diagram of the structure of an operation execution device based on code processing provided in an embodiment of the present application;

[0060] Figure 6 A schematic diagram of the structure of another operation execution device based on code processing provided in an embodiment of the present application;

[0061] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application.

[0062] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0063] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.

[0064] If it is necessary to explain, the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0065] First, the terms involved in this application are explained:

[0066] Canvas: It is an important drawing tool in web development. It supports dynamic drawing and animation effects, takes up less CPU resources, and can draw various graphics. The canvas element is a new tag added in HTML5 for generating images in real time on web pages, and the image content can be customized. The height and width of the canvas are determined by the attributes defined in the HTML code of a drawable area. JavaScript code can access this area and generate dynamic graphics through a complete set of drawing function APIs.

[0067] DOM: The full name is Document Object Model. DOM is a tree-based API document that requires the entire document to be represented in memory during processing.

[0068] MutationObserver property: API used to monitor changes in DOM nodes.

[0069] fillText attribute: API for drawing text.

[0070] Websocket: is a full-duplex communication protocol.

[0071] SSL certificate: also known as SSL server certificate, it has server identity authentication and data transmission encryption functions.

[0072] In the field of Internet of Vehicles, remote management, control, development and debugging by connecting current devices to remote servers has become a common technical means due to its high efficiency and speed.

[0073] In the related art, after the current device is connected to the remote server, the processed code is generally displayed in plain text, which makes it easy to have the risk of code leakage, affecting the security of the code.

[0074] The code processing-based operation execution method provided in the present application can solve the above technical problems by encrypting various types of code processing operations and then executing them. The processed codes can be encrypted from multiple levels and using multiple encryption methods.

[0075] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0076] Figure 1 A flowchart of a method for executing an operation based on code processing provided by this application is shown in FIG. Figure 1 As shown, the method includes:

[0077] S101. In response to a server connection request initiated by a user, connect to a remote server that matches the server connection request; and display a code editing interface.

[0078] The server connection request is used to request connection to at least one remote server.

[0079] In one example, a user can initiate a server connection request through a browser of the current device, and after the connection is successful, a code editing interface is displayed in the browser. At this time, the user can perform code processing in the code editing interface, for example, adding code, deleting code, copying code, pasting code, etc.

[0080] When processing code, if the operations that match the code processing are performed in plain text (for example, when copying code, the copied code content is displayed in plain text), there is a risk of code leakage, which in turn affects the security of the code. In this case, the security of the code can be enhanced and the code leakage can be prevented according to the steps described below.

[0081] S102, obtaining user-related information of the user; and displaying a screen watermark generated based on the user-related information in a code editing interface.

[0082] In one example, user-related information may include, but is not limited to, the following information: user name, current device name, current device address, time of connecting to the remote server, user ID (eg, user's work ID), user contact information, etc.

[0083] In one example, after obtaining the user-related information of the user, a screen watermark may be generated based on at least part of the user-related information. For example, a screen watermark may be generated based on the user name and user contact information, or based on the user name, user number, and user contact information, etc. The content of the generated screen watermark is not limited here, and is subject to implementation.

[0084] In specific implementation, a canvas can be generated according to at least part of the user's relevant information, and at least part of the user's relevant information can be drawn in the canvas through the fillText attribute of the canvas. After that, the drawn canvas is inserted into the DOM node to generate a corresponding screen watermark.

[0085] S103: If a code triggering operation for a target code in the code editing interface is detected, a data encryption method matching the code triggering operation is determined, and the target code is encrypted based on the matching data encryption method to obtain an encrypted target code.

[0086] The code triggering operation includes at least one of a code copying operation, a code editing operation, and a code communication operation.

[0087] In one example, the code copy operation may be triggered in ways including, but not limited to, the following ways: copying a shortcut key, right-clicking a mouse and selecting copy, and the like.

[0088] In one example, the code editing operation may indicate an add, delete, or modify operation on the code.

[0089] In one example, the code communication operation may indicate an operation of communicating with a remote server. For example, the code communication operation may indicate transmitting the code to the remote server.

[0090] In an example, when the code triggering operation is a code copying operation, the target code can be understood as the code copied by the code copying operation; when the code triggering operation is a code editing operation, the target code can be understood as the code edited by the code editing operation, such as added / deleted code, or modified code, etc.; when the code triggering operation is a code communication operation, the target code can be understood as the code that needs to communicate with a remote server.

[0091] In the above implementation, a matching data encryption method can be selected according to different code processing methods. For example, for code copying operations, the copied code content needs to be encrypted. At this time, any data encryption method can be selected, such as base64 encryption method; for code editing operations, the target code needs to be prohibited from being displayed in plain text. At this time, any encryption method that prohibits plain text display can be selected, such as displaying the target code receipt on the canvas; for code communication operations, the target code needs to be encrypted during data transmission. At this time, any communication encryption method can be selected, such as symmetric encryption method, etc. The data encryption method matching each code triggering operation is not limited here, and it is subject to meeting actual needs.

[0092] S104: Based on the encrypted target code, execute a code triggering action that matches the code triggering operation.

[0093] For example, when the code trigger operation is a code copy operation, the matching code trigger action is to copy the encrypted target code to the clipboard; when the code trigger operation is a code editing operation, the matching code trigger action is to save / display the encrypted target code; when the code trigger operation is a code communication operation, the matching code trigger action is to transmit the encrypted target code to a remote server.

[0094] It can be seen from the above description that the embodiment of the present application can respond to the server connection request initiated by the user, connect to the remote server matching the server connection request, and display the code editing interface. At this time, the user's user-related information can be obtained; and the screen watermark generated based on the user-related information is displayed in the code editing interface. In this way, the code can be prevented from being leaked by screenshots or screen recordings to a certain extent by generating and displaying the screen watermark in the code editing interface, thereby improving the security of the code to a certain extent. If a code triggering operation for the target code in the code editing interface is detected, the data encryption method matching the code triggering operation is determined, and the target code is encrypted based on the matching data encryption method to obtain the encrypted target code. In this way, the target code can be encrypted according to different code triggering operations using a matching data encryption method, and the target code can be encrypted from multiple levels, thereby improving the comprehensiveness and effectiveness of the target code encryption. Afterwards, based on the encrypted target code, a code triggering action matching the code triggering operation can be executed, which can further improve the code security and prevent code leakage problems.

[0095] Figure 2A flowchart of another method for executing an operation based on code processing provided by this application is shown in FIG. Figure 2 As shown, the method includes:

[0096] S201. In response to a server access request initiated by a user, display a list of server resources that match the user's server access rights.

[0097] The server resource list includes server related information of at least one remote server that the user is allowed to access, wherein the server related information is used to identify the remote server, for example, the server related information may indicate the name of the server, or indicate the number of the server.

[0098] In one example, the embodiment of the present application can initiate a server access request in the browser of the current device and determine the server access rights of the user for each remote server. Then, the server-related information of each remote server whose parameters match the user's server access rights is obtained in the server resource list.

[0099] In one possible implementation, before responding to a server access request initiated by a user, the user's access rights to the remote server may be configured first. For example, each remote server may be displayed in the current device, and user-accessible users may be added to each remote server, thereby configuring corresponding server access rights for the user.

[0100] In the above implementation, users who are allowed to connect to / access the remote server can be screened according to the user's access rights, thereby ensuring the security of server resources.

[0101] S202: In response to a server connection request initiated by a user, connect to a remote server that matches the server connection request; and display a code editing interface.

[0102] The server connection request is used to request connection to at least one remote server.

[0103] In an example, this step can refer to the content described in S101 above, and will not be described in detail here.

[0104] S203, obtaining user-related information of the user; and displaying the screen watermark generated based on the user-related information in the code editing interface.

[0105] For an example, see Figure 3 , Figure 3 An implementation flowchart of displaying a screen watermark in a code editing interface provided in an embodiment of the present application.

[0106] like Figure 3As shown, first obtain user-related information, and then create a canvas based on the user-related information of the user. After that, the canvas can be accessed through the drawing function API in the JavaScript code to generate the corresponding graphics. After that, a div tag corresponding to the graphics can be created, and the graphics can be set as the background image. Then, the graphics are added to the dom node and rendered to the browser, so that they are displayed in the code editing interface.

[0107] In one example, the embodiment of the present application can also monitor the DOM node of the screen watermark, and regenerate the screen watermark when the DOM node of the screen watermark changes. For example, when the attribute of the DOM node of the screen watermark changes, or the DOM node of the screen watermark is deleted, the screen watermark can be regenerated and displayed in the code editing interface to prevent code leakage caused by tampering with the screen watermark.

[0108] In an optional implementation, the embodiment of the present application can monitor the changes of the DOM node of the screen watermark through the MutationObserver property in the Windows environment. Figure 3 As shown, you can monitor node changes, and when you determine that a node has changed, regenerate the graph and display it.

[0109] S204: If a code triggering operation for a target code in the code editing interface is detected, a data encryption method matching the code triggering operation is determined, and the target code is encrypted based on the matching data encryption method to obtain an encrypted target code.

[0110] The code triggering operation includes at least one of a code copying operation, a code editing operation, and a code communication operation.

[0111] The following describes in detail the implementation process of encrypting the target code based on the matching data encryption method to obtain the encrypted target code for various types of code trigger operations.

[0112] In one example, if the code triggering operation indicates a code copying operation, the data encryption method that matches the code copying operation indicates an obfuscated encryption method. At this time, the target code can be first encoded according to the preset printable characters to obtain the target encoded data; then, the target encoded data is obfuscated to obtain the obfuscated target encoded data; then, the preset identification information is obtained, and the preset identification information is concatenated with the obfuscated target encoded data to obtain the encrypted target code.

[0113] In one example, printable characters may be understood as characters that can be directly displayed in a computer device or directly printed. For example, the printable characters may include but are not limited to the following characters: AZ, az, 0-9, +, / , etc.

[0114] In one example, when encoding the target code according to the printable characters, the base64 encoding method or the base32 encoding method may be used, and the specific encoding method is not limited here.

[0115] In one example, the preset identification information may be associated with the target code. For example, the preset representation information may be an identification of a project to which the target code belongs, or an identification of a department to which the target code belongs.

[0116] In another example, the preset identification information may also be a predefined identification. For example, the predefined identification may be a digital identification, a letter identification, a symbol identification, etc. The preset identification information is not limited here.

[0117] This implementation method can encrypt the target code through obfuscation encryption after detecting the code copy operation and before executing the code copy action to ensure that the content copied to the clipboard is encrypted content. At this time, the specific type and specific content of the copied content cannot be determined from the content in the clipboard, thereby improving the effectiveness of the target code encryption.

[0118] In one example, if the code triggering operation indicates a code editing operation, the data encryption method matching the code editing operation indicates a graphic encryption method. At this time, a target canvas can be generated according to a preset canvas generation requirement, and at least a portion of the target code that meets the preset canvas generation requirement is drawn into the target canvas to obtain an encrypted target code.

[0119] The preset canvas generation requirement indicates the amount of code included in the target canvas.

[0120] Since the amount of code of the edited target code cannot be controlled, in order to ensure the encryption performance of the target code, the canvas generation requirements can be set in advance, and according to the canvas generation requirements, the target code can be drawn in one or more canvases, so that the target code can be displayed through the canvas, thereby preventing the target code from being displayed in plain text.

[0121] In an example, the preset canvas generation requirement may indicate that the canvas includes 100 lines of code, or may indicate that the canvas includes 1,000 characters, etc. The preset canvas generation requirement is not limited here, and is subject to achievable implementation.

[0122] In one example, if the code triggering operation indicates a code communication operation, the data encryption method matching the code communication operation indicates a session encryption method. The code communication operation indicates an operation of performing code communication with a remote server. At this time, the target code can be symmetrically encrypted based on the session key generated by the current device to obtain the encrypted target code; wherein the session key indicates the encryption key for communication between the current device and the remote server.

[0123] For an example, see Figure 4 , Figure 4 A flow chart of generating a session key provided in an embodiment of the present application. Figure 4 As shown, after the browser and the remote server establish a connection, a websocket channel can be created for data communication between the browser and the remote server.

[0124] In specific implementation, during the handshake phase between the browser and the remote server, the browser (i.e., the browser side) can send a connection request to the remote server (i.e., the remote server side), and after verifying the connection request, the remote server can return a string of SSL certificates (including the public key) (i.e., Figure 4 SSL certificate and public key shown in the figure). After receiving the SSL certificate (including the public key), the browser confirms the certificate and generates a session key. Then, it encrypts the session key with the public key in the SSL certificate and sends it to the remote server. At this time, the remote server can decrypt it to obtain the session key. After that, both parties use the same session key to communicate data to ensure the confidentiality and integrity of the data during transmission, avoiding interception and eavesdropping of the data stream by capturing packets.

[0125] S205: Based on the encrypted target code, execute a code triggering action that matches the code triggering operation.

[0126] It can be seen from the above description that, in the case where the code triggering operation is a code copying operation, the code triggering action matched with the code copying operation is executed as follows: copying the encrypted target code to the clipboard.

[0127] At this time, after executing the code triggering action matching the code copy operation, the pasting position indicated by the code paste instruction can also be determined in response to the code paste instruction initiated by the user. The code instruction is used to request pasting the target code corresponding to the code copy operation.

[0128] If it is determined that the pasting position indicated by the code pasting instruction is located in the code editing interface, the encrypted target code is decrypted and then the target code is pasted to the pasting position indicated by the code pasting instruction.

[0129] If it is determined that the pasting position indicated by the code pasting instruction is not located in the code editing interface, the encrypted target code is pasted to the pasting position indicated by the code pasting instruction.

[0130] This implementation method can directly display a garbled string when pasting the target code outside the code editing interface, thereby effectively preventing code leakage through copying.

[0131] In one example, after executing the code triggering action matching the code triggering operation based on the encrypted target code, the user's operation behavior can also be reported, thereby achieving the traceability of the user's overall operation behavior and further preventing code leakage. See the steps described below for details.

[0132] S206: Generate a user operation log based on the target code, the code triggering operation, and the executed code triggering action; and save the user operation log to a preset storage location.

[0133] In one example, the preset storage location can be understood as a preset cloud storage location, or it can also be another preset location, etc. The preset storage location is not limited here.

[0134] See also Figure 5 , Figure 5 A schematic diagram of a structure of an operation execution device based on code processing provided in an embodiment of the present application, such as Figure 5 As shown, the code processing-based operation execution device 500 includes:

[0135] The first response unit 501 is used to respond to a server connection request initiated by a user, connect to a remote server that matches the server connection request, and display a code editing interface; wherein the server connection request is used to request connection to at least one remote server.

[0136] The display unit 502 is used to obtain user-related information of the user; and display the screen watermark generated based on the user-related information in the code editing interface.

[0137] The encryption unit 503 is used to determine a data encryption method that matches the code triggering operation if a code triggering operation for the target code in the code editing interface is detected, and encrypt the target code based on the matching data encryption method to obtain the encrypted target code; wherein the code triggering operation includes at least one of a code copying operation, a code editing operation, and a code communication operation.

[0138] The execution unit 504 is used to execute the code triggering action matching the code triggering operation based on the encrypted target code.

[0139] See also Figure 6 , Figure 6 A schematic diagram of the structure of another operation execution device based on code processing provided in an embodiment of the present application, such as Figure 6 As shown, the code processing-based operation execution device 600 includes:

[0140] The first response unit 601 is used to respond to a server connection request initiated by a user, connect to a remote server that matches the server connection request, and display a code editing interface; wherein the server connection request is used to request connection to at least one remote server.

[0141] The display unit 602 is used to obtain user-related information of the user; and display the screen watermark generated based on the user-related information in the code editing interface.

[0142] The encryption unit 603 is used to determine a data encryption method that matches the code triggering operation if a code triggering operation for the target code in the code editing interface is detected, and encrypt the target code based on the matching data encryption method to obtain the encrypted target code; wherein the code triggering operation includes at least one of a code copying operation, a code editing operation, and a code communication operation.

[0143] The execution unit 604 is used to execute the code triggering action matching the code triggering operation based on the encrypted target code.

[0144] In a possible implementation, the code triggering operation indicates a code copying operation; the data encryption mode matching the code copying operation indicates an obfuscated encryption mode; the encryption unit 603 is used to:

[0145] According to the preset printable characters, the target code is encoded to obtain the target encoded data;

[0146] Obfuscating the target encoded data to obtain obfuscated target encoded data;

[0147] The preset identification information is obtained, and the preset identification information is concatenated with the obfuscated target coding data to obtain the encrypted target code.

[0148] In a possible implementation, the device is also used for:

[0149] After executing a code triggering action matching the code triggering operation based on the encrypted target code, in response to a code pasting instruction initiated by a user, determining a pasting position indicated by the code pasting instruction;

[0150] If it is determined that the pasting position indicated by the code pasting instruction is located in the code editing interface, the encrypted target code is decrypted and then the target code is pasted to the pasting position indicated by the code pasting instruction;

[0151] If it is determined that the pasting position indicated by the code pasting instruction is not located in the code editing interface, the encrypted target code is pasted to the pasting position indicated by the code pasting instruction.

[0152] In a possible implementation, the code triggering operation indicates a code editing operation; the data encryption mode matching the code editing operation indicates a graphic encryption mode; the encryption unit 603 is used to:

[0153] A target canvas is generated according to preset canvas generation requirements, and at least part of the target code that meets the preset canvas generation requirements is drawn into the target canvas to obtain an encrypted target code; wherein the preset canvas generation requirements indicate the amount of code included in the target canvas.

[0154] In a possible implementation, the code triggering operation indicates a code communication operation; the code communication operation indicates an operation of performing code communication with a remote server; the data encryption mode matching the code communication operation indicates a session encryption mode; the encryption unit 603 is used to:

[0155] Based on the session key generated by the current device, the target code is symmetrically encrypted to obtain the encrypted target code; wherein the session key indicates the encryption key for communication between the current device and the remote server.

[0156] In a possible implementation manner, the device further includes a reporting unit 605, configured to:

[0157] After executing a code triggering action matching the code triggering operation based on the encrypted target code, a user operation log is generated based on the target code, the code triggering operation and the executed code triggering action; and the user operation log is saved to a preset storage location.

[0158] In a possible implementation manner, the device further includes a second response unit 606, configured to:

[0159] Before responding to a server connection request initiated by a user, in response to a server access request initiated by a user, a server resource list matching the user's server access rights is displayed; wherein the server resource list includes server-related information of at least one remote server that the user is allowed to access.

[0160] The code processing-based operation execution device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0161] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 7 As shown, the computer device 700 provided in this embodiment includes: at least one processor 701 and a memory 702. Optionally, the device 70 further includes a communication component 703. The processor 701, the memory 702 and the communication component 703 are connected via a bus 704.

[0162] In a specific implementation process, at least one processor 701 executes the computer-executable instructions stored in the memory 702, so that at least one processor 701 executes the above method.

[0163] The specific implementation process of the processor 701 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0164] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0165] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk storage.

[0166] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0167] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0168] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0169] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0170] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0171] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0172] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple 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.

[0173] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0174] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0175] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0176] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for executing an operation based on code processing, characterized in that: The method comprises: In response to a server connection request initiated by a user, connecting to a remote server matching the server connection request; and displaying a code editing interface; wherein the server connection request is used to request connection to at least one remote server; Acquire user related information of the user; and display a screen watermark generated based on the user related information in the code editing interface; If a code triggering operation for a target code in the code editing interface is detected, a data encryption method matching the code triggering operation is determined, and the target code is encrypted based on the matching data encryption method to obtain an encrypted target code; wherein the code triggering operation includes at least one of a code copying operation, a code editing operation, and a code communication operation; Based on the encrypted target code, a code triggering action matching the code triggering operation is executed.

2. The method according to claim 1, characterized in that The code triggering operation indicates a code copying operation; the data encryption method matching the code copying operation indicates an obfuscated encryption method; the target code is encrypted based on the matching data encryption method to obtain the encrypted target code, including: According to the preset printable characters, the target code is encoded to obtain target encoded data; Obfuscating the target coded data to obtain obfuscated target coded data; The preset identification information is obtained, and the preset identification information is concatenated with the obfuscated target coding data to obtain the encrypted target code.

3. The method according to claim 2, characterized in that After executing a code triggering action matching the code triggering operation based on the encrypted target code, the method further includes: In response to the code pasting instruction initiated by the user, determining a pasting position indicated by the code pasting instruction; If it is determined that the pasting position indicated by the code pasting instruction is located in the code editing interface, the encrypted target code is decrypted and then the target code is pasted to the pasting position indicated by the code pasting instruction; If it is determined that the pasting position indicated by the code pasting instruction is not located in the code editing interface, the encrypted target code is pasted to the pasting position indicated by the code pasting instruction.

4. The method according to claim 1, characterized in that: The code triggering operation indicates a code editing operation; the data encryption method matching the code editing operation indicates a graphic encryption method; the target code is encrypted based on the matching data encryption method to obtain the encrypted target code, including: A target canvas is generated according to a preset canvas generation requirement, and at least a portion of the target code that meets the preset canvas generation requirement is drawn into the target canvas to obtain the encrypted target code; wherein the preset canvas generation requirement indicates the amount of code included in the target canvas.

5. The method according to claim 1, characterized in that The code triggering operation indicates a code communication operation; the code communication operation indicates an operation of performing code communication with the remote server; the data encryption mode matching the code communication operation indicates a session encryption mode; The method of encrypting the target code based on the matched data encryption method to obtain the encrypted target code includes: Based on the session key generated by the current device, the target code is symmetrically encrypted to obtain the encrypted target code; wherein the session key indicates an encryption key for communication between the current device and the remote server.

6. The method according to any one of claims 1 to 5, characterized in that After executing a code triggering action matching the code triggering operation based on the encrypted target code, the method further includes: Based on the target code, the code triggering operation and the executed code triggering action, a user operation log is generated; and the user operation log is saved to a preset storage location.

7. The method according to claim 1, characterized in that Before responding to the server connection request initiated by the user, the method further includes: In response to the server access request initiated by the user, a server resource list matching the server access rights of the user is displayed; wherein the server resource list includes server related information of at least one remote server that the user is allowed to access.

8. An operation execution device based on code processing, characterized in that: include: A first response unit, configured to respond to a server connection request initiated by a user and connect to a remote server matching the server connection request; and displaying a code editing interface; wherein the server connection request is used to request connection to at least one remote server; A display unit, used to obtain user related information of the user; and display a screen watermark generated based on the user related information in the code editing interface; an encryption unit, configured to, if a code triggering operation for a target code in the code editing interface is detected, determine a data encryption method that matches the code triggering operation, and encrypt the target code based on the matched data encryption method to obtain an encrypted target code; wherein the code triggering operation includes at least one of a code copying operation, a code editing operation, and a code communication operation; The execution unit is used to execute a code triggering action matching the code triggering operation based on the encrypted target code.

9. A computer device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

Citation Information

Patent Citations

  • Data processing method and apparatus, system and computer readable storage medium

    CN107786331A

  • Picture processing method, system and terminal device

    CN109472847A

  • Watermark embedding method and device, watermark extracting method and device, equipment and data processing method

    CN111223032A

  • Code editing method and device

    CN113157263A

  • Document content protection method and device

    CN116361828A