Process synchronization method and device, electronic equipment and storage medium
By creating data synchronization files and security logical nodes in the process synchronization method, the information of the security project is synchronized to the shared memory, which solves the problem in the existing technology that security and non-security related nodes and configurations are operated on the same interface, and realizes functional differentiation. , improving the efficiency of operation and configuration.
Patent Information
- Application Number
- CN202411386051.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, safety-related and non-safety-related nodes and configurations operate in the same engineering interface, resulting in too much interface information and insignificant functional distinction, which affects the convenience and efficiency of operation and configuration.
By creating data synchronization files in the first process and security logic nodes with the second process link, the information of the security project is synchronized to the shared memory, and the data synchronization file and shared memory are compared with the second process to determine the process synchronization results. So as to display security and non -safety -related nodes and configurations in different engineering interfaces, to achieve functional distinction.
It improves the convenience and efficiency of operation and configuration. By separating safety and non-safety related operations into different engineering interfaces, it reduces the redundancy of interface information and improves the user's operating experience.
Smart Images

Figure CN119356856A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of process synchronization, and in particular to a process synchronization method, device, electronic device and storage medium. Background Art
[0002] In the design and implementation of a system or application, security-related nodes and configurations are components, modules, configuration items or measures used to provide security protection and defense. These nodes and configurations are designed to identify, block, prevent or mitigate potential security threats and attacks. Non-security-related nodes and configurations are components, modules, configuration items or measures used to implement functions and business requirements, rather than specifically for providing security protection. These nodes and configurations are mainly focused on implementing the normal functions of the system and meeting the business needs of users.
[0003] At present, safety-related nodes and configurations and non-safety-related nodes and configurations are displayed in one project. All safety-related and non-safety-related operations (such as IEC configuration, hardware configuration, compilation, downloading, etc.) are completed in one project, resulting in a large amount of information displayed on the project interface and unclear functional distinction, which affects the convenience and efficiency of operation and configuration. Summary of the invention
[0004] Based on the above needs, the present application proposes a process synchronization method, device, electronic device and storage medium, which can display security-related nodes and configurations as well as non-security-related nodes and configurations on different engineering interfaces, realize functional differentiation, and thus improve the convenience and efficiency of operation and configuration.
[0005] To achieve the above objectives, this application proposes the following technical solutions:
[0006] According to a first aspect of an embodiment of the present application, a process synchronization method is provided, including:
[0007] Creating a data synchronization file and a security logical node linked to the second process in the first process, wherein the data synchronization file includes information corresponding to the security project, and the security project includes nodes and configurations related to security;
[0008] Opening a second process through a security logic node in the first process, creating a shared memory in the second process, and updating information corresponding to the security project into the shared memory;
[0009] Using the second process to compare the data synchronization file and the shared memory, and determine a process synchronization result;
[0010] When the process synchronization result indicates that the synchronization is successful, based on the information corresponding to the safety project in the shared memory, the engineering interface data corresponding to the safety project is determined and the engineering interface corresponding to the safety project is created.
[0011] Optionally, the process synchronization method further includes:
[0012] If the information corresponding to the safety engineering has data changes, the information corresponding to the safety engineering in the data synchronization file and the information corresponding to the safety engineering in the shared memory are updated by using the first process;
[0013] Using the second process to compare the data synchronization file and the shared memory, and determine a process synchronization result;
[0014] When the process synchronization result indicates that the synchronization is successful, the engineering interface data and engineering interface corresponding to the safety engineering are refreshed based on the updated information corresponding to the safety engineering in the shared memory.
[0015] Optionally, using the second process to compare the data synchronization file with the shared memory to determine a process synchronization result includes:
[0016] Using the second process to compare the information in the data synchronization file with the information in the shared memory, to obtain a comparison result between the data synchronization file and the shared memory;
[0017] If the comparison result indicates the same, then determining the process synchronization result indicates that the synchronization is successful;
[0018] If the comparison result indicates a difference, the first process is used to update the information corresponding to the safety engineering in the data synchronization file and the information corresponding to the safety engineering in the shared memory according to the preset update number, and the second process is used to re-compare the information in the data synchronization file and the information in the shared memory.
[0019] Optionally, the process synchronization method further includes:
[0020] When a save instruction triggered by the first process is obtained, executing a save process based on the first process;
[0021] When the save instruction triggered by the second process is obtained, outputting prompt information prompting the user to use the first process to trigger the save, so that the user performs the save trigger operation in the first process and sends the save instruction triggered by the first process;
[0022] The saving process based on the first process includes:
[0023] If the second process exists, the data synchronization file and the shared memory are updated by using the first process, the engineering interface data corresponding to the updated safety engineering and the shared memory are saved, and the updated data synchronization file and the engineering data corresponding to the first process are saved; the engineering data corresponding to the first process includes engineering interface data of the non-safety engineering constructed based on the information corresponding to the non-safety engineering, and the non-safety engineering includes nodes and configurations related to non-safety;
[0024] If the second process does not exist, the data synchronization file is updated using the first process, and the updated data synchronization file and the engineering data corresponding to the first process are saved.
[0025] Optionally, the process synchronization method further includes:
[0026] When a save as instruction or an automatic save instruction triggered by the first process is obtained, executing the saving process based on the first process according to the saving address carried by the instruction;
[0027] When a save as instruction or an automatic save instruction triggered by the second process is obtained, a prompt message is output indicating that the second process cannot execute the save as instruction or the automatic save instruction.
[0028] Optionally, the process synchronization method further includes:
[0029] In case a close instruction triggered by the first process is obtained, determining whether the second process exists;
[0030] If the second process exists, output a prompt message prompting the user to use the second process to trigger the closure, and after obtaining the closure instruction triggered by the second process, execute the closure process of the second process and the closure process of the first process;
[0031] If the second process does not exist, execute the closing process of the first process.
[0032] Optionally, the closing process of the first process includes:
[0033] The data synchronization file and the engineering data corresponding to the first process are saved, and then the first process is closed; the engineering data corresponding to the first process includes engineering interface data of a non-safety engineering constructed based on information corresponding to a non-safety engineering, and the non-safety engineering includes nodes and configurations related to non-safety;
[0034] The closing process of the second process includes:
[0035] The engineering interface data corresponding to the safety engineering and the shared memory are saved, and then the second process is closed.
[0036] According to a second aspect of an embodiment of the present application, a process synchronization device is provided, including:
[0037] A first creation module, configured to create a data synchronization file and a security logical node linked to a second process in a first process, wherein the data synchronization file includes information corresponding to a security project, and the security project includes nodes and configurations related to security;
[0038] A second creation module, used to open a second process through a security logic node in the first process, create a shared memory in the second process, and update information corresponding to the security project into the shared memory;
[0039] A comparison module, used to compare the data synchronization file and the shared memory using the second process to determine a process synchronization result;
[0040] The safety engineering determination module is used to determine the engineering interface data corresponding to the safety engineering and create the engineering interface corresponding to the safety engineering based on the information corresponding to the safety engineering in the shared memory when the process synchronization result indicates that the synchronization is successful.
[0041] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including: a memory and a processor;
[0042] The memory is connected to the processor and is used to store programs;
[0043] The processor is used to implement the above process synchronization method by running the program in the memory.
[0044] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned process synchronization method is implemented.
[0045] The process synchronization method proposed in the present application creates a data synchronization file and a security logic node linked to the second process in the first process, the data synchronization file includes information corresponding to the security project, and the security project includes nodes and configurations related to security; the second process is opened through the security logic node in the first process, and a shared memory is created in the second process, and the information corresponding to the security project is updated to the shared memory; the second process is used to compare the data synchronization file and the shared memory to determine the process synchronization result; when the process synchronization result indicates that the synchronization is successful, based on the information corresponding to the security project in the shared memory, the engineering interface data corresponding to the security project is determined and the engineering interface corresponding to the security project is created. By adopting the technical solution of the present application, the nodes and configurations related to security in the first process can be synchronized to the second process, and the engineering interface corresponding to the security project can be created, so that the nodes and configurations related to security and the nodes and configurations related to non-security can be displayed in different engineering interfaces, and functional differentiation can be achieved, thereby improving the convenience and efficiency of operation and configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0047] Figure 1 A flowchart of a process synchronization method provided in an embodiment of the present application;
[0048] Figure 2 A flowchart of another process synchronization method provided in an embodiment of the present application;
[0049] Figure 3 A flowchart of another process synchronization method provided in an embodiment of the present application;
[0050] Figure 4 A flowchart of another process synchronization method provided in an embodiment of the present application;
[0051] Figure 5 A flowchart of another process synchronization method provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of a process synchronization device provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solution of the embodiment of the present application is applicable to the application scenario of the application process, and is specifically used in the application scenario of synchronization between processes. By adopting the technical solution of the embodiment of the present application, security-related nodes and configurations and non-security-related nodes and configurations can be displayed in different engineering interfaces to achieve functional differentiation, thereby improving the convenience and efficiency of operation and configuration.
[0055] In the design and implementation of a system or application, each node and configuration in the system or application is configured through the created AT process, so as to build an engineering interface, and operate and configure the engineering interface. The nodes and configurations include security-related nodes and configurations, as well as non-security-related nodes and configurations. Among them, security-related nodes and configurations are used to provide components, modules, configuration items or measures for security protection and defense. These nodes and configurations are designed to identify, block, prevent or mitigate potential security threats and attacks. Non-security-related nodes and configurations are components, modules, configuration items or measures used to implement functional and business requirements, rather than specifically used to provide security protection. These nodes and configurations are mainly focused on implementing the normal functions of the system and meeting the business needs of users.
[0056] At present, safety-related nodes and configurations and non-safety-related nodes and configurations are all displayed in one project. The project interface of the project is constructed through the AT process, and the project interface is operated and configured. However, all safety-related and non-safety-related operations (such as IEC configuration, hardware configuration, compilation, downloading, etc.) are completed in the project interface of the same project, resulting in a large amount of information displayed on the project interface and unclear functional distinctions, which will affect the convenience and efficiency of project operation and configuration.
[0057] Based on this, the present application proposes a process synchronization method. This technical solution can display security-related nodes and configurations as well as non-security-related nodes and configurations on different engineering interfaces to achieve functional differentiation, thereby solving the problem in the prior art that the engineering interface displays too much information, the functional differentiation is not obvious, and the convenience and efficiency of operation and configuration are affected.
[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0059] Exemplary Methods
[0060] See also Figure 1As shown, the embodiment of the present application proposes a process synchronization method. The method includes:
[0061] S101: Create a data synchronization file and a security logical node linked to a second process in a first process.
[0062] Specifically, this embodiment pre-builds an AT process for configuring the project, takes the process as the first process, and adds a safety logic node in the first process, wherein the safety logic node is used to realize the link with the second process, that is, the second process can be started through the safety logic node in the first process. The safety logic node can be bound to the safety I / O node. This embodiment can add the safety I / O node bound to it or delete the safety I / O node bound to it by configuring the safety logic node. The safety I / O node is a device for processing safety-related input and output signals and communicating with other controllers and devices.
[0063] In this embodiment, it is also necessary to create a data synchronization file in the first process, and the first process synchronizes the information corresponding to the safety project into the data synchronization file, that is, the data synchronization file includes the information corresponding to the safety project, wherein the safety project includes nodes and configurations related to safety, and the nodes related to safety include: safety logic nodes and safety I / O nodes, and the configurations related to safety include: configuration information in the safety logic node and safety I / O node interface, process parameter information, I / O mapping information, etc. In this embodiment, the data synchronization file is a disk file, which is stored in the disk. Among them, the data synchronization file may include I / O data, software version number, synchronization file MD5 value and checksum, platform information, serialization version number, project name related information, controller IP address, FSoE safety configuration information, etc.
[0064] In this embodiment, the information corresponding to the security project synchronized in the data synchronization file is the information corresponding to the security project associated with the security I / O node bound to the security logical node.
[0065] S102: Open the second process through the security logic node in the first process, create a shared memory in the second process, and update the information corresponding to the security project into the shared memory.
[0066] Specifically, in this embodiment, the second process is opened through the security logical node added in the first process, and a shared memory is created in the second process, and both the first process and the second process can access the shared memory. After the shared memory is created in the second process, a notification indicating that the shared memory is updated can be sent to the first process, and then the information corresponding to the security project synchronized in the data synchronization file is also synchronized and updated to the shared memory. That is, the information corresponding to the security project synchronized in the shared memory is also the information corresponding to the security project associated with the security I / O node bound to the security logical node.
[0067] S103: Use the second process to compare the data synchronization file and the shared memory to determine the process synchronization result.
[0068] After the data synchronization file and the information corresponding to the security project in the shared memory are updated in this embodiment, the first process can send a notification indicating that the update is complete to the second process, so that the second process can compare the information corresponding to the security project in the data synchronization file with the information corresponding to the security project in the shared memory, and determine the process synchronization result according to the comparison result. If the second process finds that the information corresponding to the security project in the data synchronization file and the information corresponding to the security project in the shared memory are the same, it means that the data in the data synchronization file and the shared memory are updated successfully, and the process synchronization result indicates that the synchronization is successful. If the second process finds that the information corresponding to the security project in the data synchronization file and the information corresponding to the security project in the shared memory are different, it means that the data in the data synchronization file and / or the data in the shared memory are not updated successfully, and the process synchronization result indicates that the synchronization fails.
[0069] As an optional implementation, using the second process to compare the data synchronization file and the shared memory to determine the process synchronization result includes the following steps:
[0070] First, the second process is used to compare the information in the data synchronization file with the information in the shared memory to obtain a comparison result between the data synchronization file and the shared memory.
[0071] This embodiment uses the second process to compare the information corresponding to the security project in the data synchronization file with the information corresponding to the security project in the shared memory, and determines whether the information corresponding to the security project in the data synchronization file and the information corresponding to the security project in the shared memory are consistent. If they are consistent, it is determined that the comparison results of the data synchronization file and the shared memory are the same; if they are inconsistent, it is determined that the comparison results of the data synchronization file and the shared memory are different.
[0072] Second, if the comparison result indicates the same, then the process synchronization result is determined to indicate that the synchronization is successful.
[0073] If the comparison results of the data synchronization file and the shared memory indicate the same, then the process synchronization result is directly determined to indicate that the synchronization is successful.
[0074] Third, if the comparison result indicates a difference, the information corresponding to the security engineering in the data synchronization file and the information corresponding to the security engineering in the shared memory are updated using the first process according to the preset update number, and the information in the data synchronization file and the information in the shared memory are re-compared using the second process.
[0075] If the comparison result of the data synchronization file and the shared memory indicates that they are different, the current update number is increased by one, and it is determined whether the current update number reaches the preset update number. If the current update number does not reach the preset update number, the second process is used to send a notification of data update of the data synchronization file and the shared memory to the first process, and then the information corresponding to the safety project in the data synchronization file and the information corresponding to the safety project in the shared content are updated by the first process, and the first process is used to send a notification of data update completion to the second process, and then the second process is used to continue to re-compare the information in the data synchronization file and the information in the shared memory, and the process synchronization result is determined according to the comparison result according to the above steps. If it is determined that the current update number reaches the preset update number, it is determined that the process synchronization result indicates that the synchronization failed, and a prompt message indicating that the process synchronization failed is output.
[0076] S104. When the process synchronization result indicates that the synchronization is successful, based on the information corresponding to the safety project in the shared memory, determine the engineering interface data corresponding to the safety project and create the engineering interface corresponding to the safety project.
[0077] When it is determined that the process synchronization result indicates that the synchronization is successful, the engineering interface data corresponding to the safety engineering is determined according to the information corresponding to the safety engineering in the shared memory, and the engineering interface corresponding to the safety engineering is created based on the engineering interface data corresponding to the safety engineering. Among them, the engineering interface corresponding to the safety engineering includes elements such as menus, toolbars, engineering management tree structures, and node interface display forms. The engineering interface data corresponding to the safety engineering determined based on the information corresponding to the safety engineering in the shared memory is information displayed by each element in the engineering interface corresponding to the safety engineering.
[0078] In addition, the first process also needs to determine the engineering interface data corresponding to the non-safety engineering and create the engineering interface corresponding to the non-safety engineering according to the information corresponding to the non-safety engineering. Among them, the information corresponding to the non-safety engineering includes nodes and configurations related to non-safety, and the nodes related to non-safety include: other EtherCAT slave nodes except safety logic nodes and safety I / O nodes, and the configurations related to non-safety include: configuration information, process parameter information, I / O mapping information, etc. in the interface of other EtherCAT slave nodes except safety logic nodes and safety I / O nodes. This embodiment can operate and configure the information corresponding to the non-safety engineering through the engineering interface corresponding to the created non-safety engineering, and operate and configure the information corresponding to the safety engineering through the engineering interface corresponding to the created safety engineering, so that all safety-related and non-safety-related operations are completed in different projects, that is, functional differentiation is achieved, and the display information in each engineering interface is reduced, so as to improve the convenience and efficiency of operating and configuring the project.
[0079] Through the above introduction, it can be seen that the process synchronization method proposed in the embodiment of the present application creates a data synchronization file and a security logic node linked to the second process in the first process, the data synchronization file includes information corresponding to the security project, and the security project includes nodes and configurations related to security; the second process is opened through the security logic node in the first process, and a shared memory is created in the second process, and the information corresponding to the security project is updated to the shared memory; the second process is used to compare the data synchronization file and the shared memory to determine the process synchronization result; when the process synchronization result indicates that the synchronization is successful, based on the information corresponding to the security project in the shared memory, the engineering interface data corresponding to the security project is determined and the engineering interface corresponding to the security project is created. By adopting the technical solution of the present application, the nodes and configurations related to security in the first process can be synchronized to the second process, and the engineering interface corresponding to the security project can be created, so that the nodes and configurations related to security and the nodes and configurations related to non-security can be displayed in different engineering interfaces, and functional distinction can be achieved, thereby improving the convenience and efficiency of operation and configuration.
[0080] As an optional implementation, see Figure 2 As shown, in another embodiment of the present application, the process synchronization method further includes:
[0081] S201. If data changes occur in the information corresponding to the safety project, the information corresponding to the safety project in the data synchronization file and the information corresponding to the safety project in the shared memory are updated using the first process.
[0082] Specifically, when it is detected that the information corresponding to the safety project has a data change, it is necessary to use the first process to update the information corresponding to the safety project in the data synchronization file and the information corresponding to the safety project in the shared memory respectively, and update the information corresponding to the safety project in the data synchronization file and the information corresponding to the safety project in the shared memory to the information corresponding to the safety project after the data change. Among them, the scenarios where the information corresponding to the safety project has a data change include: the addition and deletion of hardware configuration nodes, node renaming, the addition and deletion of process parameters in the node, and the increase or decrease of the safety I / O nodes bound to the safety logic node (that is, the safety logic node binds the safety I / O node or the safety logic node cancels the binding of the safety I / O node). Hardware configuration nodes include: safety logic nodes and safety I / O nodes, etc.; process parameters in the node include: the name, type, index and other information of each parameter.
[0083] If it is detected that the data synchronization file does not exist when updating data, it is necessary to re-create the data synchronization file and then synchronize the information corresponding to the security project after the data change to the re-created data synchronization file.
[0084] S202: Use the second process to compare the data synchronization file and the shared memory to determine the process synchronization result.
[0085] After the information corresponding to the safety project in the data synchronization file and the information corresponding to the safety project in the shared memory are updated, the second process is used to compare the updated data synchronization file and the updated shared memory to determine the process synchronization result. The specific execution method is the same as the specific execution method of step S103 in the above embodiment, and this embodiment will not be repeated.
[0086] S203. When the process synchronization result indicates that the synchronization is successful, based on the updated information corresponding to the safety project in the shared memory, the engineering interface data and engineering interface corresponding to the safety project are refreshed.
[0087] When the process synchronization result indicates that the synchronization is successful, the engineering interface data corresponding to the safety engineering is refreshed according to the updated information corresponding to the safety engineering in the shared memory, and the engineering interface corresponding to the safety engineering is also refreshed based on the refreshed engineering interface data corresponding to the safety engineering.
[0088] As an optional implementation, see Figure 3 As shown, in another embodiment of the present application, the process synchronization method further includes:
[0089] S301. When a save instruction triggered by a first process is obtained, a save process based on the first process is executed.
[0090] When the save instruction is triggered by the first process, this embodiment obtains the save instruction triggered by the first process and executes the save process based on the first process. Among them, the save process of the first process is to first save the engineering interface data and shared memory corresponding to the security engineering constructed by the second process, and then save the engineering data and data synchronization file corresponding to the first engineering. In this embodiment, the save address corresponding to the save instruction is pre-set. When executing the save process based on the first process, it is necessary to save to the save address corresponding to the save instruction. The specific steps are as follows:
[0091] First, if the second process exists, the data synchronization file and shared memory are updated using the first process, the engineering interface data and shared memory corresponding to the updated security engineering are saved, and the updated data synchronization file and engineering data corresponding to the first process are saved.
[0092] Specifically, this embodiment first determines whether the second process exists. If the second process exists, the data synchronization file and the shared memory are updated using the first process, that is, the information corresponding to the safety project in the data synchronization file and the information corresponding to the safety project in the shared memory are updated to the latest information corresponding to the safety project, and then the engineering interface data corresponding to the safety project and the engineering interface corresponding to the safety project are refreshed according to the updated information corresponding to the safety project in the shared memory, and the engineering interface data corresponding to the refreshed safety project and the updated shared memory are saved, and finally the updated data synchronization file and the engineering data corresponding to the first process are saved. Among them, the engineering data corresponding to the first process includes the engineering interface data of the non-safety project constructed based on the information corresponding to the non-safety project, and the non-safety project includes non-safety-related nodes and configurations.
[0093] Furthermore, after determining that the second process exists, it is also possible to first determine whether the information corresponding to the safety engineering has changed. If the information corresponding to the safety engineering has changed, the data synchronization file and shared memory are updated using the first process, and the engineering interface data and shared memory corresponding to the updated safety engineering are saved, and the updated data synchronization file and the engineering data corresponding to the first process are saved; if the information corresponding to the safety engineering has not changed, the engineering interface data corresponding to the current safety engineering and the current shared memory are directly saved, and then the current data synchronization file and the engineering data corresponding to the first process are saved.
[0094] Second, if the second process does not exist, the data synchronization file is updated using the first process, and the updated data synchronization file and the engineering data corresponding to the first process are saved.
[0095] If it is determined that the second process does not exist, the data synchronization file is updated using the first process, that is, the information corresponding to the safety project in the data synchronization file is updated to the latest information corresponding to the safety project, and then the updated data synchronization file and the engineering data corresponding to the first process are saved.
[0096] Furthermore, after determining that the second process does not exist, you can also first determine whether the information corresponding to the safety engineering has changed. If the information corresponding to the safety engineering has changed, use the first process to update the data synchronization file, and save the updated data synchronization file and the engineering data corresponding to the first process; if the information corresponding to the safety engineering has not changed, directly save the current data synchronization file and the engineering data corresponding to the first process.
[0097] S302: When a save instruction triggered by the second process is obtained, output prompt information to prompt the user to use the first process to trigger the save operation, so that the user performs the save trigger operation in the first process and sends the save instruction triggered by the first process.
[0098] Specifically, when the save instruction is triggered by the second process, after the present embodiment obtains the save instruction triggered by the second process, it will output a prompt message prompting the user to use the first process to trigger the save, so as to prompt the user to perform the save trigger operation in the first process. After the user views the prompt message, the save trigger operation will be performed in the first process, and the save instruction triggered by the first process will be sent. At this time, the present embodiment will obtain the save instruction triggered by the first process, thereby executing the save process based on the first process. Among them, the save process of the first process has been specifically described in the above steps, and this step will not be repeated.
[0099] This embodiment does not limit the execution order of step S301 and step S302. Step S301 may be executed first, and then step S302, or step S302 may be executed first, and then step S301.
[0100] As an optional implementation, see Figure 4 As shown, in another embodiment of the present application, the process synchronization method further includes:
[0101] S401. When a save as instruction or an automatic save instruction triggered by a first process is obtained, a save process based on the first process is executed according to a save address carried in the instruction.
[0102] In this embodiment, the Save As instruction and the Auto Save instruction cannot be executed separately through the second process. Therefore, when the user needs to save or automatically save the relevant information of the safety project and / or the relevant information of the non-safety project, the Save As instruction or the Auto Save instruction needs to be triggered by the first process. The triggering of the Save As instruction requires the user to trigger it through the first process, and the triggering of the Auto Save instruction is automatically triggered by the first process every preset time. In addition, the Save As instruction carries the save address specified by the user, and the Auto Save instruction carries the preset save address for automatic saving.
[0103] In the case of obtaining a Save As instruction triggered by the first process, the save process based on the first process is executed according to the save address carried by the Save As instruction, and all data to be saved are saved to the save address carried by the Save As instruction. In the case of obtaining an Automatic Save instruction triggered by the first process, the save process based on the first process is executed according to the save address carried by the Automatic Save instruction, and all data to be saved are saved to the save address carried by the Automatic Save instruction. The save process based on the first process has been specifically described in step S301 of the above embodiment, and will not be repeated in this embodiment.
[0104] S402: When a Save As instruction or an Auto Save instruction triggered by the second process is obtained, output a prompt message indicating that the second process cannot execute the Save As instruction or the Auto Save instruction.
[0105] Since the second process cannot perform the Save As operation and the Auto Save operation independently, when the user performs the Save As trigger operation or the Auto Save trigger operation in the second process, a prompt message will be output to prompt the user that the second process cannot perform the Save As instruction or the Auto Save instruction. The prompt message can also prompt the user that the Save As instruction or the Auto Save instruction needs to be triggered in the first process to implement the Save As operation or the Auto Save operation of the information in the first process and the second process. After the user views the prompt message, the Save As instruction or the Auto Save instruction trigger operation will be executed in the first process. In addition, when the Save As instruction or the Auto Save instruction triggered by the second process is obtained, the present embodiment can also automatically jump to the Save As trigger interface or the Auto Save trigger interface in the first process, so that the user can directly perform the Save As instruction or the Auto Save instruction trigger operation in the first process.
[0106] As an optional implementation, see Figure 5 As shown, in another embodiment of the present application, the process synchronization method further includes:
[0107] S501. When a closing instruction triggered by a first process is obtained, determine whether a second process exists; if so, execute step S502; if not, execute step S503.
[0108] In this embodiment, the user can trigger a closing instruction through the first process. When the closing instruction triggered by the first process is obtained, it is determined whether the second process exists. If it is determined that the second process exists, step S502 is executed. If it is determined that the second process does not exist, step S503 is executed.
[0109] S502: Output prompt information to prompt the user to use the second process to trigger the closing, and after obtaining the closing instruction triggered by the second process, execute the closing process of the second process.
[0110] If it is determined that the second process exists, a prompt message is output to prompt the user to use the second process to trigger the shutdown, wherein the prompt message may carry information such as the name of the safety project in the second process, and may also carry a button to switch to the second process, according to which the user may enter the second process to trigger the shutdown instruction. After receiving the prompt message, the user may trigger the shutdown instruction through the second process, and after obtaining the shutdown instruction triggered by the second process, the shutdown process of the second process is executed.
[0111] Specifically, the closing process of the second process includes: saving the engineering interface data and shared memory corresponding to the safety project, and then closing the second process, that is, closing the engineering interface of the safety project constructed by the second process. Further, before saving the engineering interface data and shared memory corresponding to the safety project, it can be judged whether the engineering interface data and shared memory of the safety project need to be saved. If it is judged that they need to be saved, the engineering interface data and shared memory corresponding to the safety project are saved, and then the second process is closed after the saving is completed. If it is judged that they do not need to be saved, the second process is directly closed. Among them, the judgment of whether the engineering interface data and shared memory of the safety project need to be saved can be based on whether the engineering interface data and shared memory of the safety project have changed since the last save to judge whether they need to be saved, or a prompt message of whether to save can be output, and whether to save can be judged based on the feedback results of the user.
[0112] S503: Execute the closing procedure of the first process.
[0113] When the second process exists, a prompt message is output to prompt the user to use the second process to trigger the shutdown, and after the shutdown instruction triggered by the second process is obtained and the shutdown process of the second process is executed, the shutdown process of the first process is executed. In addition, if it is determined that the second process does not exist, the shutdown process of the first process is directly executed.
[0114] Specifically, the closing process of the first process includes: saving the data synchronization file and the engineering data corresponding to the first process, wherein the engineering data corresponding to the first process includes the engineering interface data of the non-safety engineering constructed based on the information corresponding to the non-safety engineering, and the non-safety engineering includes nodes and configurations related to non-safety. Then the first process is closed, that is, the engineering interface of the non-safety engineering constructed by the first process is closed. Further, before saving the data synchronization file and the engineering data corresponding to the first process, it can be judged whether the data synchronization file and the engineering data corresponding to the first process need to be saved. If it is judged that it needs to be saved, the data synchronization file and the engineering data corresponding to the first process are saved, and the first process is closed after the saving is completed. If it is judged that it does not need to be saved, the first process is directly closed. Among them, the judgment of whether the data synchronization file and the engineering data corresponding to the first process need to be saved can be judged whether it needs to be saved based on whether the data synchronization file and the engineering data corresponding to the first process have changed since the last save, or a prompt message of whether to save can be output, and whether to save is judged based on the feedback results of the user.
[0115] Exemplary Devices
[0116] Accordingly, the present application embodiment also provides a process synchronization device, see Figure 6 As shown, the device comprises:
[0117] A first creation module 100 is used to create a data synchronization file and a security logical node linked to a second process in a first process, wherein the data synchronization file includes information corresponding to a security project, and the security project includes nodes and configurations related to security;
[0118] The second creation module 110 is used to open the second process through the security logic node in the first process, create a shared memory in the second process, and update the information corresponding to the security project into the shared memory;
[0119] A comparison module 120, configured to compare the data synchronization file and the shared memory using the second process to determine a process synchronization result;
[0120] The safety project determination module 130 is used to determine the engineering interface data corresponding to the safety project and create the engineering interface corresponding to the safety project based on the information corresponding to the safety project in the shared memory when the process synchronization result indicates that the synchronization is successful.
[0121] From the above introduction, it can be seen that the process synchronization device proposed in the embodiment of the present application can synchronize the security-related nodes and configurations in the first process to the second process, and create an engineering interface corresponding to the security engineering, so that the security-related nodes and configurations and the non-security-related nodes and configurations can be displayed in different engineering interfaces, thereby realizing functional differentiation, and thus improving the convenience and efficiency of engineering operation and configuration.
[0122] As an optional implementation, another embodiment of the present application discloses that the process synchronization device further includes: an update module and a refresh module.
[0123] An update module, used for updating the information corresponding to the safety engineering in the data synchronization file and the information corresponding to the safety engineering in the shared memory by using the first process if the information corresponding to the safety engineering has data changes;
[0124] A comparison module 120, configured to compare the data synchronization file and the shared memory using the second process to determine a process synchronization result;
[0125] The refresh module is used to refresh the engineering interface data and engineering interface corresponding to the safety engineering based on the updated information corresponding to the safety engineering in the shared memory when the process synchronization result indicates that the synchronization is successful.
[0126] As an optional implementation, in another embodiment of the present application, it is disclosed that the comparison module 120 is specifically used for:
[0127] Using the second process to compare the information in the data synchronization file with the information in the shared memory, and obtaining a comparison result between the data synchronization file and the shared memory;
[0128] If the comparison results indicate the same, then the process synchronization result is determined to indicate that the synchronization is successful;
[0129] If the comparison result indicates a difference, the information corresponding to the safety project in the data synchronization file and the information corresponding to the safety project in the shared memory are updated using the first process according to the preset update number, and the information in the data synchronization file and the information in the shared memory are re-compared using the second process.
[0130] As an optional implementation, another embodiment of the present application discloses that the process synchronization device further includes: a saving module and a prompt output module.
[0131] A saving module, configured to execute a saving process based on the first process when a saving instruction triggered by the first process is obtained;
[0132] A prompt output module is used to output prompt information prompting the user to use the first process to trigger the save operation in the first process when the save instruction triggered by the second process is obtained, so that the user can perform the save trigger operation in the first process and send the save instruction triggered by the first process;
[0133] The saving process based on the first process includes:
[0134] If the second process exists, the data synchronization file and the shared memory are updated by the first process, the engineering interface data and the shared memory corresponding to the updated safety engineering are saved, and the updated data synchronization file and the engineering data corresponding to the first process are saved; the engineering data corresponding to the first process includes the engineering interface data of the non-safety engineering constructed based on the information corresponding to the non-safety engineering, and the non-safety engineering includes nodes and configurations related to non-safety;
[0135] If the second process does not exist, the data synchronization file is updated using the first process, and the updated data synchronization file and the engineering data corresponding to the first process are saved.
[0136] As an optional implementation, another embodiment of the present application discloses that the saving module is further used to execute a saving process based on the first process according to the saving address carried by the instruction when a save as instruction or an automatic save instruction triggered by the first process is obtained;
[0137] The prompt output module is also used to output prompt information indicating that the second process cannot execute the save as instruction or the automatic save instruction when a save as instruction or an automatic save instruction triggered by the second process is obtained.
[0138] As an optional implementation, another embodiment of the present application discloses that the process synchronization device further includes: a judgment module and a closing module.
[0139] A judgment module, used to judge whether the second process exists when a closing instruction triggered by the first process is obtained;
[0140] The prompt output module is further used to output a prompt message prompting the user to trigger the closing of the second process if the second process exists;
[0141] A closing module, configured to execute the closing procedure of the second process and the closing procedure of the first process after obtaining the closing instruction triggered by the second process;
[0142] The closing module is also used to execute the closing process of the first process if the second process does not exist.
[0143] As an optional implementation, another embodiment of the present application discloses that the closing process of the first process includes:
[0144] The data synchronization file and the engineering data corresponding to the first process are saved, and then the first process is closed; the engineering data corresponding to the first process includes engineering interface data of the non-safety engineering constructed based on the information corresponding to the non-safety engineering, and the non-safety engineering includes nodes and configurations related to non-safety;
[0145] The closing process of the second process includes:
[0146] The engineering interface data and shared memory corresponding to the safety engineering are saved, and then the second process is closed.
[0147] The process synchronization device provided in this embodiment belongs to the same application concept as the process synchronization method provided in the above embodiments of this application, can execute the process synchronization method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the process synchronization method. For technical details not fully described in this embodiment, please refer to the specific processing content of the process synchronization method provided in the above embodiments of this application, and will not be repeated here.
[0148] Exemplary Electronic Devices
[0149] Another embodiment of the present application also provides an electronic device, see Figure 7 As shown, the device includes:
[0150] Memory 200 and processor 210;
[0151] The memory 200 is connected to the processor 210 and is used to store programs;
[0152] The processor 210 is used to implement the process synchronization method disclosed in any of the above embodiments by running the program stored in the memory 200.
[0153] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .
[0154] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.
[0155] A bus may include a pathway that transfers information between components of a computer system.
[0156] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0157] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0158] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0159] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0160] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0161] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0162] The processor 210 executes the program stored in the memory 300 and calls other devices, which can be used to implement each step of any process synchronization method provided in the above embodiments of the present application.
[0163] Exemplary computer program products and storage media
[0164] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the process synchronization method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
[0165] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0166] In addition, an embodiment of the present application may also be a storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the process synchronization method according to various embodiments of the present application described in the above "Exemplary Method" section of this specification.
[0167] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0168] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0169] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0170] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0171] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0172] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0173] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0174] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0175] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0176] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0177] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A process synchronization method, characterized in that: include: Creating a data synchronization file and a security logical node linked to the second process in the first process, wherein the data synchronization file includes information corresponding to the security project, and the security project includes nodes and configurations related to security; Opening a second process through a security logic node in the first process, creating a shared memory in the second process, and updating information corresponding to the security project into the shared memory; Using the second process to compare the data synchronization file and the shared memory, and determine a process synchronization result; When the process synchronization result indicates that the synchronization is successful, based on the information corresponding to the safety project in the shared memory, the engineering interface data corresponding to the safety project is determined and the engineering interface corresponding to the safety project is created.
2. The method according to claim 1, characterized in that Also includes: If the information corresponding to the safety engineering has data changes, the information corresponding to the safety engineering in the data synchronization file and the information corresponding to the safety engineering in the shared memory are updated by using the first process; Using the second process to compare the data synchronization file and the shared memory, and determine a process synchronization result; When the process synchronization result indicates that the synchronization is successful, the engineering interface data and engineering interface corresponding to the safety engineering are refreshed based on the updated information corresponding to the safety engineering in the shared memory.
3. The method according to any one of claims 1 or 2, characterized in that Using the second process to compare the data synchronization file and the shared memory to determine a process synchronization result includes: Using the second process to compare the information in the data synchronization file with the information in the shared memory, to obtain a comparison result between the data synchronization file and the shared memory; If the comparison result indicates the same, then determining the process synchronization result indicates that the synchronization is successful; If the comparison result indicates a difference, the first process is used to update the information corresponding to the safety engineering in the data synchronization file and the information corresponding to the safety engineering in the shared memory according to the preset update number, and the second process is used to re-compare the information in the data synchronization file and the information in the shared memory.
4. The method according to claim 1, characterized in that: Also includes: When a save instruction triggered by the first process is obtained, executing a save process based on the first process; When the save instruction triggered by the second process is obtained, outputting prompt information prompting the user to use the first process to trigger the save, so that the user performs the save trigger operation in the first process and sends the save instruction triggered by the first process; The saving process based on the first process includes: If the second process exists, the data synchronization file and the shared memory are updated by using the first process, the engineering interface data corresponding to the updated safety engineering and the shared memory are saved, and the updated data synchronization file and the engineering data corresponding to the first process are saved; the engineering data corresponding to the first process includes engineering interface data of the non-safety engineering constructed based on the information corresponding to the non-safety engineering, and the non-safety engineering includes nodes and configurations related to non-safety; If the second process does not exist, the data synchronization file is updated using the first process, and the updated data synchronization file and the engineering data corresponding to the first process are saved.
5. The method according to claim 4, characterized in that Also includes: When a save as instruction or an automatic save instruction triggered by the first process is obtained, executing the saving process based on the first process according to the saving address carried by the instruction; When a save as instruction or an automatic save instruction triggered by the second process is obtained, a prompt message is output indicating that the second process cannot execute the save as instruction or the automatic save instruction.
6. The method according to claim 1, characterized in that Also includes: In case a close instruction triggered by the first process is obtained, determining whether the second process exists; If the second process exists, output a prompt message prompting the user to use the second process to trigger the closure, and after obtaining the closure instruction triggered by the second process, execute the closure process of the second process and the closure process of the first process; If the second process does not exist, execute the closing process of the first process.
7. The method according to claim 6, characterized in that The closing process of the first process includes: The data synchronization file and the engineering data corresponding to the first process are saved, and then the first process is closed; the engineering data corresponding to the first process includes engineering interface data of a non-safety engineering constructed based on information corresponding to a non-safety engineering, and the non-safety engineering includes nodes and configurations related to non-safety; The closing process of the second process includes: The engineering interface data corresponding to the safety engineering and the shared memory are saved, and then the second process is closed.
8. A process synchronization device, characterized in that: include: A first creation module, configured to create a data synchronization file and a security logical node linked to a second process in a first process, wherein the data synchronization file includes information corresponding to a security project, and the security project includes nodes and configurations related to security; A second creation module, used to open a second process through a security logic node in the first process, create a shared memory in the second process, and update information corresponding to the security project into the shared memory; A comparison module, used to compare the data synchronization file and the shared memory using the second process to determine a process synchronization result; The safety engineering determination module is used to determine the engineering interface data corresponding to the safety engineering and create the engineering interface corresponding to the safety engineering based on the information corresponding to the safety engineering in the shared memory when the process synchronization result indicates that the synchronization is successful.
9. An electronic device, characterized in that: include: Memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the process synchronization method as described in any one of claims 1 to 7 by running the program in the memory.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the process synchronization method according to any one of claims 1 to 7 is implemented.