A communication protocol-based computing data synchronization method and device
By using a computational data synchronization method based on communication protocols and leveraging the WebSocket protocol to monitor and push the computational progress of the molecular refining model in real time, the problem of low efficiency in manual user refresh and inaccurate multi-user computation results is solved, achieving efficient and accurate computational status monitoring and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- RICHFIT INFORMATION TECH
- Filing Date
- 2024-11-29
- Publication Date
- 2026-05-29
AI Technical Summary
In existing refining systems, manually refreshing the molecular refining model's calculation status by users is inefficient, and simultaneous calculations by multiple users lead to inaccurate results, affecting calculation efficiency and user experience.
A computational data synchronization method based on a communication protocol is adopted. The computational progress of the molecular refining model is monitored and pushed in real time through the WebSocket protocol, and the synchronization users are identified and the computational progress is pushed.
It improves the computational efficiency of molecular refining models, enhances users' understanding of the computational status, and improves user experience and the accuracy of computational results.
Smart Images

Figure CN122111697A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method and apparatus for synchronizing computing data based on a communication protocol. Background Technology
[0002] Currently, similar refining systems typically have two scenarios when a user wants to know the actual molecular refining model calculation and replication status after starting calculations and replication:
[0003] 1) The method of having users manually click the refresh button to refresh the system page and passively observe whether the molecular refining model's calculation and data copying status has changed to "calculation completed" is inefficient. Users are likely to give up refreshing after multiple refreshes without seeing any changes in status and go to do other things, wasting time. Furthermore, the frequent manual refresh of the molecular refining model's calculation status is not timely and affects the user experience, which will undoubtedly significantly reduce the calculation efficiency of the molecular refining model.
[0004] 2) When multiple users open the same molecular refining model, if one person clicks the molecular refining model calculation button and another person, unaware of this, clicks the same button repeatedly, the person who finished the calculation first will see the result of someone else's calculation when they return after a period of time without knowing it. When multiple users are unaware of the current calculation status of the molecular refining model, there are problems such as multiple users calculating the same model at the same time, or changing the input parameters during the calculation process. This will cause users to see unexpected and inaccurate molecular refining model calculation results, which will undoubtedly have serious consequences for the rigor of the model calculation. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a computing data synchronization method and apparatus based on a communication protocol to overcome at least one of the above-mentioned defects.
[0006] In a first aspect, embodiments of this application provide a computational data synchronization method based on a communication protocol. The method includes: receiving a computational instruction, the computational instruction being used to instruct the invocation of a molecular refining model to handle a computational task of refining product yield; responding to the computational instruction, determining the total number of functional nodes of the molecular refining model and performing model initialization; monitoring the completion status of each functional node in real time, and determining the computational progress of the molecular refining model for the computational task based on the completion status of each functional node; determining synchronization users, the synchronization users including users logged into the platform corresponding to the communication protocol; and pushing the computational progress of the molecular refining model to the synchronization users.
[0007] In one optional embodiment of this application, the step of determining the total number of functional nodes of the molecular refining model and performing model initialization in response to the calculation instruction includes: determining whether the running state of the molecular refining model is idle in response to the calculation instruction; if the running state of the molecular refining model is not idle, then pushing the calculation progress of the molecular refining model to the synchronization user; if the running state of the molecular refining model is idle, then determining the total number of functional nodes of the molecular refining model and performing model initialization.
[0008] In one optional embodiment of this application, the synchronization user is determined in the following way: based on the username information and password, an identity code corresponding to the username information is generated and recorded, the identity code being used to indicate that the username information has successfully logged into the platform corresponding to the communication protocol; the identity code that sends the calculation command is identified, the username information corresponding to the identity code is determined as the calculation user, and the molecular refining model is matched with the calculation user; users who have successfully logged into the platform corresponding to the communication protocol and sent calculation commands, other than the calculation user, are determined as synchronization users.
[0009] In one optional embodiment of this application, the real-time monitoring of the completion status of each functional node and the determination of the computation progress of the molecular refining model for the computation task based on the completion status of each functional node include: after receiving the node completion instruction of each functional node, recording the total number of completed nodes; and determining the computation progress of the molecular refining model for the computation task based on the ratio of the current total number of completed nodes to the total number of points.
[0010] In one optional embodiment of this application, the method further includes: when the molecular refining model is being calculated, copying the molecular refining model and the input parameters to obtain a target molecular refining model; and comparing the output value of the molecular refining model with the output value of the target molecular refining model to display the comparison result.
[0011] In one optional embodiment of this application, the step of pushing the calculation progress of the molecular refining model to the synchronization user for display includes: real-time detection of the current percentage corresponding to the calculation progress of the molecular refining model; when the difference between the current percentage and the historical percentage is detected to be greater than a percentage threshold, pushing the current percentage to the calculation user and the synchronization user.
[0012] In an optional embodiment of this application, the method further includes: when the synchronous user exits the platform corresponding to the communication protocol, disconnecting the connection between the synchronous user and the platform corresponding to the communication protocol, and deleting the identity code corresponding to the username information, so that the synchronous user who exits the platform corresponding to the communication protocol cannot receive the calculation progress of the molecular refining model.
[0013] Secondly, embodiments of this application also provide a synchronization device, the device comprising: a calculation instruction receiving module, configured to receive a calculation instruction, the calculation instruction being used to instruct the invocation of a molecular refining model to handle the calculation task of refining product yield; a model initialization module, configured to, in response to the calculation instruction, determine the total number of functional nodes of the molecular refining model and perform model initialization; a calculation progress determination module, configured to monitor the completion status of each functional node in real time and determine the calculation progress of the molecular refining model for the calculation task based on the completion status of each functional node; a synchronization user determination module, configured to determine synchronization users, the synchronization users including users logged into the platform corresponding to the communication protocol; and a calculation progress push module, configured to push the calculation progress of the molecular refining model to the synchronization users.
[0014] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method described above are performed.
[0015] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the method described above.
[0016] The computational data synchronization method and apparatus based on a communication protocol provided in this application embodiment receive a computational instruction, which instructs the invocation of a molecular refining model to handle the computational task of refining product yield; in response to the computational instruction, determine the total number of functional nodes of the molecular refining model and perform model initialization; monitor the completion status of each functional node in real time, and determine the computational progress of the molecular refining model for the computational task based on the completion status of each functional node; determine the synchronization user, including users logged into the platform corresponding to the communication protocol; and push the computational progress of the molecular refining model to the synchronization user. This application receives computational instructions, monitors the computational progress in real time, and pushes the progress to the synchronization user after detecting that a synchronization user has logged into the platform. This avoids the problem that the synchronization user, after logging into the platform, may input computational parameters into the molecular refining model without knowing that the molecular refining model is performing a computational task, resulting in inaccurate calculation results. This improves the computational efficiency of the molecular refining model and enhances the user experience through real-time monitoring and progress management.
[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 An interactive diagram illustrating the computational process of a molecular refining model in existing technologies;
[0020] Figure 2 A flowchart illustrating a computational data synchronization method based on a communication protocol provided in an embodiment of this application;
[0021] Figure 3 An interaction diagram illustrating the computational data synchronization method based on a communication protocol provided in an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the synchronization device provided in the embodiments of this application;
[0023] Figure 5 The present application provides a schematic diagram of the structure of an electronic device. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0025] First, the applicable scenarios for this application will be introduced. This application can be applied to the field of computer technology.
[0026] Research has revealed that during molecular refining model calculations, the system often takes time to prepare the necessary data (reading from the database and checking the integrity of the molecular refining model data) in the early stages, so these operations are asynchronous. Furthermore, to obtain accurate results, the calculation process involves calling numerous time-consuming algorithms and multiple iterations, resulting in long processing times. Additionally, the molecular refining model calculation and copying process is not intuitive (asynchronous background operation with no real-time progress), leading users to mistakenly believe that the calculation or copying system is stuck while waiting.
[0027] For individual users, when they want to know the actual calculation and copying status of the molecular refining model after starting calculations and copying, they manually click the refresh button to refresh the system page and passively observe whether the calculation and copying status of the molecular refining model has changed to "calculation and copying complete". This method of manually clicking the refresh button is inefficient. Users are likely to give up refreshing after repeatedly refreshing without seeing any changes in the status and go to do other things, which wastes time.
[0028] For multiple user aspects, such as Figure 1 As shown, when multiple users open the same molecular refining model (Model 1), because user A clicked the molecular refining model calculation button first, user B, unaware of this, clicked the molecular refining model calculation button repeatedly. As a result, user B sees the calculation result of user A, who finished the calculation first. However, user A, who finished the calculation first, may see user B's calculation result after a period of time without knowing it. When multiple users are unaware of the current calculation status of the molecular refining model, there are problems such as multiple users calculating the same model at the same time, or changing the input parameters during the calculation process, resulting in low calculation efficiency and a poor user experience.
[0029] Based on this, embodiments of this application provide a computational data synchronization method and apparatus based on a communication protocol. The method includes receiving a computational instruction, which instructs the invocation of a molecular refining model to handle a computational task related to the yield of refined products; responding to the computational instruction, determining the total number of functional nodes in the molecular refining model and initializing the model; monitoring the completion status of each functional node in real time and determining the computational progress of the molecular refining model for the computational task based on the completion status of each functional node; determining synchronization users, including users logged into the platform corresponding to the communication protocol; and pushing the computational progress of the molecular refining model to the synchronization users. This application, by receiving computational instructions, monitoring the computational progress in real time, and pushing it to the synchronization users, avoids the problem of inaccurate calculation results caused by synchronization users inputting computational parameters into the molecular refining model after logging into the platform because they are unaware that the molecular refining model is performing a computational task. This improves the computational efficiency of the molecular refining model, enhances the user experience, and increases the user experience through real-time monitoring and progress management.
[0030] In an optional embodiment, the communication protocol of this application can be the WebSocket protocol. The WebSocket protocol is a protocol for full-duplex communication over a single TCP connection, which enables bidirectional communication between the browser and the server.
[0031] WebSocket uses a unique handshake mechanism to establish a TCP-like connection between the client and server, facilitating communication. During connection establishment, the client sends an HTTP request, including specific fields in the request header (such as Upgrade, Connection, Sec-WebSocket-Key, etc.). Upon receiving the request, if the server agrees to establish a WebSocket connection, it returns a 101 status code response, indicating successful protocol switching. Afterward, the client and server can perform bidirectional data transmission via the TCP connection.
[0032] WebSocket allows servers to proactively push data to clients, and clients can also proactively send data to servers, enabling true two-way communication.
[0033] Because WebSocket communicates over a single TCP connection, it offers lower latency and higher communication efficiency compared to the multiple request-response model of the HTTP protocol.
[0034] Please see Figure 2 , Figure 2 This is a flowchart illustrating a computational data synchronization method based on a communication protocol provided in an embodiment of this application. Figure 2As shown in the embodiments of this application, the computational data synchronization method based on a communication protocol includes:
[0035] S101, Receive calculation instructions.
[0036] The calculation command is used to instruct the invocation of the molecular refining model to handle the calculation task of refining product yield.
[0037] In this process, after a user enters their username and password on a web page and clicks login, a real-time connection is established with the WebSocket message center. The WebSocket message center establishes a SESSION (identity code) for the successfully logged-in user, records the username information, counts the number of successfully logged-in users, and caches the data.
[0038] In an optional embodiment, the input to the molecular refining model can be a raw material molecular matrix, operating conditions, and a reaction rule database, etc. The molecular refining model usually needs to consider the detailed molecular composition of the raw materials, including various hydrocarbon molecules, impurity molecules, etc. The raw material molecular matrix is the basis of the model input, which describes the types and quantities of various molecules in the raw materials.
[0039] Operating conditions such as temperature, pressure, type and amount of catalyst, and reaction time are also important inputs to the model, as these conditions directly affect the chemical reaction rate and product distribution in the refining process.
[0040] The reaction rule database contains rules and kinetic parameters for various chemical reactions. These rules describe how feedstock molecules are transformed into product molecules under specific conditions. Molecular refining models utilize these rules to simulate actual refining processes.
[0041] In another optional embodiment, the output of the molecular refining model can be a product molecular matrix, product physical property parameters, and product yield, etc. The product molecular matrix after reaction simulation describes the types and quantities of various molecules in the product. By comparing the raw material molecular matrix and the product molecular matrix, the transformation of raw material molecules and the generation of products during the refining process can be understood.
[0042] The physical properties of the products, such as density, viscosity, and flash point, are of great significance to the quality and application of the products. Product yield is an important indicator for measuring the efficiency of the refining process. Molecular refining models can calculate and output the yield of various products, thereby helping to optimize the refining process and improve product yield.
[0043] Here, the molecular refining model can provide a deep understanding of the petroleum processing process at the molecular level, accurately predict product properties, and precisely calculate the yield of refined products, reducing errors and improving accuracy. Based on the calculation results of the molecular refining model, the refining process and processing flow can be optimized. By rationally configuring the processing flow and optimizing process operations, refining efficiency and product quality can be improved. The molecular refining model follows the concept of "making the best use of resources and giving full play to their capabilities," which can maximize the use of petroleum resources, improve resource utilization efficiency, and reduce production costs.
[0044] S102. In response to the calculation command, determine the total number of functional nodes of the molecular refining model and initialize the model.
[0045] After entering the molecular refining model information on the login screen, users can click the calculate button to generate calculation instructions.
[0046] In response to the calculation command, determine whether the molecular refining model is in an idle state; if the molecular refining model is not in an idle state, push the calculation progress of the molecular refining model to the synchronization user; if the molecular refining model is in an idle state, determine the total number of functional nodes of the molecular refining model and perform model initialization.
[0047] Here, when the molecular refining model is idle, timely model initialization can ensure that the model is ready to receive new computational tasks at any time, thereby improving the model's utilization rate. By monitoring the model's running status in real time and quickly starting new computational tasks when it is idle, the waiting time for computational tasks can be shortened, and the overall computational efficiency can be improved.
[0048] Furthermore, when the molecular refining model is busy, the calculation progress is pushed to the synchronous users, allowing them to understand the progress of the calculation task in real time. This enhances the users' sense of control and trust in the calculation process. This transparency not only helps improve user satisfaction, but also helps users to arrange their time reasonably and avoid unnecessary waiting and anxiety.
[0049] By judging the operating status of the molecular refining model, intelligent scheduling of computational tasks can be achieved. When the model is idle, new computational tasks are prioritized; when the model is busy, tasks can be allocated to other available computing resources or wait for the current task to complete. This intelligent scheduling mechanism helps balance the load of computing resources and avoid resource idleness or overload, thereby improving the stability and efficiency of the entire computing system. During the model initialization phase, it can be ensured that all functional nodes of the model are correctly configured and in an available state, thereby reducing the risk of failures or errors during the calculation process. By ensuring that the model runs in the best state, the reliability and accuracy of computational tasks can be improved, providing users with more accurate and reliable calculation results.
[0050] When performing calculations using the molecular refining model, the molecular refining model and its input parameters are copied to obtain the target molecular refining model. The output values of the molecular refining model and the target molecular refining model are then compared to display the comparison results.
[0051] When a user triggers the molecular refining model calculation and replication operation, the calculation server or data server sends the model ID and the total number of functional nodes required for calculation and replication to the WebSocket message center. The WebSocket message center then establishes a connection relationship between the total number of nodes required for model calculation or replication and the model ID and username information, and initializes the current model calculation and replication progress to 0%.
[0052] Specifically, through the interaction between the WebSocket message center and the computing server or data server, as well as the replication and comparison of the molecular refining model and its input parameters and output values, it is possible to achieve real-time progress tracking, enhance the transparency and controllability of task management, improve the reliability and accuracy of calculation results, optimize resource allocation and load balancing, support multi-task concurrent processing, and provide rich error handling and recovery mechanisms. These effects collectively improve the efficiency and reliability of molecular refining model calculation and replication tasks.
[0053] S103. Monitor the completion status of each functional node in real time, and determine the calculation progress of the molecular refining model for the calculation task based on the completion status of each functional node.
[0054] In this step, the computing server sends node completion messages to the WebSocket message center at each functional node, such as preparing the computational data required for the molecular refining model, replacing the GAMS template, starting the computation, ending the computation, storing the results, and redrawing the flowchart. The WebSocket message center can receive node completion messages from the computing server and the data server in real time, thereby enabling real-time feedback and monitoring of the computation and replication tasks. Users can understand the progress of the task in real time through the WebSocket message center, including the completion status of each functional node, so as to make timely decisions or adjustments.
[0055] In the replication function of the molecular refining model, the data server adds a function to send a completion message to the WebSocket message center at the end of the replication completion function of each table.
[0056] After receiving the node completion instruction from each functional node, record the total number of completed nodes;
[0057] For example, when the computing server completes functional nodes such as preparing data, replacing templates, starting computing, ending computing, and storing results, it sends a node completion message to the WebSocket message center.
[0058] When each table in the molecular refining model replication function is copied, the data server sends a completion message to the WebSocket message center. By sending a replication completion message for each table to the WebSocket message center during the data replication process, the consistency and integrity of the data can be ensured. If problems occur during the replication process, the administrator can promptly detect them and take measures to repair them, thereby ensuring the accuracy of the data.
[0059] The computation progress of the molecular refining model for the computational task is determined based on the ratio of the current total number of completed nodes to the total number of summary nodes.
[0060] Specifically, the computation progress of the computation task is determined by the following formula:
[0061]
[0062] Where percent represents the computation progress of the computation task, x represents the total number of currently completed nodes, and y represents the total number of summary points.
[0063] When the WebSocket message center receives a message indicating that the calculation and replication of the molecular refining model have been completed, it calculates the current percentage progress of the calculation and replication, saves it, and sends it to the user who generated the calculation command.
[0064] Here, by calculating and feeding back the current percentage progress of the molecular refining model in real time, it is possible to achieve effects such as real-time progress feedback, improved task transparency, optimized user experience, support for multi-task management, fault warning and response, resource optimization and scheduling, and data accuracy assurance.
[0065] S104. Determine the synchronization user.
[0066] Synchronized users include users who have logged into the platform corresponding to the communication protocol, that is, users who have logged into WebSocket;
[0067] Based on the username and password, generate and record an identity code corresponding to the username. The identity code is used to verify successful login to WebSocket using the username information.
[0068] Identify the identity code that sends the calculation command, determine the username information corresponding to the identity code as the calculation user, and match the molecular refining model with the calculation user;
[0069] Users who successfully log in to WebSocket and send computation commands, other than the computation user, are identified as synchronous users.
[0070] Through the above steps, by synchronizing the interaction between users, identity codes, computing users, and the WebSocket platform, the system can achieve user authentication and authorization, matching computing users with models, determining and managing synchronous users, real-time communication and data synchronization, task collaboration and resource optimization, and security and privacy protection. These effects collectively improve the system's performance, reliability, and user experience.
[0071] S105. Push the calculation progress of the molecular refining model to the synchronous users.
[0072] Pushing the calculation progress of the molecular refining model to synchronous users in real time can enhance information transparency, improve user satisfaction, promote collaborative work, optimize resource allocation, provide fault warnings and responses, and ensure data consistency and accuracy.
[0073] In summary, by implementing the above series of steps, computational commands can be responded to efficiently, the computational progress of the molecular refining model can be monitored in real time, and progress information can be pushed to synchronous users. This helps to improve task transparency, optimize resource allocation, promote collaborative work and communication, and enhance the overall user experience.
[0074] Specifically, the current percentage corresponding to the calculation progress of the molecular refining model is detected in real time;
[0075] When the difference between the current percentage and the historical percentage is detected to be greater than the percentage threshold, the current percentage is pushed to the calculation user and the synchronization user.
[0076] Before sending, in order to reduce the consumption of server and network resources, the historical progress percentage of the model is compared with the current percentage to ensure that the message is actively sent to the client webpage only when the current progress reaches the stage improvement percentage threshold or has reached 100%.
[0077] In an alternative embodiment, the percentage threshold can be 18% to conserve requested resources.
[0078] Furthermore, to ensure sending efficiency, the sent content is limited to the current molecular refining model, the current operation (calculation or replication) calculation progress, and the replication progress. Finally, the message is formatted as JSON and pushed to the calculation user and synchronization user corresponding to the system where the model ID is located.
[0079] After receiving the corresponding molecular refining model calculation and replication progress message, the user parses the JSON format message and renders it on the page in real time to display the progress.
[0080] Here, the current percentage corresponding to the calculation progress of the molecular refining model is detected in real time, and an update is pushed to the user when a significant progress change is detected. This can reduce information redundancy, improve user experience, optimize resource use, enhance real-time performance and accuracy, promote user interaction and participation, support fault warning and response, and maintain synchronization between users.
[0081] When a user exits WebSocket, the connection between the user and WebSocket is disconnected, and the identity code corresponding to the username information is deleted, so that the user who exits WebSocket cannot receive the calculation progress of the molecular refining model.
[0082] Specifically, when a user closes the front-end page, the WebSocket connection is automatically disconnected, and the WebSocket message center will clean up the relevant information of the disconnected SESSION user.
[0083] Here, disconnecting the synchronous user from the WebSocket and deleting the identity code corresponding to the username information can release resources, enhance security, prevent information leakage, improve user experience, maintain data consistency, support fault recovery and fault tolerance, and promote system scalability.
[0084] This application completely changes the way users manually refresh the model list by inserting the asynchronous operations of the original asynchronous molecular refining model calculation and replication into the synchronous message node, so as to observe the calculation and replication progress graph in real time, which greatly improves the user's perception of the timeliness of molecular refining model calculation and replication.
[0085] The computational data synchronization method and apparatus based on a communication protocol provided in this application embodiment receive a computational instruction, which instructs the invocation of a molecular refining model to handle the computational task of refining product yield; in response to the computational instruction, determine the total number of functional nodes of the molecular refining model and initialize the model; monitor the completion status of each functional node in real time, and determine the computational progress of the molecular refining model for the computational task based on the completion status of each functional node; determine synchronization users, including users logged into the platform corresponding to the communication protocol; and push the computational progress of the molecular refining model to the synchronization users. This application improves the computational efficiency of the molecular refining model, increases user understanding of the computational status of the molecular refining model, and enhances user perception of the molecular refining model.
[0086] Please see Figure 3 , Figure 3 This is an interaction diagram illustrating the computational data synchronization method based on a communication protocol provided in an embodiment of this application. (See diagram below.) Figure 3As shown in the diagram, taking two users as an example, the nodes consist of three stages: data preparation, computation-related nodes, and result storage. User A is the computation user, and user B is the synchronization user. After logging in, users A and B verify their usernames and passwords and establish a WebSocket connection with the molecular refining model. When user A clicks on computation model 1, the data preparation stage begins, which is synchronously distributed to both users A and B, allowing them to view the data simultaneously. When user A enters the computation-related node, the entry point for the computation node is synchronously distributed to both users A and B. After the computation is completed, the result storage node is entered, storing the results. The database node is synchronously distributed to users A and B. User A finishes the calculation. After user B clicks to calculate model 1, the system first checks the status of the same model 1 to determine if model 1 is being calculated. If it is, the system checks the calculation progress in real time. If it is not being calculated, the system starts the calculation and enters the data preparation stage. This stage is synchronously distributed to users A and B so that they can view it simultaneously. When user B enters a calculation-related node, the system synchronously distributes the entry to the calculation node to users A and B. After the calculation is completed, the system enters the result entry node, which is synchronously distributed to users A and B. User B then finishes the calculation.
[0087] The purpose of this application is to solve the problems of existing molecular refining model calculation and model replication processes, which heavily rely on manual status updates, are inconvenient to predict process duration, and cannot guarantee the accuracy of molecular refining model calculation results. The aim is to achieve visualization and sharing of the status and progress of molecular refining model calculation and replication, improve the overall efficiency of molecular refining model calculation and model replication, and ensure the accuracy and security of the result data.
[0088] During the calculation and replication of the molecular refining model, message sending modules are inserted into various nodes within the system to send the progress of the calculation and replication to the WebSocket message center. The message center then sends the information in real time to the operation interfaces of different users on different systems, making the progress visible, improving the efficiency of molecular refining model calculation and replication, and enhancing the user experience.
[0089] This application eliminates the manual refresh of the model list by users. Instead, it allows users to observe the calculation and copying progress graphs in real time. Users can not only observe the calculation and copying progress of their own molecular refining model in real time, but also observe the calculation and copying progress of other users' molecular refining models in the same system. This increases users' understanding of the real-time status of the models in the system and enhances their perception of the system.
[0090] The WebSocket Message Center uses the Spring Cloud framework. As an independent service, after registering with the EUREKA registry, all existing or dynamically started computing and replication services using the same framework can be automatically identified and connected to the WebSocket Message Center.
[0091] After the WebSocket message center unified the calculation and replication information of the molecular refining model, all model calculation and replication services can obtain accurate model status information in real time. This eliminates the problem of information asynchrony caused by multiple instances of molecular refining model calculation and replication services, as well as duplicate calculation and replication operations, thus avoiding model data corruption.
[0092] The WebSocket message center can also access molecular refining model information that other users need to view in real time, such as: molecular refining model open status: letting users know who is operating the same model as them; molecular refining model import and export status: letting users know the flow of model information.
[0093] Real-time progress monitoring of molecular refining model calculation and replication processes avoids users frequently refreshing the molecular refining model list, which could cause them to miss calculation completion time points and extend modeling and calculation operations, effectively improving the efficiency of molecular refining model calculation and replication.
[0094] The calculation and replication process of the molecular refining model is uniformly monitored. In a distributed computing environment, different computing services are distributed across multiple servers. The calculation and replication information of the molecular grain and oil model is unified to avoid the problem of result overwriting after the same model is calculated and replicated at the same time. Real-time status information is pushed in a reasonable manner to reduce the waste of server resources caused by frequent pushes or uneven push frequency.
[0095] For different systems, the WebSocket service is divided by username information, and molecular refining model calculation and replication information is pushed only to computing users and synchronization users, which reduces the number of network interactions and costs, greatly reduces resource waste, and improves the efficiency of real-time push.
[0096] Based on the same inventive concept, this application also provides a synchronization device corresponding to the communication protocol-based computing data synchronization method. Since the principle of the device in this application is similar to the communication protocol-based computing data synchronization method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0097] Please see Figure 4 , Figure 4 This is a schematic diagram of the synchronization device provided in an embodiment of this application. Figure 4 As shown, the synchronization device 200 includes:
[0098] The calculation instruction receiving module 201 is used to receive calculation instructions, which are used to instruct the invocation of the molecular refining model to handle the calculation task of refining product yield.
[0099] The model initialization module 202 is used to determine the total number of functional nodes of the molecular refining model in response to the calculation instruction, and to perform model initialization;
[0100] The calculation progress determination module 203 is used to monitor the completion status of each functional node in real time, and determine the calculation progress of the molecular refining model for the calculation task based on the completion status of each functional node.
[0101] The synchronization user determination module 204 is used to determine the synchronization user, which includes users who log in to the platform corresponding to the communication protocol;
[0102] The calculation progress push module 205 is used to push the calculation progress of the molecular refining model to the synchronization user.
[0103] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 300 includes a processor 310, a memory 320, and a bus 330.
[0104] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 and the memory 320 communicate via the bus 330. When the machine-readable instructions are executed by the processor 310, they can perform the operations described above. Figure 2 The steps of the computational data synchronization method based on the communication protocol in the method embodiment shown are specifically implemented in the method embodiment and will not be repeated here.
[0105] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 2 The steps of the computational data synchronization method based on the communication protocol in the method embodiment shown are specifically implemented in the method embodiment and will not be repeated here.
[0106] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0108] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0109] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0110] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0111] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A computational data synchronization method based on a communication protocol, characterized in that, include: Receive calculation instructions, which are used to instruct the invocation of a molecular refining model to handle the calculation task of refining product yield; In response to the calculation instructions, the total number of functional nodes of the molecular refining model is determined, and the model is initialized. The completion status of each functional node is monitored in real time, and the calculation progress of the molecular refining model for the calculation task is determined based on the completion status of each functional node. Identify the synchronization users, including users who log in to the platform corresponding to the communication protocol; The calculation progress of the molecular refining model is pushed to the synchronizing user.
2. The method according to claim 1, characterized in that, In response to the calculation instruction, determining the total number of functional nodes of the molecular refining model and performing model initialization includes: In response to the calculation command, determine whether the operating state of the molecular refining model is idle; If the molecular refining model is not in an idle state, the calculation progress of the molecular refining model will be pushed to the synchronization user. If the molecular refining model is in an idle state, then the total number of functional nodes of the molecular refining model is determined, and the model is initialized.
3. The method according to claim 1, characterized in that, The synchronization user is determined in the following way: Based on the username and password, an identity code corresponding to the username is generated and recorded. The identity code is used to indicate that the username has successfully logged into the platform corresponding to the communication protocol. Identify the identity code that sent the calculation command, determine the username information corresponding to the identity code as the calculation user, and match the molecular refining model with the calculation user; Users who successfully log in to the platform corresponding to the communication protocol and send computing commands, other than computing users, are identified as synchronization users.
4. The method according to claim 1, characterized in that, The real-time monitoring of the completion status of each functional node, and the determination of the computation progress of the molecular refining model for the computational task based on the completion status of each functional node, includes: After receiving the node completion instruction from each functional node, record the total number of completed nodes; The computation progress of the molecular refining model for the computation task is determined based on the ratio of the current total number of completed nodes to the total number of summary nodes.
5. The method according to claim 1, characterized in that, The method further includes: When performing calculations using the molecular refining model, the molecular refining model and the input parameters are copied to obtain the target molecular refining model. The output value of the molecular refining model is compared with the output value of the target molecular refining model to display the comparison results.
6. The method according to claim 3, characterized in that, The step of pushing the calculation progress of the molecular refining model to the synchronizing user includes: Real-time detection of the current percentage corresponding to the calculation progress of the molecular refining model; When the difference between the current percentage and the historical percentage is detected to be greater than the percentage threshold, the current percentage is pushed to the computing user and the synchronization user.
7. The method according to claim 3, characterized in that, The method further includes: When the synchronous user exits the platform corresponding to the communication protocol, the connection between the synchronous user and the platform corresponding to the communication protocol is disconnected, and the identity code corresponding to the username information is deleted, so that the synchronous user who exits the platform t corresponding to the communication protocol cannot receive the calculation progress of the molecular refining model.
8. A synchronization device, characterized in that, include: The calculation instruction receiving module is used to receive calculation instructions, which are used to instruct the invocation of the molecular refining model to handle the calculation task of refining product yield. The model initialization module is used to determine the total number of functional nodes of the molecular refining model in response to the calculation instructions, and to perform model initialization. The calculation progress determination module is used to monitor the completion status of each functional node in real time, and determine the calculation progress of the molecular refining model for the calculation task based on the completion status of each functional node. The synchronization user determination module is used to determine the synchronization user, which includes users who log in to the platform corresponding to the communication protocol; The calculation progress push module is used to push the calculation progress of the molecular refining model to the synchronizing user.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method as described in any one of claims 1 to 7.