Disclosure of Invention
The embodiment of the disclosure at least provides a data synchronization method, a data synchronization device, data synchronization equipment and a storage medium.
The embodiment of the present disclosure provides a data synchronization method applied to an integrated development environment IDE, where the IDE includes a container running on a server and a user development interface running on a terminal, and the method includes:
responding to a code running window displayed on a user development interface of the IDE, starting a window management program with window multiplexing capability, and generating a program window of the window management program;
generating the code running window in the program window;
displaying the program window on a user development interface of the IDE based on the window management program;
and generating an instance file based on the operation content added in the code operation window, and storing the instance file into the container.
In an alternative embodiment, the launching a window manager having window multiplexing capabilities in response to displaying a code launch window on a user development interface of the IDE and generating a program window for the window manager, includes:
modifying a startup parameter of the integrated development environment IDE in response to displaying a code execution window on a user development interface of the IDE;
and starting a window management program with window multiplexing capability based on the modified starting parameters, and generating a program window of the window management program.
In an optional implementation manner, the generating an instance file based on the execution content added in the code execution window, and storing the instance file in the container includes:
acquiring the operation content added in the code operation window, and generating an example file based on the operation content;
configuring window environment parameters for the program window;
generating a storage directory for storing the instance file in the container based on the window environment parameter;
writing the instance file to a storage directory in the container.
In an alternative embodiment, the method comprises:
configuring window control parameters for the program window;
and generating a content rolling control and a window adjusting control in the program window based on the window control parameters.
In an alternative embodiment, the method comprises:
configuring a window name parameter for the program window;
detecting an active program currently active in the code running window based on the window name parameter;
and determining the name of the active program, and taking the name of the active program as the name of the program window.
In an optional implementation manner, after the generating an instance file based on the execution content added in the code execution window and storing the instance file in the container, the method includes:
in response to generating a new code execution window, obtaining a plurality of storage files stored in the container, the plurality of storage files including the instance file;
selecting at least one target storage file from the acquired plurality of storage files;
and displaying the operation contents recorded by the target storage files in the new code operation window, wherein each target storage file corresponds to one new code operation window.
In an optional implementation manner, in a case that the new code execution window is obtained after the code execution window is refreshed or reloaded, the selecting at least one target storage file from the obtained multiple storage files includes:
and determining the instance file from the plurality of acquired storage files according to the plurality of acquired storage files, and taking the instance file as the at least one target storage file.
In an optional implementation manner, after the generating an instance file based on the execution content added in the code execution window and storing the instance file in the container, the method includes:
and controlling the attribute of the instance file to be changed into a sharing attribute which can be acquired by other terminals when the sharing permission operation for the instance file is received.
The embodiment of the present disclosure further provides a data synchronization apparatus, where the apparatus is connected to an integrated development environment IDE in communication, and the apparatus includes:
the starting module is used for responding to a code running window displayed on a user development interface of the IDE, starting a window management program with window multiplexing capability and generating a program window of the window management program;
the generating module is used for generating the code running window in the program window;
the display module is used for displaying the program window on a user development interface of the IDE based on the window management program;
and the storage module is used for generating an instance file based on the operation content added in the code operation window and storing the instance file into the container.
In an optional implementation manner, the starting module is specifically configured to:
modifying a startup parameter of the integrated development environment IDE in response to displaying a code execution window on a user development interface of the IDE;
and starting a window management program with window multiplexing capability based on the modified starting parameters, and generating a program window of the window management program.
In an optional implementation manner, the storage module is specifically configured to:
acquiring the operation content added in the code operation window, and generating an example file based on the operation content;
configuring window environment parameters for the program window;
generating a storage directory for storing the instance file in the container based on the window environment parameter;
writing the instance file to a storage directory in the container.
In an optional embodiment, the apparatus further comprises a first configuration module, configured to:
configuring window control parameters for the program window;
and generating a content rolling control and a window adjusting control in the program window based on the window control parameters.
In an optional embodiment, the apparatus further comprises a second configuration module, configured to:
configuring a window name parameter for the program window;
detecting an active program currently active in the code running window based on the window name parameter;
and determining the name of the active program, and taking the name of the active program as the name of the program window.
In an alternative embodiment, the apparatus further includes an operation module, where the operation module is configured to:
in response to generating a new code execution window, obtaining a plurality of storage files stored in the container, the plurality of storage files including the instance file;
selecting at least one target storage file from the acquired plurality of storage files;
and displaying the operation contents recorded by the target storage files in the new code operation window, wherein each target storage file corresponds to one new code operation window.
In an optional implementation manner, when the new code execution window is obtained by refreshing or reloading the code execution window, the execution module is specifically configured to, when configured to select at least one target storage file from a plurality of obtained storage files:
and determining the instance file from the plurality of acquired storage files according to the plurality of acquired storage files, and taking the instance file as the at least one target storage file.
In an optional embodiment, the apparatus further includes a sharing module, where the sharing module is configured to:
and controlling the attribute of the instance file to be changed into a sharing attribute which can be acquired by other terminals when the sharing permission operation for the instance file is received.
An embodiment of the present disclosure further provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is operating, the machine-readable instructions being executable by the processor to perform the steps of the above data synchronization method.
The embodiment of the present disclosure also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the data synchronization method are executed.
Embodiments of the present disclosure also provide a computer program product, which includes a computer program/instructions, and the computer program and the instructions, when executed by a processor, implement the steps of the data synchronization method.
The data synchronization method, apparatus, device and storage medium provided by the embodiments of the present disclosure may be applied to an integrated development environment IDE, the IDE including a container running on a server and a user development interface running on a terminal, may start a window management program having a window multiplexing capability in response to displaying a code execution window on the user development interface of the IDE, and generate a program window of the window management program, thereby generating the code execution window in the program window to display the program window on the user development interface of the IDE, and may generate an instance file based on execution contents added and executed in the code execution window, and store the instance file into the container.
Therefore, by modifying the starting process of the code running window in advance, the window management program is firstly run, the program window of the window management program is generated, the code running window is generated in the program window to run the code running window, and the parameter isolation between the code running window and the IDE is realized, so that the contents added and executed in the code running window can be backed up and stored through the generated instance file, the code running window is recovered through the instance file and is shared with other code running windows in the IDE, the stability and the safety of the IDE can be improved, and the practicability and the flexibility of the IDE are increased.
Furthermore, for each terminal connected in the same container, respective instance files can be set as sharing attributes, so that instance files can be shared, accordingly, when a code operation window is opened, operation content sharing can be achieved through the shared instance files, work cooperation and interactive demonstration can be conveniently carried out by multiple persons, and dynamic management of an integrated development environment is facilitated.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The term "and/or" herein merely describes an associative relationship, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Research shows that a user can apply an integrated development environment IDE to encode when developing software, wherein the IDE comprises a container running on a server and a user development interface running on a terminal, the user can use the user development interface to encode in a webpage end or client side mode, the user development interface generally comprises a file list, a code editing window and a code running window, and aiming at the code running window, when the user is in an interruption condition caused by power failure, network failure, unexpected exit, refreshing, restarting and the like, the originally added content is not displayed in the generated code running window, namely the displayed content of the newly generated code running window is brand new and is not before interruption, so that the user can need to re-work.
Based on the research, the present disclosure provides a data synchronization method, apparatus, device, and storage medium, by modifying a start process of a code running window in advance, running a window manager first, generating a program window of the window manager, and then generating the code running window in the program window to implement running the code running window, and implementing parameter isolation of the code running window from an IDE, so that contents added and executed in the code running window can be backed up and saved through a generated instance file, so that the code running window is restored through the instance file and shared with other code running windows in the IDE, stability and security of the IDE can be improved, and practicality and flexibility of the IDE are increased.
Furthermore, for each terminal connected in the same container, respective instance files can be set as sharing attributes, so that instance files can be shared, accordingly, when a code operation window is opened, operation content sharing can be achieved through the shared instance files, work cooperation and interactive demonstration can be conveniently carried out by multiple persons, and dynamic management of an integrated development environment is facilitated.
The above-mentioned drawbacks are the results of the inventor after practical and careful study, and therefore, the discovery process of the above-mentioned problems and the solutions proposed by the present disclosure to the above-mentioned problems should be the contribution of the inventor in the process of the present disclosure.
To facilitate understanding of the present embodiment, first, a data processing method disclosed in the embodiments of the present disclosure is described in detail, where an execution subject of the data processing method provided in the embodiments of the present disclosure is generally a computer device with certain computing capability, and the computer device includes, for example: terminal equipment or servers or other processing devices. In some possible implementations, the data processing method may be implemented by a processor calling computer readable instructions stored in a memory.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario provided in the present disclosure. As shown in fig. 1, for an application scenario of an integrated development environment IDE, the IDE may include a server and a terminal, and it is understood that the server and the terminal are communicatively connected, it should be noted that a plurality of containers may be generated in the server for managing resources, processes, files, and the like in the IDE. Furthermore, when a user writes codes at a terminal, the user can write and run the codes by using a user development interface of the integrated development environment IDE. It is to be understood that the integrated development environment IDE is configured based on the server and the terminal, and further, the user development interface may be a part that is presented in a front end as the integrated development environment IDE, that is, the integrated development environment IDE includes the user development interface, and the container may be a part that is stored in a background as the integrated development environment IDE. In addition, because the terminal can be in communication connection with the server, and the server is provided with a plurality of containers, the user development interface can correspondingly display the content of files in the containers, namely the user development interface can display the content of files stored in the IDE, so that the user can view the written codes and the code running results.
Furthermore, a webpage end and a client end exist for a part of the integrated development environment IDE which is displayed on the terminal, and a user development interface of the IDE can be displayed for a user in a webpage form on the terminal side according to the webpage end form, specifically, a file can be obtained from a container in a cloud database so as to be displayed on the user development interface in the webpage form; specifically, a server in communication connection with the terminal is determined first, and then files are acquired from a container of the server, so that the user development interface is displayed in the application software installed in the user terminal.
Referring to fig. 2, fig. 2 is a flowchart illustrating a data synchronization method according to an embodiment of the disclosure. As shown in fig. 2, a data synchronization method provided by an embodiment of the present disclosure includes:
s201: and responding to the code running window displayed on the user development interface of the IDE, starting a window management program with window multiplexing capability, and generating a program window of the window management program.
In this step, in a case where a request for displaying a code execution window on a user development interface with respect to the IDE is detected, a window manager having a window multiplexing capability may be started in response to displaying the code execution window on the user development interface of the IDE, and a program window of the window manager may be generated.
It can be understood that the IDE stores a start process for modifying a code execution window in advance, so that the program of the start process corresponding to the modified code execution window can be called when the code execution window is displayed, thereby implementing that the window management program is executed first, and then the code execution window is executed.
The code execution window is displayed on the user development interface of the IDE in response to the display of the code execution window on the user development interface of the IDE, and may be automatically displayed on the user development interface of the IDE when detecting that the online webpage or the local application software of the integrated development environment IDE is opened, or may be displayed on the user development interface of the IDE in response to the operation of the user when detecting the operation of creating the code execution window of the user, without any limitation.
The starting of the window management program with the window multiplexing capability may be to start the window management program by modifying a starting parameter of the terminal where the IDE is located, or to start the window management program by executing a command corresponding to a command line in the terminal where the IDE is located.
In the actual encoding scenario, the window management program with the window multiplexing capability may be, for example, a screen program, a tmux program, or the like.
S202: and generating the code running window in the program window.
In this step, in response to displaying a code execution window on the user development interface of the IDE, the original execution operation is to directly generate the code execution window, and the code execution window is displayed on the user development interface of the IDE, and since the program window of the window management program has already been generated at this time, the code execution window can be generated in the program window.
In this way, by generating the code execution window in the program window in a window nesting manner, the execution content added in the code execution window by the user can be further processed based on the window management program.
S203: displaying the program window on a user development interface of the IDE based on the window management program.
In this step, when the program execution window is generated, the program window may be displayed on the user development interface of the IDE based on the window management program.
It is to be understood that the code launch window is in the program window, and thus, based on the nesting relationship of the program window and the code launch window, the code launch window in the program window is also displayed at the same time as the program window is displayed on the user development interface of the IDE. It is understood that in the actual encoding scenario, the run content added by the user in the code run window is actually displayed in the program window.
S204: and generating an instance file based on the operation content added in the code operation window, and storing the instance file into the container.
In this step, when it is detected that the added execution content exists in the code execution window, an instance file may be generated based on the added execution content, and the instance file may be stored in the container.
Here, as shown in fig. 1, the instance file may be saved in the server due to the communication connection of the terminal and the server. It will be appreciated that since the server includes a plurality of containers, the instance file may be stored in the container.
It is understood that the instance file includes the specific content of the added operating content.
Here, the operation content may be a code segment having actual business logic, for example, a code segment including complete and strict logic, a code segment including fragmented and capable of realizing a certain function, or a code structure embodying coding logic.
In addition, for convenience of statistics and classification, the instance file can be classified and saved based on functions, writing time and version which can be realized by the code segments included in the instance file, so that the instance file can be called quickly in a subsequent process.
Wherein, in order to store the instance file into the container, a storage directory for storing the instance file may be preset in the container.
Specifically, the operation content added in the code operation window may be acquired, an instance file is generated based on the operation content, and then window environment parameters are configured for the program window, so that a storage directory for storing the instance file is generated in the container based on the window environment parameters, and the instance file is written in the storage directory in the container.
In this step, when it is detected that the added execution content exists in the code execution window, an instance file may be generated based on the added execution content, and the instance file may be written in a storage directory in the container.
Here, the configuring of the window environment parameter for the program window may be achieved by setting an environment variable of the program window.
Therefore, by generating the code running window in the program window, the program added in the code running window can be saved and backed up in a window nesting mode, and the conflict between the window for content backup and the window for encoding by a user can be prevented, so that the isolation effect is achieved.
The data synchronization method provided by the embodiment of the disclosure can be applied to an Integrated Development Environment (IDE), wherein the IDE comprises a container running on a server and a user development interface running on a terminal, can respond to the display of a code running window on the user development interface of the IDE, start a window management program with window multiplexing capability, and generate a program window of the window management program, so as to generate the code running window in the program window, display the program window on the user development interface of the IDE based on the window management program, and can generate an instance file based on the running content added in the code running window, and store the instance file into the container. Therefore, by modifying the starting process of the code running window in advance, the window management program is firstly run, the program window of the window management program is generated, the code running window is generated in the program window to run the code running window, and the parameter isolation between the code running window and the IDE is realized, so that the contents added and executed in the code running window can be backed up and stored through the generated instance file, the code running window is recovered through the instance file and is shared with other code running windows in the IDE, the stability and the safety of the IDE can be improved, and the practicability and the flexibility of the IDE are increased.
Referring to fig. 3, fig. 3 is a flowchart of another data synchronization method according to an embodiment of the disclosure. As shown in fig. 3, a data synchronization method provided by an embodiment of the present disclosure includes:
s301: and responding to the code running window displayed on the user development interface of the IDE, starting a window management program with window multiplexing capability, and generating a program window of the window management program.
S302: and generating the code running window in the program window.
S303: displaying the program window on a user development interface of the IDE based on the window management program.
S304: and generating an instance file based on the operation content added in the code operation window, and storing the instance file into the container.
The descriptions of step S301 to step S304 may refer to the descriptions of step S201 to step S204, and the same technical effect and the same technical problem can be achieved, which are not described herein again.
S305: in response to generating a new code execution window, obtaining a plurality of storage files stored in the container, the plurality of storage files including the instance file.
Here, since in the previous encoding process, an instance file has been generated and written into the storage directory in the container based on the execution content added in the code execution window, that is, the execution content added in the code execution window is saved, it can be understood that a plurality of storage files are stored in the container, so that, when a new code execution window is generated in response, the plurality of storage files stored in the container can be acquired first, and it can be understood that, here, the plurality of storage files include the instance file to perform subsequent processing on the storage files.
It should be noted that, in the case where a new code execution window needs to be generated, the pointer may need to restart the IDE on the terminal side in response to power failure, network outage, unexpected exit, refresh, restart, and the like, and further, at this time, the content in the code execution window needs to be displayed again, that is, a new code execution window is generated.
It is to be understood that the instance file is stored in a container of the server as shown in fig. 1, and therefore, the obtaining of the plurality of storage files stored in the container is actually obtaining the storage files from the container of the server.
The plurality of storage files stored in the container may include storage files stored in the container by all terminals connected to the container.
S306: and selecting at least one target storage file from the acquired plurality of storage files.
In this step, in the case of acquiring a plurality of storage files stored in the container, in order to determine that the displayed content needs to be restored, at least one target storage file may be selected from the acquired plurality of storage files.
Alternatively, for selecting the target storage file, the plurality of acquired storage files may be used as the target storage file, a latest storage file may be determined from the plurality of acquired storage files to be used as the target storage file, or a storage file selected by a user from the plurality of acquired storage files may be used as the target storage file in response to a selection operation of the user, which is not limited herein.
Further, in a case that the new code execution window is obtained after the code execution window is refreshed or reloaded, the selecting at least one target storage file from the obtained plurality of storage files includes:
and determining the instance file from the plurality of acquired storage files according to the plurality of acquired storage files, and taking the instance file as the at least one target storage file.
It is understood that the display content after refreshing should be identical to the display content before refreshing, so the target storage file is the instance file stored in the container by the terminal.
S307: and displaying the operation contents recorded by the target storage files in the new code operation window, wherein each target storage file corresponds to one new code operation window.
In this step, a new code operating window may be generated for each target storage file, and the target storage file may be analyzed to obtain the operating content recorded in the target storage file, so that the operating content recorded in the target storage file is displayed in the new code operating window.
It is to be understood that, here, the operation content described in the target storage file is the operation content stored in the container for the terminal corresponding to the target storage file.
In an actual encoding scene, each storage file corresponds to a file label, and after the storage file is acquired, the file label of the storage file can also be acquired.
Specifically, after the target storage file is determined, a target file label of the target storage file may be obtained, where the plurality of storage files include the instance file, and then the start parameter of the IDE is modified based on the target file label, so that the window manager may be started based on the modified start parameter, and the program window of the window manager may be generated, and then a new code execution window may be generated in the program window, and the execution content recorded in the target storage file may be displayed in the new code execution window.
The method may further include modifying the start parameter of the IDE when the target file label is obtained, optionally, adding the target file label to the start parameter by modifying an operation instruction of the IDE, or adding a new operation instruction to add the target file label to the start parameter, thereby modifying the start parameter of the IDE.
It can be understood that in an actual encoding scenario, a large number of storage files may be stored in the I container, and by obtaining the file labels of the storage files, the storage files can be checked according to the file labels, so that omission of a large number of storage files is avoided.
For example, please refer to fig. 4, fig. 4 is a flowchart of a specific content recovery method in the data synchronization method according to the embodiment of the present disclosure. As shown in fig. 4, taking the storage directory in the integrated development environment IDE as an example, when a new code execution window is generated in response, all storage files may be acquired from a container in the IDE, and then target storage files that need to be displayed are selected, and for each target storage file, a new code execution window is correspondingly generated, and then the window manager may be started, and a program window of the window manager may be generated, so that the new code execution window may be displayed in the program window, and the execution content recorded in the target storage files may be displayed in the new code execution window at the same time.
It is to be understood that the number of the instance files stored in the container by each terminal may be one, two, or more, which is not limited to this, and all the operation contents added in the code operation window may be saved.
Next, this embodiment will be further described with reference to some specific embodiments.
In some possible embodiments, the launching a window manager having window multiplexing capabilities in response to displaying a code launch window on a user development interface of the IDE and generating a program window for the window manager, includes:
modifying a startup parameter of the integrated development environment IDE in response to displaying a code execution window on a user development interface of the IDE;
and starting a window management program with window multiplexing capability based on the modified starting parameters, and generating a program window of the window management program.
In this step, the start parameter of the integrated development environment IDE may be modified when a request for displaying a code execution window on the user development interface of the IDE is detected, the window manager may be started when the execution instruction is modified, and the program window may be displayed on the user development interface of the IDE because the window manager generates the program window of the window manager while starting.
Wherein, the modification of the startup parameters of the IDE can be realized by modifying the running instructions of the IDE or adding new running instructions.
Furthermore, the shell of the integrated development environment IDE is modified by modifying the running instruction of the IDE, and the difference between the modified shell and the shell before modification can be understood as that the modified shell starts a window management program with window multiplexing capability.
In some possible embodiments, the method comprises:
configuring window control parameters for the program window;
and generating a content rolling control and a window adjusting control in the program window based on the window control parameters.
In this step, in order to make the program window have the capability of simulating a real window, a window control parameter may be configured for the program window, and a content scroll control and a window adjustment control may be generated in the program window through the configuration of the window control parameter, so that the program window has the scrolling capability and the capability of automatically adapting to the size of the window.
Further, the content scroll control and the window adjustment control may be operated by a user to perform scroll adjustment and window size adjustment on the program window.
In some possible embodiments, the method comprises:
configuring a window name parameter for the program window;
detecting an active program currently active in the code running window based on the window name parameter;
and determining the name of the active program, and taking the name of the active program as the name of the program window.
In this step, in order to facilitate a user to quickly know a currently active program, a name of the active program may be used as a name of the program window, and for this purpose, a window name parameter may be configured for the program window, and by configuration of the window name parameter, an active program currently active in the code running window may be detected in real time, and a name of the active program may be acquired, so that the name of the active program is used as the name of the program window and displayed on a user development interface of the IDE.
Illustratively, when a user executes a vim editor in the code launch window, the name of the program window may be updated to a literal of vim based on the window name parameter.
In an actual coding scene, a pstree command may be applied to display the active program in a tree diagram form, that is, a process tree of the active program is obtained, so that an end node of the process tree may be obtained as a name of the program window.
For example, please refer to fig. 5, fig. 5 is a flowchart of a specific window generation method in the data synchronization method according to the embodiment of the present disclosure. As shown in fig. 5, in a case where a request for displaying a code execution window on a user development interface for the IDE is detected, a window management program with a window multiplexing capability may be started in response to displaying the code execution window on the user development interface of the IDE, and a program window of the window management program may be generated, so as to generate the code execution window in the window management program, and further, a window environment parameter, a window control parameter, and a window name parameter may be configured for the program window, so that a storage directory in which an instance file may be stored may be generated, the program window may have a capability of simulating a real window, and a name may be set for the program window.
In some possible embodiments, after the generating an instance file based on the execution content added in the code execution window and storing the instance file in the container, the method includes:
and controlling the attribute of the instance file to be changed into a sharing attribute which can be acquired by other terminals when the sharing permission operation for the instance file is received.
In this step, when each user writes a code in the user development interface of each terminal, the written content may be converted into an instance file and stored in the container, so that each user may set an attribute of the instance file stored by each user, and when a sharing operation for the instance file is received, the attribute of the instance file is controlled to be changed into a sharing attribute that can be acquired by other terminals.
Further, each terminal may also acquire an instance file set to have a sharing attribute by another user in response to an operation by the user.
It can be understood that, if the user a sets the content written by the user a to allow sharing, the content will be stored in a container in the server connected to the terminal of the user a, and it can be understood that the content shared by the user a can be obtained as long as the terminal of the user B is also connected to the container.
The method comprises the steps that a webpage end and a client end exist for a part of the integrated development environment IDE which is displayed on a terminal, and content sharing can be achieved by a mode that a user A shares a link with a user B according to the form of the webpage end; for the form of the client, the user a may notify the user B of the relevant information of the container to which the user a connects, and after determining the relevant information, the user B may connect the terminal used by the user B and the terminal used by the user a to the same container in the server by executing a command operation, thereby implementing sharing of the content.
For example, please refer to fig. 6, fig. 6 is a flowchart of a specific content sharing method in the data synchronization method according to the embodiment of the present disclosure. As shown in fig. 6, taking the example that user B and user C share the program written by user a, content sharing can be achieved as long as the respective terminals of user a, user B and user C are connected to the same container in the server of the IDE.
The data synchronization method provided by the embodiment of the disclosure can be applied to an Integrated Development Environment (IDE), wherein the IDE comprises a container running on a server and a user development interface running on a terminal, can respond to the display of a code running window on the user development interface of the IDE, start a window management program with window multiplexing capability, and generate a program window of the window management program, so as to generate the code running window in the program window, display the program window on the user development interface of the IDE based on the window management program, and can generate an instance file based on the running content added in the code running window, and store the instance file into the container. Therefore, by modifying the starting process of the code running window in advance, the window management program is firstly run, the program window of the window management program is generated, the code running window is generated in the program window to run the code running window, and the parameter isolation between the code running window and the IDE is realized, so that the contents added and executed in the code running window can be backed up and stored through the generated instance file, the code running window is recovered through the instance file and is shared with other code running windows in the IDE, the stability and the safety of the IDE can be improved, and the practicability and the flexibility of the IDE are increased. Furthermore, for each terminal connected in the same container, respective instance files can be set as sharing attributes, so that instance files can be shared, accordingly, when a code operation window is opened, operation content sharing can be achieved through the shared instance files, work cooperation and interactive demonstration can be conveniently carried out by multiple persons, and dynamic management of an integrated development environment is facilitated.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, a data synchronization device corresponding to the data synchronization method is also provided in the embodiments of the present disclosure, and as the principle of solving the problem of the device in the embodiments of the present disclosure is similar to the data synchronization method in the embodiments of the present disclosure, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.
Referring to fig. 7 and 8, fig. 7 is a first schematic diagram of a data synchronization apparatus according to an embodiment of the disclosure, and fig. 8 is a second schematic diagram of a data synchronization apparatus according to an embodiment of the disclosure.
As shown in fig. 7, a data processing apparatus 700 provided by an embodiment of the present disclosure includes:
a starting module 710, configured to start a window management program with a window multiplexing capability in response to displaying a code execution window on a user development interface of the IDE, and generate a program window of the window management program;
a generating module 720, configured to generate the code execution window in the program window;
a display module 730, configured to display the program window on a user development interface of the IDE based on the window management program;
the storage module 740 is configured to generate an instance file based on the operation content added in the code operation window, and store the instance file in the container.
In an optional implementation manner, the starting module 710 is specifically configured to:
modifying a startup parameter of the integrated development environment IDE in response to displaying a code execution window on a user development interface of the IDE;
and starting a window management program with window multiplexing capability based on the modified starting parameters, and generating a program window of the window management program.
In an optional implementation manner, the storage module 740 is specifically configured to:
acquiring the operation content added in the code operation window, and generating an example file based on the operation content;
configuring window environment parameters for the program window;
generating a storage directory for storing the instance file in the container based on the window environment parameter;
writing the instance file to a storage directory in the container.
In an alternative embodiment, as shown in fig. 8, the apparatus further includes a first configuration module 750, a second configuration module 760, an execution module 770, and a sharing module 780, where the first configuration module 750 is configured to:
configuring window control parameters for the program window;
and generating a content rolling control and a window adjusting control in the program window based on the window control parameters.
The second configuration module 760 is configured to:
configuring a window name parameter for the program window;
detecting an active program currently active in the code running window based on the window name parameter;
and determining the name of the active program, and taking the name of the active program as the name of the program window.
The operation module 770 is configured to:
in response to generating a new code execution window, obtaining a plurality of storage files stored in the container, the plurality of storage files including the instance file;
selecting at least one target storage file from the acquired plurality of storage files;
and displaying the operation contents recorded by the target storage files in the new code operation window, wherein each target storage file corresponds to one new code operation window.
In an optional implementation manner, when the new code execution window is obtained after the code execution window is refreshed or reloaded, the execution module 770 is specifically configured to, when configured to select at least one target storage file from a plurality of obtained storage files:
and determining the instance file from the plurality of acquired storage files according to the plurality of acquired storage files, and taking the instance file as the at least one target storage file.
The sharing module 780 is configured to:
and controlling the attribute of the instance file to be changed into a sharing attribute which can be acquired by other terminals when the sharing permission operation for the instance file is received.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
The data synchronization device provided by the embodiment of the disclosure can be in communication connection with a server and a terminal of an integrated development environment IDE, can respond to displaying a code running window on a user development interface of the IDE, start a window management program with window multiplexing capability, and generate a program window of the window management program, so as to generate the code running window in the program window, display the program window on the user development interface of the IDE based on the window management program, and can generate an instance file based on the operation content added in the code running window, and store the instance file in the container. Therefore, by modifying the starting process of the code running window in advance, the window management program is firstly run, the program window of the window management program is generated, the code running window is generated in the program window to run the code running window, and the parameter isolation between the code running window and the IDE is realized, so that the contents added and executed in the code running window can be backed up and stored through the generated instance file, the code running window is recovered through the instance file and is shared with other code running windows in the IDE, the stability and the safety of the IDE can be improved, and the practicability and the flexibility of the IDE are increased. Furthermore, for each terminal connected in the same container, respective instance files can be set as sharing attributes, so that instance files can be shared, accordingly, when a code operation window is opened, operation content sharing can be achieved through the shared instance files, work cooperation and interactive demonstration can be conveniently carried out by multiple persons, and dynamic management of an integrated development environment is facilitated.
Corresponding to the data synchronization method in fig. 2 and fig. 3, an embodiment of the present disclosure further provides an electronic device 900, as shown in fig. 9, a schematic structural diagram of the electronic device 900 provided in the embodiment of the present disclosure includes:
a processor 910, a memory 920, and a bus 930; the storage 920 is used for storing execution instructions and includes a memory 921 and an external storage 922; the memory 921 is also referred to as an internal memory, and is configured to temporarily store operation data in the processor 910 and data exchanged with an external memory 922 such as a hard disk, the processor 910 exchanges data with the external memory 922 through the memory 921, and when the electronic device 900 operates, the processor 910 communicates with the memory 920 through the bus 930, so that the processor 910 can execute the steps of the data synchronization method.
The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the data synchronization method described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The embodiments of the present disclosure further provide a computer program product, where the computer program product includes computer instructions, and the computer instructions, when executed by a processor, may perform the steps of the data synchronization method in the foregoing method embodiments, which may be referred to specifically for the foregoing method embodiments, and are not described herein again.
The computer program product may be implemented by hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the apparatus, the device, and the storage medium described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again. In the embodiments provided in the present disclosure, it should be understood that the disclosed method, apparatus, device and storage medium may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.