Remote logging cooperation method based on state machine and control right
By adopting a state machine-based collaboration method in remote logging, the problem that traditional logging mode cannot achieve multi-terminal logging coordination in complex network environments is solved, and the state synchronization consistency between the server and multiple clients and the safety and reliability of logging operations are achieved.
Patent Information
- Application Number
- CN202311790420.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-06-24
AI Technical Summary
The traditional logging model cannot support multi-end logging coordination under the server-client architecture, especially in complex network environments on the well logging operation site, where there are risks such as transmission delay, packet loss, and network disconnection, making it difficult to achieve synchronization and coordination of multi-end logging.
The remote logging collaboration method based on state machine and control rights is adopted, and the state consistency management and unified control rights management between the server and the client are implemented to ensure that the synchronization and coordination of multi-terminal logging is achieved in complex network environments.
It realizes the synchronization and consistency of state between the server and multiple clients, avoids the risks of transmission delay, packet loss, network disconnection, and ensures the security and reliability of remote logging services.
Smart Images

Figure CN120201064A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical fields of oil and gas exploration and development and computer technology, and particularly relates to a remote logging collaboration method based on a state machine and control rights. Background Art
[0002] Logging, as an important method and technology for oil and gas field exploration and development, provides important support for oil and gas exploration, development and production. The on-site working conditions of logging are harsh and the downhole geological environment is complex. The acquisition operation needs to change from on-site decentralized logging to remote centralized logging to maximize the logging operation capacity and efficiency. Remote logging uses a server-multi-client separation method for acquisition operations. The server is deployed at the operation site for data acquisition and distribution, and the client can be deployed at any location for control and monitoring. Network communication is used between the server and multiple clients to achieve data exchange. During the process of multi-client logging acquisition control collaboration, especially under the complex network environment conditions at the logging operation site, there may be risks such as transmission delay, packet loss, and network disconnection. Summary of the Invention
[0003] The traditional logging mode cannot support multi-end logging collaboration under the server-client architecture, especially for the complex network environment conditions at the logging operation site. In order to achieve multi-end logging collaboration and cope with risks such as transmission delay, packet loss, and network disconnection, the present invention provides a remote logging collaboration method based on a state machine and control rights.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] A remote logging collaboration method based on a state machine and control rights, comprising the following steps:
[0006] Remote logging control right process:
[0007] Client A connects to the server and registers the information of Client A with the server;
[0008] Judge whether the control right of the current server has been obtained by other clients. If the control right of the server has been obtained, when Client A needs the control right, send a control right application request to the server. If the control right of the server has not been obtained, the server grants the control right to Client A and records the information that Client A obtains the control right;
[0009] After the server receives the control right application request, ask the client with the control right whether to release the control right;
[0010] The controlling client receives a query request on whether to release the control right. If the controlling client releases the control right, the server grants the control right to Client A and records the information that Client A obtains the control right and the information that the controlling client loses the control right. If the controlling client does not release the control right, the process ends;
[0011] The remote logging collaboration process based on the above remote logging control right process:
[0012] The controlling client changes its state and sends the current state description to the server;
[0013] After receiving the state description, the server determines whether the state description is sent by the controlling client. If it is sent by the controlling client, the server performs a state conversion. If it is not sent by the controlling client, the execution ends;
[0014] After the server changes its state, it sends the current state description to other non-controlling clients, and the non-controlling clients perform state conversion after receiving the state description.
[0015] It further includes the following steps: During the operation of the system, when a new client connects to the server in any state, the server needs to synchronize the current state to the new client. The specific steps are as follows:
[0016] The new client requests state transmission from the server;
[0017] The server sends the current state description to the client;
[0018] The client performs state conversion after receiving the state description.
[0019] The said registration information includes client information, connection information, and whether the control right is obtained.
[0020] The judgment on whether the control right of the current server has been obtained by other clients is specifically that the server traverses all the logged-in and registered client information to check whether there is a client that has obtained the control right.
[0021] The controlling client releases the control right, specifically that after the controlling client receives a query request on whether to release the control right, it provides a visual interaction interface for the user to select whether to release the control right.
[0022] The controlling client changes its state, specifically that the user triggers an event of state conversion through the interaction operation of the client. After the event is triggered, the state of the controlling client changes, including the states of each module and the interface display.
[0023] The state description includes the current visual display state and related parameters of the client.
[0024] After receiving the status description, the server determines whether the status description is sent by the client with control rights. Specifically, the server traverses all the client information of login and registration to determine whether the client with control rights is the client that sent the status description.
[0025] The state transition is specifically that the server or the client compares its current state with the received state, selects the shortest state transition route through the state machine model, performs state transitions in sequence and executes the actions of the server or the client for this state transition, and finally realizes the state transition.
[0026] A state machine model for remote logging collaboration includes states, events, and actions;
[0027] The states include the unlogged state, the logging state, and the re-logging state;
[0028] The events are the triggering conditions for state transitions, triggered by user interaction operations; the events include the event of entering logging, the event of ending logging, the event of starting logging records, the event of stopping logging records, the event of entering re-logging, the event of ending re-logging, the event of starting re-logging, the event of stopping re-logging, the event of starting re-logging records, and the event of stopping re-logging records;
[0029] The actions are the operations that need to be executed when entering and exiting states, including logging data acquisition, logging data recording, re-logging preparation, re-logging data acquisition, and re-logging data recording.
[0030] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0031] The remote logging collaboration process provided by the present invention based on the state machine and control rights ensures the consistency of states between the server and the client, and between clients. The server uniformly manages the control rights and control right switching. Only one client can send a state transition trigger event to the server at the same time, and the remaining clients can only receive the state transition trigger event and logging data from the server, ensuring logging security; it also provides a state machine model for the C / S architecture based on remote logging operations. The states of the server and the client are divided according to the architecture characteristics and business processes, and the triggering events for each state transition and the actions to be executed after the event occurs are designed, enabling arbitrary switching between the states of the server and the client, realizing multi-terminal logging synchronization, supporting state synchronization after network latency, reconnection, and retransmission in a complex network environment, avoiding risks such as transmission delay, packet loss, and network disconnection, ensuring the correctness, robustness of state synchronization between the remote logging server and multiple clients, and state synchronization after network reconnection, and supporting the remote logging operation process. Description of the Drawings
[0032] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required in the embodiments:
[0033] Figure 1 It is a schematic diagram of the remote logging state machine model of the present invention;
[0034] Figure 2 It is a collaborative flow chart of the remote logging control right of the present invention;
[0035] Figure 3 It is a collaborative flow chart of remote logging based on the state machine and control right of the present invention. Specific embodiments
[0036] The following further describes the present invention with reference to the drawings:
[0037] To make the purpose, technical solutions and advantages of the present invention clearer, the following will describe the general collaborative process of remote logging status in combination with the content of the invention and the actual application scenario:
[0038] The purpose of the present invention is to realize remote logging collaboration between the server and multiple clients during the logging operation. To achieve the above purpose, the present invention adopts the following technical solutions: A remote logging collaboration method based on a state machine and control right. The present invention is based on the C / S architecture of remote logging operations. According to the architecture characteristics and business processes, the states of the server and the client are divided, the trigger events for each state transition and the execution actions after the events occur are designed, so that the states between the server and the client can be switched arbitrarily, and a control right collaboration process is designed as a constraint condition for the state transition trigger event, ultimately achieving the purpose of logging collaboration under complex network environment conditions.
[0039] As Figure 1 shown, based on the state machine model of the remote logging operation C / S architecture, the state machine model of the present invention is applicable to both the server and the client, and includes three parts: state, event, and action:
[0040] State: Refers to the state of the server and the client;
[0041] Event: Refers to the trigger condition for the transition between states;
[0042] Action: Refers to the actions that need to be executed after the event occurs, including two types: entering state execution and exiting state execution;
[0043] Further, the state includes an unlogged state, a logged state, and a re-logged state:
[0044] The unlogged state refers to the logging preparation stage, where data collection and processing have not started;
[0045] The logging state refers to connecting logging instruments for data acquisition and processing, including the data acquisition state and the data recording state;
[0046] The re-logging state refers to playing back the original data for data processing, including the preparation state, the data acquisition state, and the data recording state;
[0047] The event refers to the triggering conditions for the conversion between states such as the unlogged state, the logging state, and the re-logging state. It is triggered by user interaction operations and includes the following events:
[0048] Enter logging event: The triggering condition for the user to select to enter logging and for the unlogged state to be converted to the logging data acquisition state;
[0049] End logging event: The triggering condition for the user to select to end logging and for the logging data acquisition state to be converted to the unlogged state;
[0050] Start logging record event: The triggering condition for the user to select to start recording logging data and for the logging data acquisition state to be converted to the logging data recording state;
[0051] Stop logging record event: The triggering condition for the user to select to stop recording logging data and for the logging data recording state to be converted to the logging data acquisition state;
[0052] Enter re-logging event: The triggering condition for the user to select to enter re-logging and for the unlogged state to be converted to the re-logging preparation state;
[0053] End re-logging event: The triggering condition for the user to select to end re-logging and for the re-logging preparation state to be converted to the unlogged state;
[0054] Start re-logging event: The triggering condition for the user to select to start re-logging and for the re-logging preparation state to be converted to the re-logging data acquisition state;
[0055] Stop re-logging event: The triggering condition for the user to select to stop re-logging and for the re-logging data acquisition state to be converted to the re-logging preparation state;
[0056] Start re-logging record event: The triggering condition for the user to select to start recording re-logging data and for the re-logging data acquisition state to be converted to the re-logging data recording state;
[0057] Stop re-logging record event: The triggering condition for the user to select to stop recording re-logging data and for the re-logging data recording state to be converted to the re-logging data acquisition state;
[0058] The action refers to the operations that need to be executed when entering and exiting a state, including the following actions:
[0059] Logging acquisition data status: Enter to execute logging initialization and start data acquisition. The server initializes each module and hardware, acquires and processes data from the hardware, and transmits it to each client. The client initializes each module and the visualization interface, acquires data from the server, and displays it. Exit to execute the end of data acquisition and exit logging. The server ends data acquisition from the hardware, closes the hardware and each module, and the client ends data acquisition from the server and closes each module and the visualization interface.
[0060] Logging record data status: Enter to execute the start of recording. The server records the acquired data into a file, and the client acquires the recorded data from the server, and the visualization interface displays the recording status. Exit to execute the end of recording. The server ends file recording, the client stops acquiring recorded data, and the visualization interface displays a non-recording status.
[0061] Retest well preparation status: Enter to execute retest well initialization. The server initializes each module and loads the retest well data file, and the client initializes each module and the visualization interface. Exit to execute exit from the retest well. The server closes the retest well data file and each module, and the client closes each module and the visualization interface.
[0062] Retest well acquisition data status: Enter to execute the start of data playback. The server reads the file data, processes the data, and transmits it to each client. The client acquires data from the server and displays it. Exit to execute the end of data playback. The server stops processing and transmitting data, and the client stops receiving data and displaying.
[0063] Retest well record data status: Enter to execute the start of recording data. The server records the reprocessed data into a file and sends it to each client. The client acquires the recorded data from the server, and the visualization interface displays the recording status. Exit to execute the end of recording data. The server ends file recording, the client stops acquiring recorded data, and the visualization interface displays a non-recording status.
[0064] As Figure 2 shown, the present invention provides a remote logging control right coordination process. Based on the C / S architecture of remote logging operations, there may be multiple clients connected to the server at the same time. To ensure logging security, only one client can send a status conversion trigger event to the server, and the remaining clients can only receive the status conversion trigger event and logging data from the server. To ensure that only one client has the control right at the same time, the server uniformly manages the control right and the control right switch. The specific steps are as follows:
[0065] (1) Client A connects to the server;
[0066] (2) Determine whether the control right of the current server has been acquired by other clients. If the control right of the server has been acquired, when client A needs the control right, it sends a control right application request to the server. If the control right of the server has not been acquired, the server grants the control right to client A;
[0067] (3) After the server receives the control right application request, it asks the client with the control right whether to release the control right;
[0068] (4) When the client with the control right receives the query request on whether to release the control right, if the client with the control right releases the control right, it grants the control right to the currently connected client A, otherwise it ends;
[0069] Furthermore, the connection of client A to the server in step (1) means that client A logs in to the server through a network connection and registers the information of client A with the server, including client information, connection information, whether the control right is obtained, etc.;
[0070] The determination in step (2) on whether the control right of the current server has been acquired by other clients means that the server traverses all the logged-in and registered client information to check whether any client has acquired the control right; the granting of the control right to client A means that the server sends a control right granting message to client A and records the information that client A has acquired the control right; the situation where client A needs the control right means that when client A does not automatically obtain the control right after logging in to the server and needs to actively obtain the control right, it will send a control right application request to the server;
[0071] The inquiry in step (3) on whether the client with the control right releases the control right means that when the server receives the control right application request, it traverses all the logged-in and registered client information, finds the client that currently has the control right, and sends a query request on whether to release the control right to the client with the control right;
[0072] The release of the control right by the client with the control right in step (4) means that after the client with the control right receives the query request on whether to release the control right, it provides a visual interaction interface for the user to select whether to release the control right; the granting of the control right to client A means that the server sends a control right granting message to client A and records the information that client A has acquired the control right and the information that the client with the control right has lost the control right.
[0073] To ensure the consistency of the states between the server and the clients, and between the clients, a remote logging collaboration process is proposed based on the above state machine model and the remote logging control right collaboration process, as Figure 3 shown. For the collaboration between multiple clients and the server, the specific steps are as follows:
[0074] The initial state of the system is that a controlling client and a non - controlling client are connected to the server;
[0075] (1) The state of the controlling client changes, and the current state description is sent to the server;
[0076] (2) After receiving the state description, the server determines whether the state description is sent by the controlling client. If it is sent by the controlling client, the server performs a state transition; otherwise, the execution ends;
[0077] (3) After the server's state changes, the current state description is sent to other non - controlling clients;
[0078] (4) After receiving the state description, the non - controlling client performs a state transition.
[0079] Furthermore, the change of the state of the controlling client described in step (1) means that the user triggers an event of state transition through the interaction operation of the client. After the triggering event, the state of the controlling client changes, including the states of each module and the interface display, etc. The sending of the current state description to the server means that the current visual display state and related parameters of the client are sent to the server, and at the same time, the server needs to determine whether the description is sent by the controlling client;
[0080] The determination of whether the state description is sent by the controlling client described in step (2) means that the server traverses all the logged - in and registered client information to determine whether the controlling client is the current client. The state transition performed by the server means that the server compares its current state with the received state, and selects the shortest state transition route through the state machine model in Figure 1 to perform state transitions in sequence and execute the entry action and exit action of the server in this state, finally achieving the state transition;
[0081] The sending of the current state description to other non - controlling clients described in step (3) means that the server traverses all the lists of non - controlling clients that are logged in and registered, and sends the current visual display state and related parameters to these clients;
[0082] The non - controlling client's performance of a state transition after receiving the state description described in step (4) means that the client compares its current state with the received state, and selects the shortest state transition route through the state machine model in Figure 1 to perform state transitions in sequence and execute the entry action and exit action of the client in this state, finally achieving the state transition.
[0083] During the operation of the system, when a new client connects to the server in any state, the server needs to synchronize the current state to the new client. The specific steps are as follows:
[0084] (1) The client requests state transmission from the server;
[0085] (2) The server sends the current state description to the client;
[0086] (3) After receiving the state description, the client performs state conversion;
[0087] Furthermore, the request for state transmission in step (1) refers to the client sending a request for state transmission message to the server;
[0088] The sending of the current state description to the server in step (2) refers to sending the current visual display state and related parameters of the server to the requesting client;
[0089] The performing of state conversion after receiving the state description in step (3) refers to the client comparing its own current non-logging state with the received state, and Figure 1 selecting a shortest state conversion route through the state machine model in
[0090] and sequentially performing state conversion and executing the entry action and exit action of the client in this state, finally achieving state conversion.
[0091] Example:
[0092] (1) Client A logs in and registers with the server, queries the current state of the server as the non-logging state, and no state conversion is required;
[0093] (2) There is no other client connected to the server currently, and the server grants control to Client A and records information such as the connection information of Client A and the possession of control;
[0094] (3) Client A enters the logging acquisition state through interface interaction operations, initializes each module and the visual interface, prepares to collect data from the server and display it, and sends the logging acquisition state and related parameters of this state to the server;
[0095] (4) After the server receives the status description from Client A, it traverses the registered client list and finds that Client A has control. The server enters the logging acquisition state from the untested state, and enters the state to execute the server initialization operation. It collects data from the hardware, processes it, and then transmits it to each registered client;
[0096] (5) Client B logs in and registers with the server, queries the current status of the server as the logging acquisition state, and enters the state to execute the operation of initializing each module and the visualization interface, collects data from the server, and displays it;
[0097] (6) Client A enters the logging record state from the logging acquisition state through interface interaction operations, and sends the logging record state and related parameters of this state to the server;
[0098] (7) After the server receives the status description from Client A, it traverses the registered client list and finds that Client A has control. The server enters the logging record state from the logging acquisition state, and enters the state to execute the operation of starting to record the collected data into a file;
[0099] (8) After the server status changes, it sends the logging record state and related parameters of this state to Client B without control;
[0100] (9) After Client B receives the logging record state, it converts from the logging acquisition state to the logging record state.
[0101] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art can still modify or equivalently replace the specific implementation manners of the present invention. Any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention are within the scope of the claims of the present invention pending approval.
Claims
1. A remote logging collaboration method based on a state machine and control rights, characterized in that It includes the following steps: Remote logging control right process: Client A connects to the server and registers the information of Client A with the server; Judge whether the control right of the current server has been obtained by other clients. If the control right of the server has been obtained, when Client A needs the control right, it sends a control right application request to the server. If the control right of the server has not been obtained, the server grants the control right to Client A and records the information that Client A obtains the control right; After receiving the control right application request, the server asks the client with the control right whether to release the control right; When the client with the control right receives the query request of whether to release the control right, if the client with the control right releases the control right, the server grants the control right to Client A and records the information that Client A obtains the control right and the information that the client with the control right loses the control right. If the client with the control right does not release the control right, the process ends; Remote logging collaboration process based on the remote logging control right process: The client with the control right changes its state and sends the current state description to the server; After receiving the state description, the server judges whether the state description is sent by the client with the control right. If it is sent by the client with the control right, the server performs state conversion. If it is not sent by the client with the control right, the execution ends; After the server state changes, it sends the current state description to other clients without the control right. After receiving the state description, the clients without the control right perform state conversion.
2. The remote logging collaboration method based on a state machine and control rights according to claim 1, wherein, It also includes the following steps: When the system is running, when a new client connects to the server in any state, the server needs to synchronize the current state to the new client. The specific steps are as follows: The new client requests state transmission from the server; The server sends the current state description to the client; After receiving the state description, the client performs state conversion.
3. A remote logging collaboration method based on a state machine and control rights according to claim 1, characterized in that The registration information includes client information, connection information, and whether the control right is obtained.
4. A remote logging collaboration method based on a state machine and control rights according to claim 1, characterized in that The judgment of whether the control right of the current server has been obtained by other clients is specifically that the server traverses all the logged-in and registered client information to check whether there is a client that has obtained the control right.
5. A remote logging collaboration method based on a state machine and control rights according to claim 1, characterized in that The release of the control right by the client with the control right is specifically that after the client with the control right receives the query request of whether to release the control right, it provides a visual interaction interface for the user to select whether to release the control right.
6. The remote logging collaboration method based on a state machine and control right according to claim 1, characterized in that The change of the state of the client with the control right is specifically that the user triggers an event for state conversion through the interaction operation of the client. After the event is triggered, the state of the client with the control right changes, including the states of each module and the interface display.
7. A remote logging collaboration method based on a state machine and control rights according to any one of claims 1 or 2, characterized in that The state description includes the current visual display state and related parameters of the client.
8. A remote logging collaboration method based on a state machine and control rights according to claim 1, characterized in that, After receiving the state description, the judgment of whether the state description is sent by the client with the control right by the server is specifically that the server traverses all the logged-in and registered client information to judge whether the client with the control right is the client that sends the state description.
9. A remote logging collaboration method based on a state machine and control rights according to any one of claims 1 or 2, characterized in that The state transition specifically refers to the server or the client comparing its current state with the received state, selecting the shortest state transition route through the state machine model, performing state transitions in sequence, and executing the actions for the current state transition of the server or the client, ultimately achieving the state transition.
10. A state machine model for remote logging collaboration, characterized in that, It includes states, events, and actions; The states include the unlogged state, the logged state, and the re-logged state; The events are the triggering conditions for state transitions, triggered by user interaction operations; the events include the enter logging event, the end logging event, the start logging record event, the stop logging record event, the enter re-logging event, the end re-logging event, the start re-logging event, the stop re-logging event, the start re-logging record event, and the stop re-logging record event; The actions are the operations to be performed when entering and exiting states, including logging data acquisition, logging data recording, re-logging preparation, re-logging data acquisition, and re-logging data recording.