Mobile charging robot charging service implementation method and system based on state machine
Through the state machine-based mobile charging robot charging service implementation method, the problems of waste of resources and complex business processes of traditional charging piles are solved, the charging process is simplified and stable, and the charging process is ensured, and the safety of the charging process and the convenience of user operations are ensured. .
Patent Information
- Application Number
- CN202410907015.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
AI Technical Summary
In the construction and operation of traditional charging piles, there are problems such as waste of resources, complex business processes, insufficient handling of abnormal situations, insufficient user operation guidance, and insufficient data feedback mechanism.
The charging service implementation method of the state machine-based mobile charging robot is adopted to simplify the process, reduce complexity, and realize real-time data feedback and user operation guidance through finite state management and event-driven control.
It reduces the implementation complexity, improves the stability and reliability of the system, ensures the safety of the charging process and the convenience of user operations, comprehensively considers various abnormal situations, and simplifies troubleshooting and maintenance.
Smart Images

Figure CN118876789A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of robot charging control, and in particular relates to a method and system for realizing charging service of a mobile charging robot based on a state machine. Background Art
[0002] As the infrastructure for the development of new energy vehicles, charging piles have been widely promoted and applied in recent years. However, with the continuous expansion of the new energy vehicle market, the construction and operation of charging piles have become increasingly prominent. Among them, the phenomenon of "hard to find a pile" and "zombie piles" have become two major problems in the current charging pile market.
[0003] Traditional charging piles are fixed. Once a parking space is occupied, it cannot be effectively used for the required parking space. Resources are wasted and the utilization rate cannot be fully guaranteed. The charging business process of traditional charging piles is complicated and is not conducive to the judgment of various situations.
[0004] like Figure 1 The traditional charging pile charging service shown includes: startup phase: the device side and the platform side are started separately, the device side performs self-test and detects the basic status of the charging pile, the platform side records the event when the user initiates a charging request, and communicates with the device side for confirmation; charging preparation phase: after the device side detects that the charging gun is connected, it will detect various electrical parameters and start the charging preparation service, and the platform side will issue a start charging instruction; charging start phase: after receiving the start charging instruction, the device side will perform electrical parameter detection again, and then start charging. After receiving the charging start event, the platform side records the charging start service; charging process management: the device side will detect electrical parameters at regular intervals and report the charging status to the platform side, and the platform side will record and manage according to the reported charging status; charging completion or interruption: when the charging is completed or a fault occurs, the device side will stop charging and report the charging end event to the platform side, the platform side records the charging end, and decides whether to issue a continue charging instruction according to the situation; fault handling and recovery: when the device side detects a fault, it will stop charging and handle the fault. After receiving the fault report, the platform side records the fault and starts the corresponding fault handling service.
[0005] It can be seen that the traditional process has the following shortcomings: High complexity: It contains many conditional judgments and branches, which will increase the difficulty of troubleshooting and maintenance in actual operation; Abnormal situation handling is not comprehensive enough: Although there are handling of faults and abnormal situations in the process, these handling methods are relatively simple and do not cover all possible abnormal situations. For example, the handling of network communication interruption is not clearly listed. Insufficient user operation guidance: The traditional process is not conducive to the judgment of various situations, and rarely involves user operations and prompts. Especially in abnormal situations, users may not know what measures to take, which may lead to users encountering problems during charging. The inability to deal with them in a timely and effective manner; The data feedback mechanism is not flexible enough: The device side reports the status regularly in the process, but the real-time feedback mechanism for emergencies is not perfect, which may cause the platform side to be unable to obtain key status information in time, thereby affecting decision-making. Summary of the invention
[0006] Purpose of the invention: The purpose of the present invention is to address the deficiencies in the prior art and to provide a method and system for implementing charging services for a mobile charging robot based on a state machine. By managing the finite state of the mobile charging robot, the complexity of implementation is reduced, errors are less likely to occur, and maintenance is easier.
[0007] Technical solution: The method for implementing the charging service of a mobile charging robot based on a state machine of the present invention comprises the following steps: Initialization state: After the robot is initialized, it starts logging into the cloud backend; Logged in state: After receiving the login authentication response message returned by the cloud backend, the robot enters the logged in state; Synchronized billing model status: After successful login, the robot requests the cloud backend to synchronize the billing model. If the model does not match, the request is repeated until the synchronization is successful and the billing model status is synchronized. Non-charging / idle state: After the bill model is successfully synchronized, the robot sends a heartbeat packet to the cloud platform at regular intervals. After receiving the heartbeat packet response message returned by the cloud backend, it establishes a long connection with the cloud backend and enters the non-charging / idle state. It configures the charging flow state and the migration conditions between the state flows. When the migration conditions are met, the robot executes the action to make the robot enter the charging flow state from the non-charging / idle state. The charging flow state includes the charger inserted waiting for charging state, the charging state, and the charging completed waiting for the gun to be drawn state. The migration conditions include: The conditions for switching from the non-charging / idle state to the charger plugged in waiting state are as follows: when the user initiates a charging request to the cloud platform, the moving state is triggered, and after moving into position, the robot enters the waiting for the charger plugged in state; The migration condition from the charger plugged in waiting state to the charging state is as follows: after the waiting state is completed, the user's charger plugged in state is detected. If the user has plugged in the charger, the charging state is entered, billing starts, and real-time messages are reported to the cloud platform; The transition condition from the charging state to the charging completed waiting for the gun to be drawn state is: when the user sends a request to end charging to the cloud backend, the robot ends charging and enters the charging completed waiting for the gun to be drawn state; The transition condition from the charging completion waiting for the gun to be drawn state to the non-charging / idle state is as follows: detecting the gun drawing state, if it is confirmed that the user has drawn the gun, triggering the moving state, and after the waiting moving state is completed, entering the non-charging / idle state.
[0008] To further improve the above technical solution, the triggering of the mobile state includes: when receiving an instruction to call the robot to move or return to the warehouse, it enters the mobile state from the non-charging / idle state and waits for the call instruction; when the robot and the line are in place or have returned to the warehouse, it enters the non-charging / idle state from the mobile state.
[0009] Furthermore, the movement state includes a gun-raising and returning state machine, and the gun-raising and returning state machine includes: initial position, robot moving, robot reaching the stake position and gun retracting, gun moving, and gun out, and the gun-raising and returning state machine is circulated by configuring the gun-raising process and the gun-returning process; When the user initiates a charging request to the cloud platform, the gun-lifting process in the mobile state is triggered, and the gun-lifting process includes: the robot enters the robot moving state from the initial position state according to the gun-lifting instruction; when the robot reaches the target position, the robot enters the robot reaching the pile position gun-stowed state from the robot moving state; the robot issues a gun-out instruction, enters the gun-moving state from the robot reaching the pile position gun-stowed state; the robot deploys the charging gun line, and after the gun is successfully out, the robot enters the gun-moving state from the gun-moving state to the gun-out state, prompting the user to plug in the gun, and the robot enters the waiting state for the gun to be plugged in; When the user sends a request to end charging to the cloud background, the robot prompts the user to draw the gun. After confirming that the user has drawn the gun, the gun return process in the moving state is triggered. The gun return process includes: the robot triggers the gun collection indication, and enters the gun moving state from the gun out state. The robot begins to retract the charging gun line. After completing the gun collection, the robot enters the robot reaches the pile position and the gun is put away state from the gun moving state, triggering the return indication, and enters the robot moving state from the robot reaches the pile position and the gun is put away state. The robot starts to move. When it reaches the initial position, it indicates a successful return, and enters the initial position state from the robot moving state.
[0010] Furthermore, when in any gun-raising state in the gun-returning process, if the gun-raising process is triggered, the gun-returning process will be interrupted and changed to the gun-raising process; when in the gun-raising process and before entering the gun-out state, if the gun-returning process is triggered, the gun-raising process will be interrupted and changed to the gun-returning process.
[0011] Further, when the gun is out or in the moving state in the gun return process, if the gun lifting process is triggered, the following judgment is made: if the target position does not match the current position, the robot will retract the charging gun line, and after completing the gun collection, it will move to the target position, and the robot entering the gun lifting process will reach the pile position gun retracted state; if the target position matches the current position, the robot will put down the charging gun line, and after successfully taking out the gun, it will enter the gun out state in the gun lifting process; when the robot reaches the pile position gun retracted state in the gun return process, if the gun lifting process is triggered, the following judgment is made: if the target position does not match the current position, the robot will move to the target position, and after reaching the target position, the robot entering the gun lifting process will reach the pile position gun retracted state; if the target position matches the current position, the robot will put down the charging gun line, and after successfully taking out the gun, it will enter the gun out state in the gun lifting process; when the robot is moving or in the initial position state in the gun return process, if the gun lifting process is triggered, the robot will move to the target position, and after reaching the target position, the robot entering the gun lifting process will reach the pile position gun retracted state.
[0012] Furthermore, when in the state of charging completion and waiting to draw the gun, the robot prompts the user to draw the gun. If the user does not draw the gun for a long time, the robot will remind the user at intervals until the user draws the gun. If it is confirmed that the user has drawn the gun, the waiting time will begin. If no next charging request is initiated during the waiting time, the gun return process in the moving state will be triggered, and the robot will trigger the gun collection instruction. When in the gun-lifting process, the gun has been taken out, the robot prompts the user to plug in the gun. If the user has not plugged in the gun for a long time, the robot will remind the user. If the user still does not plug in the gun after the reminder, the waiting time will begin. After the waiting time, the gun return process will be initiated.
[0013] Furthermore, in the non-charging / idle state, the robot sends heartbeat packets at regular intervals and makes the following judgments: If a heartbeat packet response message is received from the cloud platform, a long connection is maintained with the cloud platform; If no heartbeat packet response message is received from the cloud platform, the connection is judged to have timed out and the system switches to the initialization state. If the robot detects a fault, it enters an abnormal state and requires human intervention to repair it.
[0014] Furthermore, the user sends a request to the cloud backend to end charging, including when the balance is exhausted, the battery is fully charged, the user pulls out the gun, or the user stops charging.
[0015] The system for implementing the above-mentioned state machine-based mobile charging robot charging service implementation method includes: a track system that enables the robot to move between parking spaces; The state machine is used to manage the operation status of the robot, including normal status and abnormal status. The normal status includes initialization, logged in, synchronized bill model, non-charging / idle, charger plugged in and waiting for charging, charging, charging completed and waiting for gun to be drawn, and mobile status. The mobile status includes the following sub-states: initial position, robot moving, robot reaches the stake position and gun is put away, gun is moving, and gun is out. The cloud platform establishes a persistent connection with the robot through heartbeat packets to monitor the robot's status and perform maintenance. Event-driven control systems process events or messages to trigger state transitions; The robot, according to the control of the state machine, performs the following actions: moves between the initial position and the target position, deploys the charging gun line after moving to the target position, charges, and retracts the charging gun line after charging is completed; The state machine receives and processes messages from users and the cloud platform through an event-driven control system, and controls the robot's actions to switch between states.
[0016] Further, the event-driven control system triggers state transitions based on events including user requests, state updates, and error detections.
[0017] Beneficial effect: Compared with the prior art, the advantages of the present invention are: the present invention manages the mobile charging robot based on the state machine, simplifies the complex process into multiple clear states, reduces the complexity of implementation, each state has clear entry conditions and migration conditions, is event (or message) driven, is easy to understand, the logic is clearer, all events are combined with states, the situation is considered more comprehensively, is less prone to errors, and is easy to maintain and troubleshoot.
[0018] The robot establishes a long connection with the cloud platform and maintains the connection status through heartbeat packets, which can realize real-time data feedback. At the same time, in the charging state, the robot will report messages to the cloud platform in real time to ensure data stability. The state machine can more conveniently implement safety measures, including sending heartbeat packets at regular intervals in the non-charging / idle state. If no response message is received, it is judged that the connection has timed out and switches to the initialization state. When a fault is detected, it enters the abnormal state to ensure the safety of the charging process.
[0019] User prompts and operation instructions have been added to the charging flow status, including: in the gun-lifting process, after the robot reaches the target position, it will prompt the user to insert the gun; when the charging is completed and the robot is waiting to draw the gun, it will prompt the user to draw the gun, and will provide interval reminders when the user has not operated for a long time, thereby improving the safety of operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is the existing charging pile charging business flow chart; Figure 2 It is a state flow diagram of a method for implementing a mobile charging robot charging service based on a state machine of the present invention; Figure 3 It is a state flow diagram of the gun-returning state machine in the present invention. DETAILED DESCRIPTION
[0021] The technical solution of the present invention is described in detail below with reference to the accompanying drawings, but the protection scope of the present invention is not limited to the embodiments.
[0022] Example 1: The present invention uses an event (or message) driven method to complete the entire charging business process of the mobile charging robot. The charging robot can move flexibly and freely between parking spaces in the parking lot through tracks, solving the problem of difficulty in finding charging piles in fixed parking spaces. The robot maintains a long connection with the cloud platform, reports the status in real time and handles the alarm, solving the maintenance problem.
[0023] The entire system is divided into normal state and abnormal state. The normal state includes: initialization, logged in, synchronized bill model, non-charging / idle, charging, and mobile state. The mobile state includes the following sub-states: initial position, robot moving, robot reaches the pile position and gun is put away, gun is moving, and gun is out; the abnormal state refers to when the robot has an unrecoverable fault in any state, and manual intervention is required to repair it.
[0024] like Figure 2 As shown, the user operates on the client to initiate charging, which is forwarded to the robot through the cloud platform. The cloud platform will decide whether the user can initiate charging based on the status of the robot. The state machine receives and processes messages from the user and the cloud platform through an event-driven control system, and controls the robot's actions to switch between states.
[0025] Including: After the robot is initialized, it will start logging in to the cloud background. If it receives a login authentication response message, it is considered that the login is successful. After the login is successful, the robot requests to synchronize the billing model with the cloud background. First, the local billing model is reported. If there is a mismatch, the cloud background will feedback failure. The robot actively sends a request to synchronize the billing model to the cloud background repeatedly. If it receives a billing model verification request response or a billing model request response message, it is considered that the billing model has been synchronized and enters the synchronized billing model state. After the billing model is synchronized, after receiving the heartbeat packet response message, the robot enters the non-charging / idle state. When the user scans the QR code to initiate charging through the cloud platform, the cloud platform sends the operation platform remote control start message to the robot. After receiving it, the robot enters the charging start waiting for the gun to be plugged in state, and the gun lifting process is triggered locally. After the gun lifting process is completed, the robot's built-in charging module will detect whether the user has plugged in the gun. Once the user plugs in the gun, it will enter the charging state, start billing through the meter or current, and continuously report real-time information to the cloud background. If the user does not plug in the gun for a long time, it will enter the standby / non-charging / idle state. When the balance is exhausted, full, the user unplugs the gun, or the user stops charging, that is, the APP sends a stop charging instruction to the cloud background, the cloud background will send a charging end or remote shutdown message to the robot. When the robot receives the stop charging instruction, it will end charging, report the bill, and switch the robot to the charging completion waiting for unplugging state, while paying attention to whether the user unplugs the gun. When the user unplugs the gun, it enters the non-charging / idle state. In order to avoid frequent movement of the robot, wait for 2 minutes. If there is no next charge, start the gun return process.
[0026] Due to network reasons, the heartbeat information exchange between the robot and the cloud background may time out, and the robot switches from any state except charging and abnormal state to the initialization state. In addition, the robot determines whether a fault occurs through the return error code or timeout of no response of each hardware module executing the instruction. For example: if charging is initiated multiple times, but the charging module does not respond, it is considered that the charging module has a fault.
[0027] Figure 3 It is the gun-returning state machine, and is a sub-state machine of the robot's moving state.
[0028] Normal situation: When the user initiates a charging request to the cloud platform, the robot enters the charger plugged in waiting for gun insertion state and triggers the gun lifting process in the moving state. The gun lifting process includes: the robot enters the robot moving state from the initial position state according to the gun lifting instruction. When the robot reaches the target position, the robot enters the robot reaching the stake position gun stowed state from the robot moving state. The robot issues a gun release instruction and enters the gun moving state from the robot reaching the stake position gun stowed state. The robot deploys the charging gun line and after successfully releasing the gun, it changes from the gun moving state to the gun released state, prompting the user to insert the gun. When the user sends a request to end charging to the cloud background, the robot prompts the user to draw the gun. After confirming that the user has drawn the gun, the gun return process in the moving state is triggered. The gun return process includes: the robot triggers the gun collection instruction, and enters the gun moving state from the gun out state. The robot begins to retract the charging gun line. After completing the gun collection, the robot enters the robot reaches the pile position and the gun is put away state from the gun moving state, triggering the return instruction, and the robot enters the robot moving state from the robot reaches the pile position and the gun is put away state. The robot starts to move. When it reaches the initial position, it indicates a successful return, and the robot enters the initial position state from the moving state.
[0029] When the user initiates a request to end charging, the robot voice prompts the user to unload the gun. When the gun is unloaded, in order to avoid frequent movement of the robot, wait for 2 minutes. If there is no next charge, start the gun return process. The robot starts to trigger the gun collection instruction and the robot starts to retract the charging gun line. After the line is retracted in place, the return instruction is triggered and the robot starts to move. When it reaches the starting position, it indicates that it has successfully returned.
[0030] Movement has a direction. The process of lifting the gun is a positive movement, and the process of returning the gun is a negative movement. The instructions for lifting the gun must include the target position.
[0031] Special situation: When the gun is out or in the moving state in the gun return process, if the gun pick-up process is triggered, the following judgment is made: If the target position does not match the current position, the robot will retract the charging gun line, and after completing the gun collection, it will move to the target position, and the robot in the gun pick-up process will reach the gun retracted state at the pile position; if the target position matches the current position, the robot will put down the charging gun line, and after successfully taking out the gun, it will enter the gun pick-up process. When the robot reaches the gun-stowed state in the gun-returning process, if the gun-raising process is triggered, the following judgment is made: if the target position does not match the current position, the robot moves to the target position, and after reaching the target position, the robot in the gun-raising process reaches the gun-stowed state in the gun-raising process; if the target position matches the current position, the robot puts down the charging gun line, and after successfully taking out the gun, it enters the gun-raising process and the gun-out state; When the robot is in the gun return process and is moving or in the initial position state, if the gun lift process is triggered, the robot moves to the target position. After reaching the target position, the robot in the gun lift process reaches the pile position gun retracted state.
[0032] During the gun picking process, if the gun has not yet entered the gun out state, the gun return process is triggered and the gun return process is immediately entered. In other cases, the gun is picked up normally unless there is an abnormality in the gun picking process itself.
[0033] In the gun-out state, when the robot voice prompts the user to plug in the gun, if the user does not plug in the gun for a long time, it will repeat the reminder three times, with an interval of 15 seconds each time. If the user still does not plug in the gun after three reminders, it will wait for 2 minutes before starting the gun return process. In the gun-out state, the robot prompts the user to draw the gun. If the user does not draw the gun for a long time, it will continue to remind the user to draw the gun at an interval of 15 seconds. The gun-drawing process instruction is valid in other states except that the gun is out and matches the target position. The gun return process instruction is valid in other states except the initial position state.
[0034] Through the design and configuration of the above state machine, the mobile charging robot can move flexibly and efficiently between parking spaces in the parking lot, complete charging tasks and solve maintenance problems. Reduce implementation complexity: through finite state management, reduce errors and facilitate maintenance; event-driven: in line with human habits and easy to understand; comprehensive consideration: all events and states are combined to consider various situations to ensure system stability and reliability.
Claims
1. A method for implementing charging service of a mobile charging robot based on a state machine, characterized in that: The following steps are involved: Initialization state: After the robot is initialized, it starts logging into the cloud backend; Logged in state: After receiving the login authentication response message returned by the cloud backend, the robot enters the logged in state; Synchronized billing model status: After successful login, the robot requests the cloud backend to synchronize the billing model. If the model does not match, the request is repeated until the synchronization is successful and the billing model status is synchronized. Non-charging / idle state: After the bill model is successfully synchronized, the robot sends a heartbeat packet to the cloud platform at regular intervals. After receiving the heartbeat packet response message returned by the cloud backend, it establishes a long connection with the cloud backend and enters the non-charging / idle state. It configures the charging flow state and the migration conditions between the state flows. When the migration conditions are met, the robot executes the action to make the robot enter the charging flow state from the non-charging / idle state. The charging flow state includes the charger inserted waiting for charging state, the charging state, and the charging completed waiting for the gun to be drawn state. The migration conditions include: The conditions for switching from the non-charging / idle state to the charger plugged in waiting state are as follows: when the user initiates a charging request to the cloud platform, the moving state is triggered, and after moving into position, the robot enters the waiting for the charger plugged in state; The migration condition from the charger plugged in waiting state to the charging state is as follows: after the waiting state is completed, the user's charger plugged in state is detected. If the user has plugged in the charger, the charging state is entered, billing starts, and real-time messages are reported to the cloud platform; The transition condition from the charging state to the charging completed waiting for the gun to be drawn state is: when the user sends a request to end charging to the cloud backend, the robot ends charging and enters the charging completed waiting for the gun to be drawn state; The transition condition from the charging completion waiting for the gun to be drawn state to the non-charging / idle state is as follows: detecting the gun drawing state, if it is confirmed that the user has drawn the gun, triggering the moving state, and after the waiting moving state is completed, entering the non-charging / idle state.
2. The method for implementing the charging service of a mobile charging robot based on a state machine according to claim 1, characterized in that: The triggering movement state includes: when receiving a command to call the robot to move or return to the warehouse, entering the movement state from the non-charging / idle state and waiting for the call instruction; when the robot and the line are in place or have returned to the warehouse, entering the non-charging / idle state from the movement state.
3. The method for implementing the charging service of a mobile charging robot based on a state machine according to claim 1 or 2, characterized in that: The movement state includes a gun-lifting state machine, which includes: initial position, robot moving, robot reaching the stake position and gun retracting, gun moving, gun out, and the flow of the gun-lifting state machine is performed by configuring the gun-lifting process and the gun-returning process; When the user initiates a charging request to the cloud platform, and triggers the gun-lifting process in the mobile state, the gun-lifting process includes: the robot enters the robot moving state from the initial position state according to the gun-lifting instruction; when the robot reaches the target position, the robot enters the robot reaching the stake position gun-stowed state from the robot moving state; the robot issues a gun-out instruction, enters the gun-moving state from the robot reaching the stake position gun-stowed state; the robot deploys the charging gun line, and after successfully pulling out the gun, the robot enters the gun-moving state from the gun-moving state to the gun-out state, prompting the user to plug in the gun, and the robot enters the waiting state for the gun to be plugged in; When the user sends a request to end charging to the cloud background, the robot prompts the user to draw the gun. After confirming that the user has drawn the gun, the gun return process in the moving state is triggered. The gun return process includes: the robot triggers the gun collection indication, and enters the gun moving state from the gun out state. The robot begins to retract the charging gun line. After completing the gun collection, the robot enters the robot reaches the pile position and the gun is put away state from the gun moving state, triggering the return indication, and enters the robot moving state from the robot reaches the pile position and the gun is put away state. The robot starts to move. When it reaches the initial position, it indicates a successful return, and enters the initial position state from the robot moving state.
4. The method for implementing the charging service of a mobile charging robot based on a state machine according to claim 3 is characterized in that: When in any gun-returning state in the gun-returning process, if the gun-returning process is triggered, the gun-returning process will be interrupted and replaced with the gun-returning process; During the gun-lifting process and before the gun is out of the gun state, if the gun-returning process is triggered, the gun-lifting process will be interrupted and replaced with the gun-returning process.
5. The method for implementing the charging service of a mobile charging robot based on a state machine according to claim 4, characterized in that: When the gun is in the state of being out or moving in the gun return process, if the gun pick-up process is triggered, the following judgment is made: if the target position does not match the current position, the robot will retract the charging gun line, and after completing the gun collection, it will move to the target position, and the robot in the gun pick-up process will reach the gun retracted state; if the target position matches the current position, the robot will put down the charging gun line, and after successfully taking out the gun, it will enter the gun out state in the gun pick-up process; When the robot reaches the gun-stowed state in the gun-returning process, if the gun-raising process is triggered, the following judgment is made: if the target position does not match the current position, the robot moves to the target position, and after reaching the target position, the robot in the gun-raising process reaches the gun-stowed state in the gun-raising process; if the target position matches the current position, the robot puts down the charging gun line, and after successfully taking out the gun, the robot enters the gun-raising process and the gun is out of the state; When the robot is in the moving or initial position state in the gun return process, if the gun raising process is triggered, the robot moves to the target position. After reaching the target position, the robot entering the gun raising process reaches the pile position gun retracted state.
6. The method for implementing the charging service of a mobile charging robot based on a state machine according to claim 3, characterized in that: When the robot is in the state of charging and waiting to draw the gun, it will remind the user to draw the gun. If the user does not draw the gun for a long time, the robot will remind the user at intervals until the user draws the gun. If it is confirmed that the user has drawn the gun, it will enter the waiting time. If the next charging request is not initiated during the waiting time, the gun return process in the mobile state will be triggered, and the robot will trigger the gun collection instruction. When the gun is in the gun picking process and has been taken out, the robot prompts the user to plug in the gun. If the user has not plugged in the gun for a long time, the robot will remind the user. If the user still does not plug in the gun after the reminder, the waiting time will begin, and the gun return process will be started after the waiting time.
7. The method for implementing the charging service of a mobile charging robot based on a state machine according to claim 1, characterized in that: When not charging or in idle state, the robot sends heartbeat packets periodically and makes the following judgments: If a heartbeat packet response message is received from the cloud platform, a long connection is maintained with the cloud platform; If no heartbeat packet response message is received from the cloud platform, the connection is judged to have timed out and the system switches to the initialization state. If the robot detects a fault, it enters an abnormal state and requires human intervention to repair it.
8. The method for implementing the charging service of a mobile charging robot based on a state machine according to claim 1, characterized in that: The user sends a request to the cloud backend to end charging, including when the balance is exhausted, full, the user pulls out the gun, or the user stops charging.
9. A system for implementing a method for implementing a mobile charging robot charging service based on a state machine, characterized in that: include: a track system that enables the robot to move between parking spaces; The state machine is used to manage the operation status of the robot, including normal status and abnormal status. The normal status includes initialization, logged in, synchronized bill model, non-charging / idle, charger plugged in and waiting for charging, charging, charging completed and waiting for gun to be drawn, and mobile status. The mobile status includes the following sub-states: initial position, robot moving, robot reaches the stake position and gun is put away, gun is moving, and gun is out. The cloud platform establishes a persistent connection with the robot through heartbeat packets to monitor the robot's status and perform maintenance. Event-driven control systems process events or messages to trigger state transitions; The robot, according to the control of the state machine, performs the following actions: moves between the initial position and the target position, deploys the charging gun line after moving to the target position, charges, and retracts the charging gun line after charging is completed; The state machine receives and processes messages from users and the cloud platform through an event-driven control system, and controls the robot's actions to switch between states.
10. The system according to claim 9, characterized in that The event-driven control system triggers state transitions based on events including user requests, state updates, and error detections.
