A code editing method and system
By detecting and verifying external devices, determining the device position relationship and dynamically switching device roles, the problem of small difficulty in editing and displaying code on mobile devices is solved, and an efficient and convenient code editing experience is achieved.
Patent Information
- Application Number
- CN202211631971.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-12-19
AI Technical Summary
Mobile devices have small screens, making it difficult to complete the requirements for inputting and displaying codes at the same time.
By detecting external devices, performing identity authentication and data connections, determining device position relationship, dynamically switching display devices and editing devices, and displaying encoded results on external devices using wireless communication.
It realizes efficient editing and displaying code on mobile devices, improving the convenience and adaptability of code editing.
Smart Images

Figure CN116185368B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electronic digital data processing, and in particular relates to a code editing method and system. Background Art
[0002] The code is a source file written by programmers in a language supported by development tools. It is a set of clear rules that use characters, symbols or signal code elements to represent information in discrete form.
[0003] In the current code editing process, users usually use a fixed desktop computer or laptop computer for editing, because the above-mentioned computer can be directly connected to a keyboard, and the code can be quickly input through the keyboard.
[0004] In outdoor environments, people generally do not carry computers with them, and only have mobile devices with them. However, the screens of mobile devices are small, making it difficult to simultaneously complete the needs of inputting and displaying codes. Summary of the invention
[0005] The purpose of the embodiment of the present invention is to provide a code editing method, which aims to solve the problem that the screen of a mobile device is small and it is difficult to simultaneously complete the requirements of inputting and displaying codes.
[0006] The embodiment of the present invention is implemented as follows: a code editing method, the method comprising:
[0007] Configure the operating environment according to the code type;
[0008] Detect external devices, authenticate the external devices, and establish data connection after the authentication is passed;
[0009] Performing position detection on external devices, determining the positional relationship with the external devices, and determining the display device and the editing device;
[0010] Encode the content input by the editing device and display the encoded result on the display device.
[0011] Preferably, the steps of detecting the external device, authenticating the external device, and establishing a data connection after the authentication is passed specifically include:
[0012] Perform device connection broadcasting, send out device connection request through broadcasting, after the external device detects the device connection request, it sends out a waiting connection signal, and pops up a connection code display interface;
[0013] Receive the signal to be connected, and the connection code input interface pops up, and the connection code is entered through the connection code input interface;
[0014] An encrypted connection request is sent out according to the connection code, and the external device completes the data connection according to the encrypted connection request.
[0015] Preferably, the steps of detecting the position of the external device, determining the positional relationship with the external device, and determining the display device and the editing device specifically include:
[0016] After the data connection is completed, the external device acts as a display device, and the code is displayed through the display device. The device that initiates the data connection is the main device, and the main device acts as an editing device at this time;
[0017] Collecting real-time data collected by three-axis acceleration sensors of the display device and the editing device, and determining the relative position relationship between the two according to the real-time data;
[0018] The switching between the display device and the editing device is completed according to the relative position relationship between the display device and the editing device.
[0019] Preferably, the step of encoding the content input by the editing device and displaying the encoding result on the display device specifically includes:
[0020] Receiving code editing information sent from an editing device;
[0021] Determine display interface information according to the code editing information, wherein the display interface information is generated according to a resolution corresponding to the display device;
[0022] Determine whether the external device is a display device. If the external device is a display device, send the display interface information to the external device via wireless communication. Otherwise, directly display the display interface information.
[0023] Preferably, when the display device is displaying, if a screen sliding signal is detected, the editing device is converted into a display device, and both display at the same time. When either display device detects a screen click signal, the other display device is converted into an editing device.
[0024] Preferably, when there are two groups of display devices, the contents displayed by the two groups of display devices are determined according to the positional relationship, and the images displayed by the two groups are spliced together to obtain complete display contents.
[0025] Another object of an embodiment of the present invention is to provide a code editing system, the system comprising:
[0026] The environment configuration module is used to configure the operating environment according to the code type;
[0027] The device verification module is used to detect external devices, authenticate the external devices, and establish a data connection after the verification is passed;
[0028] The device position identification module is used to detect the position of the external device, determine the position relationship with the external device, and determine the display device and the editing device;
[0029] The content display module is used to encode the content input by the editing device and display the encoding result on the display device.
[0030] Preferably, the device verification module includes:
[0031] An information broadcast unit, used for performing device connection broadcast, sending a device connection request through broadcast, and after the external device detects the device connection request, it sends a waiting connection signal and pops up a connection code display interface;
[0032] A connection code input unit, used to receive a signal to be connected, pop up a connection code input interface, and input a connection code through the connection code input interface;
[0033] The data connection unit is used to send an encrypted connection request according to the connection code, and the external device completes the data connection according to the encrypted connection request.
[0034] Preferably, the device location identification module includes:
[0035] A device initialization unit, which is used for, after the data connection is completed, the external device acts as a display device, and the code is displayed through the display device, and the device initiating the data connection is the main device, and the main device acts as an editing device at this time;
[0036] The device positioning unit is used to collect real-time data collected by the three-axis acceleration sensors of the display device and the editing device, and determine the relative position relationship between the two according to the real-time data;
[0037] The position identification unit is used to complete the switching of the display device and the editing device according to the relative position relationship between the display device and the editing device.
[0038] Preferably, the content display module includes:
[0039] An information receiving unit, used for receiving code editing information sent from an editing device;
[0040] A display interface generating unit, configured to determine display interface information according to the code editing information, wherein the display interface information is generated according to a resolution corresponding to the display device;
[0041] The information display unit is used to determine whether the external device is a display device. If the external device is a display device, the display interface information is sent to the external device via wireless communication. Otherwise, the display interface information is directly displayed.
[0042] A code editing method provided by an embodiment of the present invention uses two devices at the same time, one of which is used as an editing device and the other is used as a display device. During this process, the positional relationship of the devices is identified in real time, and the display device and the editing device are determined based on the positional relationship, thereby improving the adaptability, and the use of dual devices can improve the convenience of code editing. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flowchart of a code editing method provided by an embodiment of the present invention;
[0044] Figure 2 A flowchart of the steps of detecting an external device, authenticating the external device, and establishing a data connection after the authentication is passed, provided in an embodiment of the present invention;
[0045] Figure 3 A flowchart of the steps of detecting the position of an external device, determining the positional relationship with the external device, and determining the display device and the editing device provided in an embodiment of the present invention;
[0046] Figure 4 A flowchart of the steps of encoding content inputted by an editing device and displaying the encoding result on a display device provided by an embodiment of the present invention;
[0047] Figure 5 An architecture diagram of a code editing system provided by an embodiment of the present invention;
[0048] Figure 6 An architecture diagram of a device verification module provided by an embodiment of the present invention;
[0049] Figure 7 An architecture diagram of a device location identification module provided by an embodiment of the present invention;
[0050] Figure 8 An architectural diagram of a content display module provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0052] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0053] like Figure 1 FIG. 1 is a flowchart of a code editing method provided by an embodiment of the present invention, wherein the method comprises:
[0054] S100, configuring the operating environment according to the code type.
[0055] In this step, different operating environments are configured according to different code types. Different code types need to be run in different environments. For example, Visual Studio is the standard IDE under Windows. The VS series is an IDE (Integrated Development Environment), which is the mainstream choice tool for development under Windows. Dev C++ is an open source IDE whose development environment includes multi-page windows, project editors, and debuggers.
[0056] S200, detecting an external device, performing identity authentication on the external device, and establishing a data connection after the authentication passes.
[0057] In this step, the external device is detected. Specifically, a device connection request is first sent to the outside, and the nearby devices are notified to respond through the device connection request, such as broadcasting through Bluetooth or broadcasting through WIFI signals. After the external device detects the device connection request, it will actively display the connection code. At this time, an input interface will pop up on the device, and the connection code will be entered into the input interface. After the device enters the code, the connection code is encrypted and transmitted. After receiving the encrypted connection code, the external device completes the data connection with the device.
[0058] S300, performing position detection on the external device, determining the position relationship with the external device, and determining the display device and the editing device.
[0059] In this step, the position of the external device is detected. In this step, the acceleration data generated by the three-axis acceleration sensor in the device can be directly read. The external device also reads the acceleration data generated by its built-in three-axis acceleration sensor and sends it to the present device. The present device performs unified processing, thereby determining the moving direction and distance of the present device and the external device based on the acceleration data to determine the positional relationship between the present device and the external device. After completing the data connection, the present device and the external device are placed in the same plane, and both are in a horizontal state with the long sides aligned. The present device is close to the user and the external device is away from the user. When the user moves the present device or the external device, the device close to the user can be converted into an editing device and the other device into a display device based on their positional relationship.
[0060] S400, encoding is performed according to the content input by the editing device, and the encoding result is displayed on the display device.
[0061] In this step, encoding is performed according to the content input by the editing device. The user directly inputs the corresponding code through the editing device. The code is the code editing information. The code editing information needs to be sent to this device for processing. After the processing is completed, the display interface information is generated, and the display interface information is sent to the corresponding display device for display. If the display device is an external device, it is sent to the external device via wireless communication, and the external device displays the actual content according to the display interface information, that is, the encoding result is displayed on the display device.
[0062] like Figure 2 As shown, as a preferred embodiment of the present invention, the steps of detecting an external device, authenticating the external device, and establishing a data connection after the authentication is passed specifically include:
[0063] S201, performing device connection broadcasting, sending a device connection request through broadcasting, after the external device detects the device connection request, it sends a waiting signal and pops up a connection code display interface.
[0064] In this step, the device connection broadcast is performed. During the process, the preset broadcast content is broadcast via Bluetooth. Specifically, the Bluetooth signal and WIFI signal in the current environment can be detected first, and the signal with the highest strength can be selected for broadcast. After the external device detects the device connection request, it sends a pending connection signal and pops up the connection code display interface.
[0065] S202, receiving a signal to be connected, popping up a connection code input interface, and inputting a connection code through the connection code input interface.
[0066] In this step, a signal to be connected is received. When the device receives the signal to be connected, it indicates that an external device is waiting for connection. The user checks the connection code displayed on the external device and inputs the displayed code into the connection code input interface popped up from the device.
[0067] S203, sending an encrypted connection request according to the connection code, and the external device completes the data connection according to the encrypted connection request.
[0068] In this step, an encrypted connection request is issued according to the connection code. After the device obtains the connection code, it determines to call the encryption function according to the connection code, encrypts the connection code according to the encryption function, enters the communication address of the device, obtains the encrypted connection request, and then broadcasts the encrypted connection request. The external device receives the encrypted connection request and decrypts it. When the decrypted connection code is consistent with the connection code it displays, a data connection is established with the device.
[0069] like Figure 3 As shown, as a preferred embodiment of the present invention, the steps of detecting the position of the external device, determining the positional relationship with the external device, and determining the display device and the editing device specifically include:
[0070] S301, after the data connection is completed, the external device acts as a display device, and the code is displayed through the display device. The device that initiates the data connection is the main device, and the main device acts as an editing device at this time.
[0071] In this step, after the data connection is completed, the external device acts as a display device, that is, after the data connection is completed, both the present device and the display device are in an initialized state. The present device is an editing device, and its screen directly displays a virtual keyboard for encoding. The external device acts as a display device and displays content according to the obtained interface display information.
[0072] S302, collecting real-time data collected by the three-axis acceleration sensors of the display device and the editing device, and determining the relative position relationship between the two according to the real-time data.
[0073] In this step, real-time data collected by the three-axis acceleration sensors of the display device and the editing device are collected. When it is detected that the present device and / or the external device are in a moving state, the moving direction and distance of the present device and / or the external device are calculated based on the real-time data, thereby determining the position conversion relationship between the two.
[0074] S303, completing the switching between the display device and the editing device according to the relative position relationship between the display device and the editing device.
[0075] In this step, the switching of the display device and the editing device is completed according to their relative position relationship, that is, the relative position relationship between the two is analyzed in real time. When it is determined that the positions of the display device and the editing device are to be exchanged, the display device and the editing device are swapped. For example, in the initial state, the main device serves as the editing device and the external device serves as the display device. After the swap, the external device serves as the editing device and the main device serves as the display device.
[0076] like Figure 4 As shown, as a preferred embodiment of the present invention, the step of encoding the content inputted by the editing device and displaying the encoding result on the display device specifically includes:
[0077] S401, receiving code editing information sent from an editing device.
[0078] In this step, code editing information is received from the editing device. After the code editing information is generated, it is determined whether the editing device is a main device. If it is a main device, data processing is performed directly on the main device. Otherwise, the code editing information needs to be sent back to the main device.
[0079] S402, determining display interface information according to the code editing information, wherein the display interface information is generated according to a resolution corresponding to the display device.
[0080] S403, determining whether the external device is a display device, if the external device is a display device, sending the display interface information to the external device via wireless communication, otherwise, directly displaying the display interface information.
[0081] In this step, the display interface information is determined according to the code editing information. After the main device determines the display interface information according to the code editing information, the display interface information is sent to the display device. Therefore, in this process, a judgment is required. If the external device is a display device, the display interface information is sent to the external device through wireless communication. Otherwise, the display interface information is directly displayed. When the display device is displaying, if a screen sliding signal is detected, the editing device is converted into a display device, and the two are displayed at the same time. When any display device detects a screen click signal, the other display device is converted into an editing device.
[0082] like Figure 5 As shown, a code editing system provided by an embodiment of the present invention includes:
[0083] The environment configuration module 100 is used to configure the operating environment according to the code type.
[0084] In this system, the environment configuration module 100 configures different operating environments according to different code types. Different code types need to be run in different environments, such as Visual Studio, which is a standard IDE under Windows. The VS series is an IDE (Integrated Development Environment), which is the mainstream choice tool for development under Windows. Dev C++ is an open source IDE, and its development environment includes multi-page windows, project editors, and debuggers.
[0085] The device verification module 200 is used to detect external devices, perform identity verification on the external devices, and establish a data connection after the verification is passed.
[0086] In this system, the device verification module 200 detects external devices. Specifically, it first sends a device connection request to the outside, and notifies nearby devices to respond through the device connection request, such as broadcasting through Bluetooth or broadcasting through WIFI signals. After the external device detects the device connection request, it will actively display the connection code. At this time, an input interface will pop up on the device, and the connection code will be entered into the input interface. After the device enters the code, the connection code is encrypted and transmitted. After receiving the encrypted connection code, the external device completes the data connection with the device.
[0087] The device position identification module 300 is used to detect the position of the external device, determine the position relationship between the external device and the display device and the editing device.
[0088] In this system, the device position identification module 300 performs position detection on the external device. In this step, the acceleration data generated by the three-axis acceleration sensor in the device can be directly read. The external device also reads the acceleration data generated by its built-in three-axis acceleration sensor and sends it to the device for unified processing by the device, so as to determine the moving direction and distance of the device and the external device according to the acceleration data, so as to determine the positional relationship between the device and the external device. After completing the data connection, the device and the external device are placed in the same plane, and both are in a horizontal screen state with the long sides aligned. The device is close to the user and the external device is away from the user. Then, when the user moves the device or the external device, the device close to the user can be converted into an editing device and the other device into a display device according to their positional relationship.
[0089] The content display module 400 is used to encode the content input by the editing device and display the encoding result on the display device.
[0090] In this system, the content display module 400 encodes according to the content input by the editing device. The user directly inputs the corresponding code through the editing device. The code is the code editing information. The code editing information needs to be sent to this device for processing. After the processing is completed, the display interface information is generated, and the display interface information is sent to the corresponding display device for display. If the display device is an external device, it is sent to the external device via wireless communication, and the external device displays the actual content according to the display interface information, that is, the encoding result is displayed on the display device.
[0091] like Figure 6 As shown, as a preferred embodiment of the present invention, the device verification module 200 includes:
[0092] The information broadcast unit 201 is used to perform device connection broadcasting and send out a device connection request through broadcasting. After the external device detects the device connection request, it sends out a waiting connection signal and pops up a connection code display interface.
[0093] In this module, the information broadcast unit 201 performs device connection broadcasting. During the process, the preset broadcast content is broadcast via Bluetooth. Specifically, the Bluetooth signal and WIFI signal in the current environment can be detected first, and the signal with the highest strength can be selected for broadcasting. After the external device detects the device connection request, it sends a pending connection signal and pops up a connection code display interface.
[0094] The connection code input unit 202 is used to receive a signal to be connected, pop up a connection code input interface, and input a connection code through the connection code input interface.
[0095] In this module, the connection code input unit 202 receives a signal to be connected. When the device receives the signal to be connected, it indicates that there is an external device waiting for connection. The user checks the connection code displayed on the external device and inputs the displayed code into the connection code input interface popped up from the device.
[0096] The data connection unit 203 is used to send an encrypted connection request according to the connection code, and the external device completes the data connection according to the encrypted connection request.
[0097] In this module, the data connection unit 203 sends an encrypted connection request according to the connection code. After the device obtains the connection code, it determines to call the encryption function according to the connection code, encrypts the connection code according to the encryption function, enters the communication address of the device, obtains the encrypted connection request, and then broadcasts the encrypted connection request. The external device receives the encrypted connection request and decrypts it. When the decrypted connection code is consistent with the connection code it displays, a data connection is established with the device.
[0098] like Figure 7As shown, as a preferred embodiment of the present invention, the device location identification module 300 includes:
[0099] The device initialization unit 301 is used to, after the data connection is completed, use the external device as a display device to display the code through the display device, and the device initiating the data connection is the main device, which is now used as an editing device.
[0100] In this module, after the device initialization unit 301 completes the data connection, the external device acts as a display device, that is, after the data connection is completed, both the present device and the display device are in an initialized state. The present device is an editing device, and its screen directly displays a virtual keyboard for encoding. The external device acts as a display device and displays the content according to the obtained interface display information.
[0101] The device positioning unit 302 is used to collect real-time data collected by the three-axis acceleration sensors of the display device and the editing device, and determine the relative position relationship between the two based on the real-time data.
[0102] In this module, the device positioning unit 302 collects real-time data collected by the three-axis acceleration sensors of the display device and the editing device. When it is detected that the device and / or the external device are in a moving state, the moving direction and distance of the device and / or the external device are calculated based on the real-time data, thereby determining the position conversion relationship between the two.
[0103] The position identification unit 303 is used to complete the switching between the display device and the editing device according to the relative position relationship between the display device and the editing device.
[0104] In this module, the position identification unit 303 completes the switching of the display device and the editing device according to their relative position relationship, that is, it analyzes the relative position relationship between the two in real time. When it is determined that the positions of the display device and the editing device are to be exchanged, the display device and the editing device are swapped. For example, in the starting state, the main device serves as the editing device and the external device serves as the display device. After the swap, the external device serves as the editing device and the main device serves as the display device.
[0105] like Figure 8 As shown, as a preferred embodiment of the present invention, the content display module 400 includes:
[0106] The information receiving unit 401 is used to receive code editing information sent from an editing device.
[0107] In this module, the information receiving unit 401 receives the code editing information sent from the editing device. After generating the code editing information, it determines whether the editing device is the main device. If it is the main device, the data is directly processed on the main device. Otherwise, the code editing information needs to be sent back to the main device.
[0108] The display interface generating unit 402 is used to determine the display interface information according to the code editing information, and the display interface information is generated according to the resolution corresponding to the display device.
[0109] The information display unit 403 is used to determine whether the external device is a display device. If the external device is a display device, the display interface information is sent to the external device via wireless communication. Otherwise, the display interface information is directly displayed.
[0110] In this module, the display interface information is determined according to the code editing information. After the main device determines the display interface information according to the code editing information, the display interface information is sent to the display device. Therefore, in this process, a judgment is required. If the external device is a display device, the display interface information is sent to the external device through wireless communication. Otherwise, the display interface information is directly displayed. When the display device is displaying, if a screen sliding signal is detected, the editing device is converted into a display device, and the two are displayed at the same time. When any display device detects a screen click signal, the other display device is converted into an editing device.
[0111] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0112] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0113] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0114] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0115] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A code editing method, characterized in that: The method comprises: Configure the operating environment according to the code type; Detect external devices, authenticate the external devices, and establish data connection after the authentication is passed; Performing position detection on external devices, determining the positional relationship with the external devices, and determining the display device and the editing device; Encode the content input by the editing device and display the encoding result on the display device; The steps of detecting the position of the external device, determining the positional relationship with the external device, and determining the display device and the editing device specifically include: After the data connection is completed, the external device acts as a display device, and the code is displayed through the display device. The device that initiates the data connection is the main device, and the main device acts as an editing device at this time; Collecting real-time data collected by three-axis acceleration sensors of the display device and the editing device, and determining the relative position relationship between the two according to the real-time data; According to the relative position relationship between the display device and the editing device, the switching between the display device and the editing device is completed; Place the present device and the external device in the same plane, and make them both in landscape mode with their long sides aligned, the present device is close to the user and the external device is far away from the user. Then when the user moves the present device or the external device, the device close to the user can be converted into an editing device and the other device into a display device according to their positional relationship. In the initial state, the main device serves as an editing device and the external device serves as a display device. Real-time data collected by the three-axis acceleration sensors of the display device and the editing device are collected. When it is detected that the present device and / or the external device are in a moving state, the moving direction and distance of the present device and / or the external device are calculated according to the real-time data to determine the position conversion relationship between the two. When it is determined that the positions of the display device and the editing device are exchanged, the display device and the editing device are swapped. After the swap, the external device serves as the editing device and the main device serves as the display device.
2. The code editing method according to claim 1, characterized in that: The steps of detecting an external device, authenticating the external device, and establishing a data connection after the authentication is passed specifically include: Perform device connection broadcasting, send out device connection request through broadcasting, after the external device detects the device connection request, it sends out a waiting connection signal, and pops up a connection code display interface; Receive the signal to be connected, and the connection code input interface pops up, and the connection code is entered through the connection code input interface; An encrypted connection request is sent out according to the connection code, and the external device completes the data connection according to the encrypted connection request.
3. The code editing method according to claim 2, characterized in that: The step of encoding the content input by the editing device and displaying the encoding result on the display device specifically includes: Receiving code editing information sent from an editing device; Determine display interface information according to the code editing information, wherein the display interface information is generated according to a resolution corresponding to the display device; Determine whether the external device is a display device. If the external device is a display device, send the display interface information to the external device via wireless communication. Otherwise, directly display the display interface information.
4. The code editing method according to claim 1, characterized in that: When the display device is displaying, if a screen sliding signal is detected, the editing device is converted into a display device, and both display at the same time. When any display device detects a screen clicking signal, the other display device is converted into an editing device.
5. The code editing method according to claim 4, characterized in that: When there are two groups of display devices, the contents displayed by the two groups of display devices are determined according to the positional relationship, and the images displayed by the two groups are spliced together to obtain complete display contents.
6. A code editing system, characterized in that: The system comprises: The environment configuration module is used to configure the operating environment according to the code type; The device verification module is used to detect external devices, authenticate the external devices, and establish a data connection after the verification is passed; The device position identification module is used to detect the position of the external device, determine the position relationship with the external device, and determine the display device and the editing device; A content display module, used for encoding the content input by the editing device and displaying the encoding result on the display device; The device location identification module includes: A device initialization unit, which is used for, after the data connection is completed, the external device acts as a display device, and the code is displayed through the display device, and the device initiating the data connection is the main device, and the main device acts as an editing device at this time; The device positioning unit is used to collect real-time data collected by the three-axis acceleration sensors of the display device and the editing device, and determine the relative position relationship between the two according to the real-time data; A position identification unit, used to complete the switching of the display device and the editing device according to the relative position relationship between the display device and the editing device; Place the present device and the external device in the same plane, and make them both in landscape mode with their long sides aligned, the present device is close to the user and the external device is far away from the user. Then when the user moves the present device or the external device, the device close to the user can be converted into an editing device and the other device into a display device according to their positional relationship. In the initial state, the main device serves as an editing device and the external device serves as a display device. Real-time data collected by the three-axis acceleration sensors of the display device and the editing device are collected. When it is detected that the present device and / or the external device are in a moving state, the moving direction and distance of the present device and / or the external device are calculated according to the real-time data to determine the position conversion relationship between the two. When it is determined that the positions of the display device and the editing device are exchanged, the display device and the editing device are swapped. After the swap, the external device serves as the editing device and the main device serves as the display device.
7. The code editing system according to claim 6, characterized in that: The device verification module comprises: An information broadcast unit, used for performing device connection broadcast, sending a device connection request through broadcast, and after the external device detects the device connection request, it sends a waiting connection signal and pops up a connection code display interface; A connection code input unit, used to receive a signal to be connected, pop up a connection code input interface, and input a connection code through the connection code input interface; The data connection unit is used to send an encrypted connection request according to the connection code, and the external device completes the data connection according to the encrypted connection request.
8. The code editing system according to claim 7, characterized in that: The content display module includes: An information receiving unit, used for receiving code editing information sent from an editing device; A display interface generating unit, configured to determine display interface information according to the code editing information, wherein the display interface information is generated according to a resolution corresponding to the display device; The information display unit is used to determine whether the external device is a display device. If the external device is a display device, the display interface information is sent to the external device via wireless communication. Otherwise, the display interface information is directly displayed.
Citation Information
Patent Citations
Information synchronization method, device and terminal
CN105072246A
Method of automatically switching mode of work screen of digital content authoring tool
US20200117327A1