Vehicle remote control method and device based on Netty, electronic equipment and storage medium

Through the Netty-based vehicle remote control method, the Netty service cluster and Kafka cluster are used to solve the problems of delay, security, scalability and compatibility in remote vehicle control technology, and efficient and reliable remote vehicle control and data processing are achieved. , improves user experience and system stability.

CN119011638APending Publication Date: 2024-11-22CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411129233.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The existing remote vehicle control technology has problems such as high operation delay, unsafe data transmission, poor scalability and poor compatibility, which affects user experience and system stability.

Method used

Using Netty-based vehicle remote control method, the client's connection establishment request is processed through the Netty service cluster, the connection status detection and the preset service processing of remote vehicle control instructions are performed, and the message transmission is used to achieve efficient and reliable network communication and Data processing.

Benefits of technology

It improves the control efficiency, data reliability, scalability and compatibility of vehicle remote control, and provides better user experience and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011638A_ABST
    Figure CN119011638A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle remote control method and device based on Netty, electronic equipment and a storage medium, and the method comprises the steps: obtaining a connection building request of a client, building the current communication connection between the client and a Netty service cluster according to the connection building request, carrying out the connection state detection of a target terminal according to preset detection time, obtaining a state detection result, and transmitting the state detection result to a server. The target terminal comprises at least one of a client and a vehicle terminal, subscribing to a service message of the Kafka cluster, reading a remote vehicle control instruction corresponding to the client, sending the remote vehicle control instruction to the Kafka cluster through the client, performing preset service processing on the remote vehicle control instruction according to a state detection result, and forwarding the remote vehicle control instruction to the vehicle terminal. The vehicle is remotely controlled; according to the invention, the connection establishment request of the client is processed through the Netty service cluster, and the received remote vehicle control instruction is subjected to preset service processing and forwarding through the Netty service cluster, so that the control efficiency, data reliability, expandability and compatibility of vehicle remote control are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of remote vehicle control technology, and in particular to a vehicle remote control method, device, electronic device and storage medium based on Netty. Background Art

[0002] With the rapid development of smart cars and Internet of Things technologies, users have a growing demand for remote vehicle control. Especially in the remote vehicle control scenario, however, in the existing vehicle control technology architecture: users log in to the system through the client, and the system verifies the user's identity and authority; users send remote control commands through the client, and the remote vehicle control system receives and verifies the validity of the commands, and then sends them to the vehicle for execution; the vehicle sends its own status information to the server, and the server displays the information to the user, allowing the user to understand the real-time status of the vehicle. It is difficult for users to achieve real-time and accurate control of the vehicle through the above vehicle control technology architecture, and to obtain the vehicle's status information in real time, so as to achieve an efficient and convenient car experience, and face many challenges and shortcomings.

[0003] First, remote vehicle control systems are often limited by network latency and server processing time, which means that users cannot get the ideal real-time experience in actual operation. This delay not only affects the user's immediate response to vehicle control, but also may cause the vehicle status information obtained by the user to lag, thereby reducing overall user satisfaction.

[0004] Secondly, remote vehicle control technology involves vehicle safety and user privacy protection, which are important issues that cannot be ignored. Existing technical solutions may have certain hidden dangers in terms of security, such as the risk of data leakage during data transmission and the potential threat of illegal control of vehicles. These security risks may not only harm the interests of users, but also cause immeasurable losses to the vehicle itself.

[0005] In addition, with the continuous increase in the number of users and the continuous expansion of functions, the existing vehicle control technology architecture has shown obvious limitations in scalability. Traditional technical architectures are often difficult to adapt to large-scale user concurrent access and complex functional requirements, resulting in problems such as system performance degradation and insufficient stability. This not only limits the widespread application of remote vehicle control technology, but also makes it difficult to meet the needs of future smart car development.

[0006] Finally, different users use different devices and platforms, which puts higher requirements on the cross-platform compatibility of remote vehicle control technology. However, the existing vehicle control technology architecture often has deficiencies in cross-platform compatibility, resulting in users on different devices and platforms unable to obtain a consistent and good user experience. This not only affects user satisfaction and loyalty, but may also have an adverse impact on the market promotion of remote vehicle control technology. Summary of the invention

[0007] The present application provides a vehicle remote control method, device, electronic device and storage medium based on Netty to solve the technical problems of high operation delay, insecure data transmission, poor scalability and poor compatibility in the above-mentioned remote vehicle control.

[0008] In one embodiment of the present application, the present application provides a vehicle remote control method based on Netty, including: obtaining a connection establishment request from a client, and establishing a current communication connection between the client and the Netty service cluster according to the connection establishment request; performing a connection status detection on a target terminal according to a preset detection time to obtain a status detection result, wherein the target terminal includes at least one of the client and a vehicle terminal; receiving a remote vehicle control instruction from the client; performing preset business processing on the remote vehicle control instruction according to the status detection result, and forwarding the remote vehicle control instruction to the vehicle terminal to remotely control the vehicle.

[0009] In one embodiment of the present application, a connection establishment request from a client is obtained, and a current communication connection between the client and a Netty service cluster is established according to the connection establishment request, including: receiving the connection establishment request from the client through polling of each leader event loop; if the connection establishment request is received, establishing the current communication connection and generating a current channel object; if a current channel object exists, registering the current channel object to a selector of a working event loop; wherein the Netty service cluster includes multiple leader event loops and multiple working event loops, and the selector is used to register current channel objects corresponding to multiple clients.

[0010] In one embodiment of the present application, a connection status detection is performed on a target terminal according to a preset detection time to obtain a status detection result, including:

[0011] If the target terminal is a client, a first heartbeat packet is generated according to a first detection time through the one working event loop, and the first heartbeat packet is sent to the client through the current communication connection, so that the client generates a first status response packet, and sends it to the Netty service cluster through the current communication connection; if the target terminal is a vehicle terminal, a second heartbeat packet generated according to a second detection time is sent to the vehicle terminal through a preset channel, so that the vehicle terminal generates a second status response packet, and sends it to the Netty service cluster through the preset channel; if the first status response packet and the second status response packet are received, the status detection result is determined as a normal connection; if at least one of the second status response packet and the second status response packet is not received, the status detection result is determined as an abnormal connection; wherein, the preset detection time includes the first detection time and the second detection time.

[0012] In one embodiment of the present application, preset business processing is performed on the remote vehicle control instruction according to the status detection result, including: performing event polling on all historical channel objects in the selector through the working event loop; if a readable event is found in the current channel object and the status detection result is that the connection is normal, the remote vehicle control instruction is subjected to preset business processing, and the preset business processing includes at least one of performing a point reward query on the remote vehicle control instruction and logging the remote vehicle control instruction.

[0013] In one embodiment of the present application, receiving remote vehicle control instructions from the client includes: reading the remote vehicle control instructions by subscribing to the service message of the corresponding partition in the Kafka cluster through each consumer in the Netty service cluster; wherein the remote vehicle control instructions are sent to the Kafka cluster through the client, and the received remote vehicle control instructions are stored in the corresponding partition in the Kafka cluster.

[0014] In one embodiment of the present application, after establishing the current communication connection between the client and the Netty service cluster according to the connection establishment request, the method includes: receiving a user operation request from the client through the current communication connection; executing the user operation request through the Netty service cluster, obtaining an information display result, and sending it to the client, so that the client displays information according to the information display result.

[0015] In one embodiment of the present application, the present application provides a vehicle remote control method based on Netty, including: obtaining a remote control instruction of a client, the remote control instruction being transmitted through a preset channel between a Netty service cluster and a vehicle terminal; controlling the vehicle according to the remote control instruction to obtain a vehicle control result; if there is a point reward for the remote control instruction, issuing reward points corresponding to the remote control instruction; sending the operation result to the Netty service cluster through the preset channel, so as to send the operation result to the client through the Netty service cluster, the operation result including the vehicle control result, or the operation result including the vehicle control result and the reward points.

[0016] In one embodiment of the present application, the present application provides a vehicle remote control device based on Netty, including: a connection establishment module, used to obtain a connection establishment request from a client, and establish a current communication connection between the client and the Netty service cluster according to the connection establishment request; a connection detection module, used to perform connection status detection on the target terminal according to a preset detection time to obtain a status detection result, the target terminal includes the client and the vehicle terminal, and the remote vehicle control instruction is sent to the Kafka cluster through the client; an instruction transmission module, used to subscribe to the service message of the Kafka cluster to read the remote vehicle control instruction corresponding to the client, and the remote vehicle control instruction is sent to the Kafka cluster through the client; an instruction processing module, used to perform preset business processing on the remote vehicle control instruction according to the status detection result, and forward the remote vehicle control instruction to the vehicle terminal to remotely control the vehicle.

[0017] In one embodiment of the present application, the present application provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the Netty-based vehicle remote control method as described in any of the above embodiments.

[0018] In one embodiment of the present application, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the Netty-based vehicle remote control method described in any one of the above embodiments.

[0019] Beneficial effects of the embodiments of the present application: The present application provides a vehicle remote control method, device, electronic device and storage medium based on Netty. The embodiments of the present application process the client's connection establishment request through the Netty service cluster, and perform preset business processing and forwarding on the received remote vehicle control instructions through the Netty service cluster, thereby improving the control efficiency, data reliability, scalability and compatibility of vehicle remote control.

[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0022] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;

[0023] Figure 2 A schematic diagram of a process of a vehicle remote control method based on Netty according to an embodiment of the present application is shown;

[0024] Figure 3 A service schematic diagram of a Netty server according to an embodiment of the present application is shown;

[0025] Figure 4 A schematic diagram of the architecture of a Kafka cluster according to an embodiment of the present application is shown;

[0026] Figure 5 A schematic diagram of a process of a vehicle remote control method based on Netty according to another embodiment of the present application is shown;

[0027] Figure 6 A schematic diagram of the architecture of a vehicle remote control based on Netty according to an embodiment of the present application is shown;

[0028] Figure 7 A block diagram of a vehicle remote control device based on Netty according to an embodiment of the present application is shown;

[0029] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0030] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0031] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0032] First of all, it should be noted that in the existing vehicle control technology architecture, at the user level: users send remote vehicle control commands through the interface of the remote control client on the client, such as starting the vehicle, locking the vehicle, locating the vehicle, etc., and monitor the vehicle status, manage user information, view logs, etc. through the administrator interface on the client. Application level: responsible for receiving user requests and performing business logic processing, such as verifying user identity and permissions, and generating corresponding remote control commands. Service level: listen to the designated port, receive connection requests and command data from the remote control client, forward the received command data to the command scheduler for processing, and send the vehicle status information and other response data back to the remote control client; and be responsible for parsing the received remote control commands, and converting the commands into signals that the vehicle can understand, and sending them to the vehicle through a specific communication protocol. Vehicle level: The vehicle receives the command signal from the server and performs the corresponding operation, such as starting the engine, unlocking the door, etc.; and sends the status information collected by the sensor and control system to the server, such as location, speed, power, etc. Data level: store user information, vehicle information, command records, etc.

[0033] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0034] See also Figure 1 , Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown. Figure 1 As shown, the system architecture may include a client 101, a Netty server 102, and a vehicle terminal 103. Among them, a connection establishment request of the client 101 is obtained, and the current communication connection between the client 101 and the Netty service cluster 102 is established according to the connection establishment request; a connection status detection is performed on the target terminal according to a preset detection time to obtain a status detection result, and the target terminal includes the client 101 and the vehicle terminal 103; a remote vehicle control instruction of the client is received; a preset business processing is performed on the remote vehicle control instruction according to the status detection result, and the remote vehicle control instruction is forwarded to the vehicle terminal 103 to remotely control the vehicle.

[0035] In order to solve the above technical problems, the present application provides a vehicle remote control method, device, electronic device and storage medium based on Netty. The implementation details of the technical solution of the embodiment of the present application are elaborated in detail below.

[0036] See also Figure 2 , Figure 2FIG. 1 shows a flow chart of a vehicle remote control method based on Netty according to an embodiment of the present application. Figure 2 As shown, in an exemplary embodiment, the vehicle remote control method based on Netty includes at least steps S210 to S240, which are applied to the Netty service cluster, and are described in detail as follows:

[0037] Step S210, obtaining a connection establishment request from the client, and establishing a current communication connection between the client and the Netty service cluster according to the connection establishment request.

[0038] In one embodiment of the present application, a connection establishment request from a client is obtained, and a current communication connection between the client and a Netty service cluster is established according to the connection establishment request, including: receiving a connection establishment request from the client through polling of each leader event loop; if a connection establishment request is received, establishing the current communication connection, and generating a current channel object; if a current channel object exists, registering the current channel object to a selector of a working event loop; wherein the Netty service cluster includes multiple leader event loops and multiple working event loops, and the selector is used to register current channel objects corresponding to multiple clients.

[0039] In one embodiment of the present application, the Netty service cluster continuously polls whether there is a new client connection establishment request, and the connection establishment request can be generated by the mobile phone APP and the Web interface, thereby establishing the current communication connection between the Netty service cluster and the client.

[0040] In one embodiment of the present application, the current communication connection is based on the Transmission Control Protocol (TCP).

[0041] In one embodiment of the present application, the Netty model abstracts two groups of thread pools, including a leader group (BossGroup) and a work group (WorkerGroup). Among them, the BossGroup is used to receive client connections, and the WorkerGroup is used to read and write network data.

[0042] In one embodiment of the present application, the Netty server includes 1 Boss non-blocking event loop group (NioEventLoopGroup) and 1 Worker non-blocking event loop group (NioEventLoopGroup). Among them, 1 non-blocking event loop group (NioEventLoopGroup) contains multiple non-blocking event loops (NioEventLoop), and each non-blocking event loop (NioEventLoop) includes 1 selector (selector) and 1 event loop thread.

[0043] In one embodiment of the present application, see Figure 3 , Figure 3 A service schematic diagram of a Netty server according to an embodiment of the present application is shown. Figure 3 As shown, the NioEventLoop loop corresponding to each Boss, that is, the leading event loop, performs the following tasks: first, continuously polling whether there are new client corresponding connection establishment requests, that is, accept events; second, processing new client connection establishment requests, establishing communication connections, and generating a current channel object (NioSocketChannel), registering the current channel object to the non-blocking event loop corresponding to the Worker by processing the processSelectedKeys method corresponding to the selected key, that is, the selector of a working event loop (selector); third, executing tasks corresponding to all connection establishment requests in the task queue.

[0044] In one embodiment of the present application, after establishing the current communication connection between the client and the Netty service cluster according to the connection establishment request, the method includes: receiving a user operation request from the client through the current communication connection; executing the user operation request through the Netty service cluster, obtaining an information display result, and sending it to the client, so that the client displays information according to the information display result.

[0045] In one embodiment of the present application, the information display results include a preset information display page, owner identity verification results, query results, and modification results.

[0046] In one embodiment of the present application, if the owner's identity authentication result is that the identity authentication is passed, the current information of the vehicle is displayed, and the current information of the vehicle in the data warehouse is sent to the client through the Netty service cluster; if the owner's identity authentication result is that the identity authentication is not passed, it jumps to the preset information display page.

[0047] In one embodiment of the present application, the preset information display page includes a vehicle product purchase page, and the query result includes current vehicle information.

[0048] In one embodiment of the present application, in a Netty service cluster of a vehicle remote control scenario, a non-blocking event loop group (NioEventLoopGroup) includes at least one non-blocking event loop.

[0049] Step S220, performing connection status detection on the target terminal according to a preset detection time to obtain a status detection result.

[0050] The target terminal includes at least one of a client terminal and a vehicle terminal.

[0051] In one embodiment of the present application, a connection status detection is performed on a target terminal according to a preset detection time to obtain a status detection result, including: if the target terminal is a client, a first heartbeat packet is generated according to a first detection time through a work event loop, and the first heartbeat packet is sent to the client through the current communication connection, so that the client generates a first status response packet, and sends it to a Netty service cluster through the current communication connection; if the target terminal is a vehicle terminal, a second heartbeat packet generated according to a second detection time is sent to the vehicle terminal through a preset channel, so that the vehicle terminal generates a second status response packet, and sends it to the Netty service cluster through the preset channel; if the first status response packet and the second status response packet are received, the status detection result is determined to be a normal connection; if at least one of the second status response packet and the second status response packet is not received, the status detection result is determined to be an abnormal connection; wherein, the preset detection time includes the first detection time and the second detection time.

[0052] In one embodiment of the present application, the blocking event loop corresponding to the Worker is used to execute scheduled tasks and ordinary tasks. Scheduled tasks and ordinary tasks are generated by user customization and / or generated internally by the Netty framework. For example, during the vehicle remote control process, a remote vehicle control command is sent to a preset channel through an ordinary task; the Netty service cluster sends heartbeat packets to the vehicle terminal and / or the client terminal at regular intervals through a scheduled task to detect the connection status.

[0053] Step S230, receiving a remote vehicle control command from the client.

[0054] In one embodiment of the present application, receiving remote vehicle control instructions from a client includes: reading the remote vehicle control instructions by subscribing to the service message of the corresponding partition in the Kafka cluster through each consumer in the Netty service cluster; wherein the remote vehicle control instructions are sent to the Kafka cluster through the client, and the received remote vehicle control instructions are stored in the corresponding partition in the Kafka cluster.

[0055] In one embodiment of the present application, during the vehicle remote control process, the user sends a remote vehicle control command through the client. The remote vehicle control command will be sent to the Kafka cluster of the middleware, and the Netty service cluster will subscribe to the message of the Kafka cluster and consume the message. When the user uses the remote vehicle control command, the message corresponding to the remote vehicle control command will be asynchronously sent to the preset topic in the Kafka cluster and sent to the Netty service cluster through the network.

[0056] In one embodiment of the present application, see Figure 4 , Figure 4 FIG. 1 shows a schematic diagram of the architecture of a Kafka cluster according to an embodiment of the present application. Figure 4 As shown in the figure, the Kafka cluster manages messages by topic, such as Figure 4 The topic A in the . Nodes are server nodes in the Kafka cluster, such as node 0, node 1, and node 2. The messages produced by producers can be stored in different partitions, and consumers are responsible for consuming the messages of the corresponding partitions. Both parties operate on the topic, such as consumer 1 consumes messages from partition 0, consumer 2 consumes messages from partition 1, and consumer 3 consumes messages from partition 2. Partitions are physical concepts. Each partition corresponds to a log file to store the messages corresponding to each partition, such as the messages corresponding to "0" to "5" in Topic A-Partition 0-Leader, the messages corresponding to "0" to "3" in Topic A-Partition 1-Leader, and the messages corresponding to "0" to "4" in Topic A-Partition 2-Leader. The data produced by producers will be continuously appended to the end of this log file, and each piece of data has its own offset. For example, the message corresponding to "5" in Topic A-Partition 0-Leader is the offset of partition 0. Consumers will record the offset consumed so that they can continue consuming from the last position when problems occur. Moreover, by redundancy of partitions from replicas, the leader and slave replica of a partition can be located on different nodes, such as the leader of partition 0 is located on node 0, the slave replica of partition 0 is located on node 2, the leader of partition 1 is located on node 1, the slave replica of partition 1 is located on node 0, the leader of partition 2 is located on node 2, and the slave replica of partition 2 is located on node 1.

[0057] Step S240 , performing preset business processing on the remote vehicle control command according to the status detection result, and forwarding the remote vehicle control command to the vehicle terminal to remotely control the vehicle.

[0058] In one embodiment of the present application, preset business processing is performed on the remote vehicle control command according to the status detection result, including: event polling is performed on all historical channel objects in the selector through a working event loop; if a readable event is found in the current channel object and the status detection result is that the connection is normal, the remote vehicle control command is subjected to preset business processing, and the preset business processing includes at least one of querying the remote vehicle control command for points rewards and logging the remote vehicle control command.

[0059] In one embodiment of the present application, please continue with the parameter Figure 3 ,like Figure 3As shown, the tasks executed in a loop by the NioEventLoop corresponding to each Worker include: first, continuously polling all historical channel objects in the selector to see if there are readable events or writable events; second, determining the pipeline corresponding to the readable event or writable event through the processSelectedKeys method, and performing data processing through the channel processor in the Pipeline; third, executing all tasks in the task queue, including connection status detection.

[0060] In one embodiment of the present application, the non-blocking event loop corresponding to the Worker continuously polls the historical channel object registered on it to determine whether there is a ready readable / writable (Input / Output, I / O) event. When a historical channel object has a readable event, the historical channel object is determined as the target channel object, and the non-blocking event loop corresponding to the Worker reads the data sent by the client through the target channel object; when data needs to be sent to the client, the data is written to the send buffer of the target channel object.

[0061] In one embodiment of the present application, after receiving the remote vehicle control command, the Netty service cluster will perform preset business processing. For example, query whether this user is using the remote vehicle control command for the first time; query the reward corresponding to the use of the remote vehicle control command, and record the remote vehicle control commands used by the user. After the processing is completed, the Netty service cluster will forward the remote vehicle control command to the vehicle.

[0062] In one embodiment of the present application, in the traditional server and client service model, because the blocking IO mode is used to obtain the data input by the client, each client connection to the server requires an independent thread to complete the data input, business processing and data return. When there are a large number of concurrent connections of multiple clients, a large number of threads will be created, occupying a large amount of system resources, and after the connection is created, if the current thread has no data to read temporarily, the thread will block the read operation, resulting in a waste of thread resources. Compared with the traditional server and client service model, one event loop thread in the Netty service cluster can handle tasks corresponding to multiple clients, and through the efficient reactor (Reactor) model and thread model, it ensures the efficient processing of a large number of concurrent connections and the reliable transmission of data.

[0063] In one embodiment of the present application, through the parallel processing of NioEventLoop corresponding to multiple Workers, the Netty service cluster can simultaneously process remote vehicle control instructions corresponding to multiple clients, thereby achieving efficient and reliable network communication.

[0064] See also Figure 5 , Figure 5FIG. 1 shows a flow chart of a vehicle remote control method based on Netty according to another embodiment of the present application. Figure 5 As shown, in an exemplary embodiment, the vehicle remote control method based on Netty includes at least steps S510 to S540, which are applied to the vehicle terminal and are described in detail as follows:

[0065] Step S510: obtaining a remote control instruction from the client.

[0066] Among them, the remote control instructions are transmitted through the preset channel between the Netty service cluster and the vehicle terminal.

[0067] In one embodiment of the present application, the remote control instructions of the client are transmitted to the vehicle terminal through the Kafka cluster and the Netty service cluster in sequence.

[0068] Step S520, controlling the vehicle according to the remote control instruction to obtain a vehicle control result.

[0069] Step S530: If there is a point reward for the remote control instruction, the reward points corresponding to the remote control instruction are issued.

[0070] Step S530, sending the operation result to the Netty service cluster through a preset channel, so as to send the operation result to the client through the Netty service cluster, the operation result includes the vehicle control result, or the operation result includes the vehicle control result and the reward points.

[0071] In one embodiment of the present application, after receiving the remote vehicle control command, the vehicle terminal executes the operation corresponding to the remote vehicle control command, such as starting the engine, locking the door, issuing reward points, etc., and sends the operation result back to the Netty service cluster through the network.

[0072] In one embodiment of the present application, the purpose of issuing reward points is to increase the user's enthusiasm for using remote vehicle control commands.

[0073] In one embodiment of the present application, reward points are used to redeem physical prizes and service offers.

[0074] In one embodiment of the present application, the non-blocking event loop group corresponding to the Worker in the present application is used to establish a communication connection, read and send data, execute tasks, issue vehicle control instructions, server processing, vehicle-side response and result feedback.

[0075] In one embodiment of the present application, the Netty service cluster feeds back the operation results to the corresponding client, and the user can view the operation results of the vehicle through the client.

[0076] In one embodiment of the present application, see Figure 6 , Figure 6 FIG. 1 shows a schematic diagram of the architecture of a vehicle remote control based on Netty according to an embodiment of the present application. Figure 6 As shown, the software is entered through the user's mobile phone. The client, including the mobile phone, communicates with the Netty service cluster through TCP and accesses the login page. The user operation request is sent to the server cluster, where server 1, server 2 and more servers n work together to process user requests and provide corresponding services. In the server cluster, there are multiple functional modules, such as car product purchase page, owner identity authentication, query function and modification function. Each functional module processes data through the communication connection with the client to realize the processing and response of user operation requests. The log is queried through the log monitoring system, so as to realize the monitoring and recording of the operating status and events of the server cluster through log reporting and query. In addition, the vehicle real-time information display page provides real-time update and display functions of the vehicle status. In terms of data communication and interaction, Figure 6 The in-vehicle communication module (Telematics Box, T-BOX) is shown as the core processing unit, which is responsible for remotely controlling the vehicle and interacting with the vehicle hardware communication modules, such as the Electronic Control Unit (ECU) and the Vehicle Control Unit (VCU). The vehicle hardware communication modules exchange data through the Controller Area Network (CAN) bus to ensure the coordination of various vehicle components. As a message queue system, the Kafka cluster plays a key role in the architecture. The functions of publishing and subscribing messages are realized, so that the client and the Netty service cluster can communicate asynchronously without occupying the resources of both systems. A large number of service messages are placed in the middleware Kafka cluster for unified queuing and processing, which improves the scalability and reliability of the system. Through event-driven, message queue and other technologies, functions such as user request processing, vehicle status monitoring and remote control are realized, reflecting the high availability and scalability of the system.

[0077] In one embodiment of the present application, in order to ensure the stable operation of the vehicle remote control function based on Netty and facilitate troubleshooting, a log monitoring system is introduced to monitor the operating status, performance indicators and abnormal conditions of the vehicle remote control function of Netty in real time. All key operations and abnormal events, including user operations, system responses, data processing, etc., are recorded by the log monitoring system. Log data can be efficiently retrieved and analyzed, providing strong support for system optimization and troubleshooting. Through the collaborative work of the above modules, the present invention realizes the vehicle remote control function based on the Netty network communication framework, providing users with an efficient, safe and stable remote control experience. In addition, through system monitoring and logging functions, the maintainability and reliability of the system are further improved.

[0078] In one embodiment of the present application, the Reactor model and thread pool of the Netty service cluster make full use of the parallel processing capabilities of the multi-core central processing unit (CPU), and can efficiently process a large number of concurrent connections and network requests. Through the division of labor and cooperation between the Boss thread pool and the Worker thread pool, the Netty service cluster can process connection establishment, data reading and writing, and preset services in parallel, avoiding the performance bottleneck caused by serial processing, and improving network communication efficiency and stability. Netty is a high-performance, asynchronous event-driven network application framework that greatly simplifies network programming such as the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) socket server. Netty is particularly suitable for building a vehicle remote control server that needs to handle a large number of concurrent connections and I / O operations in this application. High-performance TCP or UDP communication is achieved through Netty, and various protocols, such as preset vehicle communication protocols, are easily processed. The throughput and response speed of the Netty service cluster are improved through asynchronous non-blocking I / O, and connection management, heartbeat detection, reconnection mechanism, etc. are conveniently implemented.

[0079] In one embodiment of the present application, the Kafka cluster provides a message queue mechanism to cache and route key data such as remote vehicle control instructions to different Topics, ensuring that data will not be lost during network transmission. The distributed architecture and replica backup mechanism of the Kafka cluster enhance fault tolerance and high availability. Even if some nodes or networks fail, the Kafka cluster can still maintain stable operation. The persistent storage of messages enables the system to have complete data recovery capabilities and greatly improves reliability. The Kafka cluster realizes the decoupling of message sending and receiving, asynchronous processing of messages, and peak shaving and valley filling corresponding to message resource balancing. In addition, message queues are usually highly reliable and can implement functions such as persistent storage of messages, backup of messages, and fault recovery to ensure that messages will not be lost; by increasing message queue instances or adding consumer instances, the horizontal expansion of message queues can be achieved to improve the processing power of the system; message queues usually support multiple message delivery modes, such as point-to-point mode and publish / subscribe mode, and different modes can be selected according to different business scenarios;

[0080] In one embodiment of the present application, the Kafka cluster supports simple and fast horizontal expansion, and can dynamically add nodes according to business needs to meet the growth of future business scale. The thread pool of the Netty service cluster also has good scalability, and can dynamically adjust the number of threads according to hardware resources to adapt to different load scenarios. The system monitoring and logging functions improve the convenience of problem location and system optimization, and greatly improve the overall maintainability.

[0081] In one embodiment of the present application, the present application cleverly combines Netty's high-performance network communication framework and Kafka's distributed message queue to form a highly coordinated Internet of Vehicles communication system. By reasonably dividing the responsibilities of the Boss thread pool and the Worker thread pool, Netty's parallel processing capabilities are fully utilized and the overall performance is improved. And by utilizing Kafka's asynchronous decoupling and peak shaving characteristics, the key issues of data reliability and system stability in the Internet of Vehicles scenario are solved. Advanced system monitoring and log analysis functions are integrated, which greatly improves the engineering level and maintainability.

[0082] See also Figure 7 , Figure 7 A block diagram of a vehicle remote control device based on Netty according to an embodiment of the present application is shown. The device can be applied to Figure 1 The implementation environment shown is specifically configured in the Netty service cluster 102. The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.

[0083] like Figure 7As shown, a Netty-based vehicle remote control device 700 according to an embodiment of the present application includes: a connection establishment module 701, a connection detection module 702, a command receiving module 703 and a command processing module 704.

[0084] The connection establishment module 701 is used to obtain a connection establishment request from the client and establish a current communication connection between the client and the Netty service cluster according to the connection establishment request;

[0085] The connection detection module 702 is used to detect the connection status of the target terminal according to the preset detection time to obtain the status detection result. The target terminal includes the client and the vehicle terminal. The remote vehicle control command is sent to the Kafka cluster through the client;

[0086] The command receiving module 703 is used to subscribe to the service message of the Kafka cluster and read the remote vehicle control command corresponding to the client. The remote vehicle control command is sent to the Kafka cluster through the client;

[0087] The instruction processing module 704 is used to perform preset business processing on the remote vehicle control instruction according to the status detection result, and forward the remote vehicle control instruction to the vehicle terminal to remotely control the vehicle.

[0088] It should be noted that the vehicle remote control device based on Netty provided in the above embodiment and the vehicle remote control method based on Netty provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the vehicle remote control device based on Netty provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0089] An embodiment of the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the Netty-based vehicle remote control method provided in the above-mentioned embodiments.

[0090] See also Figure 8 , Figure 8 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0091] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the random access memory 803, various programs and data required for system operation are also stored. The central processing unit 801, the read-only memory 802 and the random access memory 803 are connected to each other through a bus 804. The input / output interface 805 is also connected to the bus 804.

[0092] The following components are connected to the input / output interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.

[0093] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present application are executed.

[0094] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0095] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0096] The units involved in the embodiments described in the present application can be implemented by software or by hardware, and the units described can also be set in a processor. Among them, the names of these units do not constitute a limitation on the units themselves under certain circumstances. Therefore, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation mode of the present application.

[0097] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the vehicle remote control method based on Netty provided in the above-mentioned embodiments. The computer-readable storage medium may be included in the electronic device described in the above-mentioned embodiments, or may exist independently without being assembled into the electronic device.

[0098] In the above embodiments, unless otherwise specified, by using serial numbers such as "first" and "second" to describe common objects, it only means that they refer to different instances of the same object, rather than indicating that the objects being described must adopt a given order, whether in time, space, sorting or any other way.

[0099] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A vehicle remote control method based on Netty, characterized in that: The method comprises: Obtain a connection establishment request from the client, and establish a current communication connection between the client and the Netty service cluster according to the connection establishment request; Performing connection status detection on a target terminal according to a preset detection time to obtain a status detection result, wherein the target terminal includes at least one of the client terminal and the vehicle terminal; Receiving remote vehicle control instructions from the client; The remote vehicle control command is subjected to preset business processing according to the status detection result, and the remote vehicle control command is forwarded to the vehicle terminal to remotely control the vehicle.

2. The vehicle remote control method based on Netty according to claim 1 is characterized in that: Obtaining a connection establishment request from the client, and establishing a current communication connection between the client and the Netty service cluster according to the connection establishment request, including: Receive the client's connection establishment request through each leader event loop polling; If the connection establishment request is received, the current communication connection is established and the current channel object is generated; If there is a current channel object, register the current channel object to a selector of a working event loop; The Netty service cluster includes multiple leader event loops and multiple worker event loops, and the selector is used to register current channel objects corresponding to multiple clients.

3. The vehicle remote control method based on Netty according to claim 2 is characterized in that: Perform connection status detection on the target terminal according to the preset detection time to obtain status detection results, including: If the target terminal is a client, a first heartbeat packet is generated according to a first detection time through a work event loop, and the first heartbeat packet is sent to the client through the current communication connection, so that the client generates a first status response packet, and sends it to the Netty service cluster through the current communication connection; If the target terminal is a vehicle terminal, a second heartbeat packet generated according to the second detection time is sent to the vehicle terminal through a preset channel, so that the vehicle terminal generates a second status response packet, and sends it to the Netty service cluster through the preset channel; If the first status response packet and the second status response packet are received, the status detection result is determined as a normal connection; If at least one of the second status response packet and the second status response packet is not received, determining the status detection result as a connection abnormality; The preset detection time includes the first detection time and the second detection time.

4. The vehicle remote control method based on Netty according to claim 2 is characterized in that: Performing preset business processing on the remote vehicle control command according to the state detection result includes: Performing event polling on all historical channel objects in the selector through the working event loop; If a readable event is found in the current channel object and the status detection result is that the connection is normal, the remote vehicle control instruction is subjected to preset business processing, and the preset business processing includes at least one of querying the remote vehicle control instruction for points rewards and logging the remote vehicle control instruction.

5. The vehicle remote control method based on Netty according to any one of claims 1 to 4, characterized in that: Receiving a remote vehicle control instruction from the client, including: Each consumer in the Netty service cluster subscribes to the service message of the corresponding partition in the Kafka cluster to read the remote vehicle control instructions; The remote vehicle control command is sent to the Kafka cluster through the client, and the received remote vehicle control command is stored in the corresponding partition in the Kafka cluster.

6. The vehicle remote control method based on Netty according to any one of claims 1 to 4, characterized in that: After establishing the current communication connection between the client and the Netty service cluster according to the connection establishment request, the method includes: receiving a user operation request from the client via the current communication connection; The user operation request is executed through the Netty service cluster to obtain an information display result, and the information display result is sent to the client, so that the client displays information according to the information display result.

7. A vehicle remote control method based on Netty, characterized in that: The method comprises: Obtain the remote control command of the client, which is transmitted through a preset channel between the Netty service cluster and the vehicle terminal; Control the vehicle according to the remote control instruction to obtain a vehicle control result; If the remote control instruction has a point reward, then the reward points corresponding to the remote control instruction are issued; The operation result is sent to the Netty service cluster through the preset channel, so as to send the operation result to the client through the Netty service cluster, wherein the operation result includes the vehicle control result, or the operation result includes the vehicle control result and the reward points.

8. A vehicle remote control device based on Netty, characterized in that: The device comprises: A connection establishment module is used to obtain a connection establishment request from a client and establish a current communication connection between the client and the Netty service cluster according to the connection establishment request; A connection detection module, used to detect the connection status of the target terminal according to a preset detection time to obtain a status detection result, wherein the target terminal includes the client and the vehicle terminal, and the remote vehicle control instruction is sent to the Kafka cluster through the client; A command receiving module, used for receiving remote vehicle control commands from the client; The command processing module is used to perform preset business processing on the remote vehicle control command according to the state detection result, and forward the remote vehicle control command to the vehicle terminal to remotely control the vehicle.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the Netty-based vehicle remote control method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the Netty-based vehicle remote control method described in any one of claims 1 to 7.