Intelligent environmental sanitation system and environmental sanitation vehicle track query method
By introducing a dual-vehicle networking platform architecture and a cross-platform trajectory query mechanism into the smart sanitation system, the problems of insufficient system stability and high implementation costs are solved, and a smart sanitation system with lower cost and higher stability are achieved.
Patent Information
- Application Number
- CN202510329318.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-20
AI Technical Summary
The stability of the smart sanitation system is insufficient and the implementation cost is high, mainly due to the single Internet of Vehicles platform and the limited selection of IoT devices.
Introduce a dual-vehicle Internet of Things platform architecture, combining old and new IoT devices, cross-platform trajectory query servers and reverse proxy servers are implemented to reduce dependence on a single platform.
It reduces the implementation cost of smart sanitation systems, enhances the stability of the system, and avoids system paralysis caused by failure of a single platform.
Smart Images

Figure CN119854733A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent sanitation, and in particular to an intelligent sanitation system and a sanitation vehicle trajectory query method. Background Art
[0002] In order to improve the efficiency and quality of urban sanitation management, the sanitation department proposed the deployment of a smart sanitation system. Specifically, a designated model of IoT device supported by a designated Internet of Vehicles platform is deployed on each sanitation vehicle to upload the vehicle trajectory to the Internet of Vehicles platform through the IoT device. Based on this, application services such as garbage collection and transportation, mechanized operations, and vehicle operation obtain the trajectory data of sanitation vehicles through the trajectory service interface of the Internet of Vehicles platform, so as to make corresponding service plans based on the acquired trajectory data. However, when the Internet of Vehicles platform is single and the selection of IoT devices is limited by the Internet of Vehicles platform, the stability of the smart sanitation system is not guaranteed, and the implementation cost is high. Summary of the invention
[0003] The purpose of the present invention is to provide a smart sanitation system and a sanitation vehicle trajectory query method to reduce the implementation cost of the smart sanitation system and enhance the stability of the smart sanitation system.
[0004] In a first aspect, the present invention provides a smart sanitation system, including: a plurality of old Internet of Things devices, an old Internet of Vehicles platform, a plurality of new Internet of Things devices, a new Internet of Vehicles platform, a track query server, a reverse proxy server and an application service client; an old Internet of Things device or a new Internet of Things device is installed on each sanitation vehicle; each old Internet of Things device is bound to the old Internet of Vehicles platform, and each new Internet of Things device is bound to the new Internet of Vehicles platform; the new Internet of Things devices include: an Internet of Things device supporting a specified communication protocol; the track query server is respectively connected to the old Internet of Vehicles platform, the new Internet of Vehicles platform and the reverse proxy server, and the reverse proxy server is also connected to the application service client; the track query server stores a list of new Internet of Things devices and the time when each new Internet of Things device is connected to the new Internet of Vehicles platform; The reverse proxy server receives a track query request sent by the application service client, and forwards the track query request to the track query server; wherein the track query request includes: the number of the target IoT device and the track generation period; if the number of the target IoT device is included in the new IoT device list, and the track generation period is after the moment when the target IoT device is connected to the new Internet of Vehicles platform, the track query server sends a track query request to the new Internet of Vehicles platform; if the number of the target IoT device is not included in the new IoT device list, the track query server sends a track query request to the old Internet of Vehicles platform; the track query server receives the track query result returned by the old Internet of Vehicles platform or the new Internet of Vehicles platform, and feeds back the track query result to the application service client through the reverse proxy server.
[0005] Optionally, it also includes: a first scheduled task cluster and a relational database; the first scheduled task cluster is connected to the target Internet of Vehicles platform and the relational database respectively, and the relational database is also connected to the trajectory query server; wherein, the target Internet of Vehicles platform includes: an old Internet of Vehicles platform and / or a new Internet of Vehicles platform; if the target Internet of Vehicles platform includes an old Internet of Vehicles platform and a new Internet of Vehicles platform, the old Internet of Vehicles platform and the new Internet of Vehicles platform correspond to a group of first scheduled task clusters and relational databases respectively; the first scheduled task cluster periodically obtains the trajectory data of the sanitation vehicle from the target Internet of Vehicles platform, and sends the trajectory data to the corresponding relational database; wherein, the trajectory data of each sanitation vehicle is indexed by the number of the Internet of Things device installed on the sanitation vehicle; the relational database stores the trajectory data in separate tables based on the number of the Internet of Things device; after receiving the trajectory query request, the trajectory query server determines the number of the target data table in the relational database based on the number of the target Internet of Things device; wherein the target data table stores the trajectory data of the sanitation vehicle corresponding to the target Internet of Things device; the relational database determines the trajectory query result according to the trajectory query request and the number of the target data table, and feeds it back to the trajectory query server.
[0006] Optionally, the relational database stores the trajectory data in separate tables based on the numbers of the IoT devices, including: calculating the remainder of the number of the first IoT device and the total number of preset data tables; wherein the first IoT device represents any device among all IoT devices; and storing the trajectory data of the sanitation vehicle corresponding to the first IoT device in the data table numbered as the remainder in the relational database.
[0007] Optionally, it also includes: a message queue cluster and a first consumer cluster; the message queue cluster is connected to the first scheduled task cluster and the first consumer cluster respectively, and the first consumer cluster is also connected to a relational database; the first scheduled task cluster periodically obtains the trajectory data of the sanitation vehicle from the target Internet of Vehicles platform, and sends the trajectory data to the message queue cluster; the first consumer cluster consumes the trajectory data in the message queue cluster to store the trajectory data in the relational database.
[0008] Optionally, it also includes: a second consumer cluster, a distributed file system and a distributed column database; the distributed file system is connected to the second consumer cluster, the distributed column database and the trajectory query server respectively; the second consumer cluster consumes the trajectory data in the message queue cluster to send the trajectory data to the distributed file system; the distributed file system cuts the trajectory data into blocks and stores them in the distributed column database.
[0009] Optionally, in the case where the smart sanitation system includes a relational database, a distributed file system, and a distributed column database, when the trajectory query server receives a trajectory query request, the trajectory query server generates a target random number between 0 and 1; if the target random number is greater than a preset threshold, the trajectory query server determines the trajectory query result through the relational database; if the target random number is less than or equal to the preset threshold, the trajectory query server determines the trajectory query result through the distributed file system and the distributed column database.
[0010] Optionally, it also includes: a second scheduled task cluster, a third scheduled task cluster and a Redis cluster; the second scheduled task cluster is connected to the first relational database and the Redis cluster respectively; wherein the first relational database represents a relational database connected to the old vehicle networking platform; the third scheduled task cluster is connected to the second relational database and the Redis cluster respectively; wherein the second relational database represents a relational database connected to the new vehicle networking platform; the second scheduled task cluster and the third scheduled task cluster periodically obtain the trajectory data of the sanitation vehicle from the corresponding relational database, and send the trajectory data to the Redis cluster; after receiving the trajectory query request, if the trajectory query server determines that the trajectory generation period of the target Internet of Things device is within the trajectory query time limit of the Redis cluster, the trajectory query server determines the trajectory query result through the Redis cluster.
[0011] In a second aspect, the present invention provides a method for querying the trajectory of a sanitation vehicle, which is applied to the smart sanitation system of any one of the aforementioned embodiments, comprising: receiving a trajectory query request; wherein the trajectory query request includes: the number of the target Internet of Things device and the trajectory generation period; if the number of the target Internet of Things device is included in the new Internet of Things device list, and the trajectory generation period is after the moment when the target Internet of Things device is connected to the new Internet of Vehicles platform, then sending a trajectory query request to the new Internet of Vehicles platform; if the number of the target Internet of Things device is not included in the new Internet of Vehicles device list, then sending a trajectory query request to the old Internet of Vehicles platform; and receiving the trajectory query result returned by the old Internet of Vehicles platform or the new Internet of Vehicles platform.
[0012] In a third aspect, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the sanitation vehicle trajectory query method of the aforementioned embodiment is implemented.
[0013] In a fourth aspect, the present invention provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the sanitation vehicle trajectory query method of the aforementioned embodiment is implemented.
[0014] The smart sanitation system provided by the present invention includes: multiple old Internet of Things devices, old Internet of Vehicles platforms, multiple new Internet of Things devices, new Internet of Vehicles platforms, track query servers, reverse proxy servers and application service clients. The track query servers and reverse proxy servers are used to be compatible with track query services of the old and new Internet of Vehicles platforms. Compared with the traditional smart sanitation system, the present invention adds a new Internet of Vehicles platform that can bind Internet of Things devices that support a specified communication protocol, thereby expanding the selection range of Internet of Things devices, so that Internet of Things devices with lower cost performance can be selected, thereby reducing the implementation cost of the smart sanitation system. In addition, the configuration of the dual Internet of Vehicles platform can reduce the system's dependence on a single Internet of Vehicles platform and enhance the stability of the smart sanitation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A system architecture diagram of a smart sanitation system provided by an embodiment of the present invention; Figure 2 A system architecture diagram of a smart sanitation system provided by an embodiment of the present invention using two groups of first scheduled task clusters and a relational database; Figure 3 A system architecture diagram after a message queue cluster and a first consumer cluster are adopted on an old car networking platform side provided by an embodiment of the present invention; Figure 4 A system architecture diagram of an old car networking platform side using a second consumer cluster, a distributed file system and a distributed columnar database provided by an embodiment of the present invention; Figure 5 A system architecture diagram of a smart sanitation system using a Redis cluster provided in an embodiment of the present invention; Figure 6 A flow chart of a sanitation vehicle trajectory query method provided by an embodiment of the present invention; Figure 7 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0018] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0020] Embodiment 1 Figure 1 A system architecture diagram of a smart sanitation system provided by an embodiment of the present invention, such as Figure 1 As shown, the system includes: multiple old IoT devices 101, an old Internet of Vehicles platform 102, multiple new IoT devices 103, a new Internet of Vehicles platform 104, a trajectory query server 105, a reverse proxy server 106 and an application service client 107.
[0021] Install one old IoT device or one new IoT device on each sanitation vehicle.
[0022] Each old IoT device is bound to the old Internet of Vehicles platform, and each new IoT device is bound to the new Internet of Vehicles platform; new IoT devices include: IoT devices that support specified communication protocols.
[0023] The trajectory query server is connected to the old vehicle networking platform, the new vehicle networking platform and the reverse proxy server respectively, and the reverse proxy server is also connected to the application service client.
[0024] The smart sanitation system provided in the embodiment of the present invention introduces a new Internet of Vehicles platform on the basis of the original old Internet of Vehicles platform in order to enhance system stability and reduce system implementation costs. Compared with the old Internet of Vehicles platform, the new Internet of Vehicles platform no longer restricts the brands and models of Internet of Things devices that can be connected to the platform. As long as the Internet of Things device can support the specified communication protocol, it can be connected to the new Internet of Things platform as a new Internet of Things device. Based on this, when purchasing new Internet of Things devices, the cost performance of the equipment can be fully considered, thereby reducing the system implementation cost. At the same time, the two Internet of Vehicles platforms can further enhance system stability and will not cause system paralysis due to problems with a single platform. The embodiment of the present invention does not specifically limit the specified communication protocol, and the user can configure it according to actual needs. Optionally, the specified communication protocol is the JT808 protocol.
[0025] The sanitation vehicle trajectory data collected by the old IoT devices is uploaded to the old vehicle networking platform to which it is bound, while the sanitation vehicle trajectory data collected by the new IoT devices is uploaded to the new vehicle networking platform to which it is bound. After the introduction of the new vehicle networking platform, in order to reduce the sensitivity of the application service client to the system architecture adjustment, such as Figure 1 As shown in the figure, the smart sanitation system also needs to add a track query server and a reverse proxy server for implementing intermediate adaptation services. One end of the reverse proxy server is connected to the application service client, and the other end is connected to the track query server. The track query server is also connected to the old and new vehicle networking platforms. The application service client can provide users with a user interface for application services such as garbage collection and transfer, mechanized operations, and vehicle operation. Users can send track query requests to the smart sanitation system through the user interface.
[0026] Optionally, the reverse proxy server selects nginx, the track query server can provide N service processes for nginx to access, and nginx can load balance the N service processes of the track query server to avoid affecting the stability of the system due to uneven load.
[0027] In an embodiment of the present invention, a track query server stores a list of new IoT devices and the time when each new IoT device is connected to the new Internet of Vehicles platform; wherein the list of new IoT devices includes the numbers of all new IoT devices connected to the new Internet of Vehicles platform. After the user sends a track query request through the user interface, the reverse proxy server can receive the track query request sent by the application service client and forward the track query request to the track query server; wherein the track query request includes: the number of the target IoT device and the track generation period. For example, if the request is to query the track data of the IoT device numbered 10000 from October 30 to 31, 2023, then in the track query request, the number of the target IoT device is 10000, and the track generation period is from October 30 to 31, 2023.
[0028] If the new IoT device list contains the number of the target IoT device, and the trajectory generation period is after the time when the target IoT device is connected to the new Internet of Vehicles platform, the trajectory query server sends a trajectory query request to the new Internet of Vehicles platform.
[0029] If the new IoT device list does not contain the number of the target IoT device, the trajectory query server sends a trajectory query request to the old Internet of Vehicles platform.
[0030] The trajectory query server receives the trajectory query result returned by the old vehicle networking platform or the new vehicle networking platform, and feeds the trajectory query result back to the application service client through the reverse proxy server.
[0031] That is to say, after receiving the trajectory query request, the trajectory query server first needs to determine which Internet of Vehicles platform should handle the request. It is known that the trajectory query server stores a list of new IoT devices and the time when each new IoT device is connected to the new Internet of Vehicles platform. Based on this, if the trajectory query server determines that the new IoT device list contains the number of the target IoT device, and the trajectory generation period in the trajectory query request is after the time when the target IoT device is connected to the new Internet of Vehicles platform, it means that the new Internet of Vehicles platform contains the trajectory data uploaded by the target IoT device, so the trajectory query server sends a trajectory query request to the new Internet of Vehicles platform to obtain the trajectory query result.
[0032] If the number of the target IoT device is included in the list of new IoT devices, but the trajectory generation period is before the time when the target IoT device is connected to the new Internet of Vehicles platform, it can be seen that although the target IoT device is a new IoT device, the trajectory data uploaded by the target IoT device does not exist in the new Internet of Vehicles platform, so the trajectory query result cannot be obtained at this time. The application service client can feedback the reason for the trajectory query failure to the user.
[0033] If the number of the target IoT device is not included in the new IoT device list, it means that the target IoT device is an old IoT device, so the trajectory query server sends a trajectory query request to the old Internet of Vehicles platform to obtain the trajectory query result.
[0034] The smart sanitation system provided by the embodiment of the present invention includes: multiple old Internet of Things devices, old Internet of Vehicles platforms, multiple new Internet of Things devices, new Internet of Vehicles platforms, track query servers, reverse proxy servers and application service clients. The track query servers and reverse proxy servers are used to be compatible with track query services of the old and new Internet of Vehicles platforms. Compared with the traditional smart sanitation system, the embodiment of the present invention adds a new Internet of Vehicles platform that can bind Internet of Things devices that support a specified communication protocol, thereby expanding the selection range of Internet of Things devices, so that Internet of Things devices with lower cost performance can be selected, thereby reducing the implementation cost of the smart sanitation system. In addition, the configuration of the dual Internet of Vehicles platform can reduce the system's dependence on a single Internet of Vehicles platform and enhance the stability of the smart sanitation system.
[0035] As the business scale of the smart sanitation system continues to expand, if the vehicle trajectory query interface of the new / old vehicle networking platform is frequently called, the response time of the vehicle trajectory query interface will be too long or even a response timeout will occur. In order to avoid the above problems, in an optional implementation method, Figure 2 As shown, the smart sanitation system also includes: a first scheduled task cluster 108 and a relational database 109.
[0036] The first scheduled task clusters are respectively connected to the target Internet of Vehicles platform and the relational database, and the relational database is also connected to the trajectory query server; wherein, the target Internet of Vehicles platform includes: an old Internet of Vehicles platform and / or a new Internet of Vehicles platform; if the target Internet of Vehicles platform includes an old Internet of Vehicles platform and a new Internet of Vehicles platform, then the old Internet of Vehicles platform and the new Internet of Vehicles platform correspond to a group of first scheduled task clusters and a relational database respectively.
[0037] That is to say, the response time of the trajectory query request is shortened by persistently storing the trajectory data of the sanitation vehicle in a relational database through a scheduled task cluster. Optionally, the relational database is a MySQL database. If both the new and old Internet of Vehicles platforms adopt the above strategy, the first scheduled task cluster and the relational database include two groups, one group of the first scheduled task cluster and the relational database is used to store the trajectory data for the old Internet of Vehicles platform, and the other group of the first scheduled task cluster and the relational database is used to store the trajectory data for the new Internet of Vehicles platform.
[0038] The first scheduled task cluster periodically obtains the trajectory data of the sanitation vehicle from the target Internet of Vehicles platform and sends the trajectory data to the corresponding relational database; wherein the trajectory data of each sanitation vehicle is indexed by the number of the Internet of Things device installed on the sanitation vehicle.
[0039] Considering the large amount of trajectory data, in the embodiment of the present invention, the relational database stores the trajectory data in separate tables based on the number of the IoT device. The embodiment of the present invention does not specifically limit the number of data tables in the relational database, and the user can configure it according to the actual situation. For example, 200 data tables can be set. In the embodiment of the present invention, the relational database stores the acquired trajectory data in separate tables based on the number of the IoT device that reported the trajectory data. By processing the number of the IoT device, the number of the data table where its trajectory data needs to be stored can be determined.
[0040] After receiving the trajectory query request, the trajectory query server determines the number of the target data table in the relational database based on the number of the target Internet of Things device; wherein the target data table stores the trajectory data of the sanitation vehicle corresponding to the target Internet of Things device.
[0041] The relational database determines the trajectory query result according to the trajectory query request and the number of the target data table, and feeds it back to the trajectory query server.
[0042] After the trajectory data is stored in separate tables, when the trajectory query server receives a trajectory query request, it first refers to the calculation method when the trajectory data is stored in separate tables, determines the number of the target data table in the relational database according to the number of the target IoT device in the trajectory query request, and then directly uses the number of the target IoT device as an index to query the trajectory data corresponding to the number from the target data table in the relational database, that is, there is no need to traverse the query in the entire relational database, thereby improving the response speed of the trajectory query request and thus improving the user experience.
[0043] In an optional implementation, the relational database stores the trajectory data in separate tables based on the serial number of the IoT device, specifically including the following contents: First, the remainder of the serial number of the first Internet of Things device and the total number of preset data tables is calculated; wherein the first Internet of Things device represents any device among all Internet of Things devices.
[0044] Then, the trajectory data of the sanitation vehicle corresponding to the first Internet of Things device is stored in a data table numbered as remainder in the relational database.
[0045] For ease of understanding, the following example is used to illustrate. Assuming that the total number of preset data tables in the relational database is 200, and a certain IoT device is numbered 201, then when storing the trajectory data reported by it, first calculate the remainder of 201 over 200, and the remainder is 1. Therefore, the trajectory data of the sanitation vehicle corresponding to the IoT device should be stored in the data table numbered 1 in the relational database.
[0046] Furthermore, considering that the power outage in the relational database room and the relational database crash lead to data accumulation, which will lead to the loss of sanitation vehicle trajectory data. In order to avoid this problem, in an optional implementation, the smart sanitation system further includes: a message queue cluster 110 and a first consumer cluster 111.
[0047] The message queue cluster is connected to the first scheduled task cluster and the first consumer cluster respectively, and the first consumer cluster is also connected to the relational database.
[0048] The first scheduled task cluster periodically obtains the trajectory data of the sanitation vehicle from the target Internet of Vehicles platform and sends the trajectory data to the message queue cluster.
[0049] The first consumer cluster consumes the trajectory data in the message queue cluster to store the trajectory data in a relational database.
[0050] Specifically, Figure 3 A system architecture diagram after the old Internet of Vehicles platform side adopts the message queue cluster and the first consumer cluster is provided for an embodiment of the present invention. If the new Internet of Vehicles platform side also adopts the message queue cluster and the first consumer cluster, the system architecture diagram is the same. Optionally, the message queue cluster can adopt the kafka message queue cluster, and the first scheduled task cluster stores the acquired trajectory data in the kafka message queue cluster, and then consumes the data through the first consumer cluster to store the data in the relational database connected to it. Based on the above system architecture, when the computer room loses power or the relational database crashes, the data acquired by the first scheduled task cluster can be temporarily stored in the message queue cluster until the relational database resumes normal operation, and the first consumer cluster then transfers the trajectory data to the relational database, thereby avoiding the loss of trajectory data of sanitation vehicles.
[0051] Taking into account that as the number of IoT devices connected to the Internet of Vehicles platform in the smart sanitation system increases, in order to improve the accuracy of the sanitation vehicle trajectory, a large number of IoT devices will shorten the upload cycle of the vehicle trajectory. The trajectory upload cycle of many devices may even reach once per second, resulting in a total data volume of billions. At that time, the relational database will find it difficult to cope with the storage needs of massive data. In view of this, in an optional implementation, the smart sanitation system also includes: a second consumer cluster 112, a distributed file system 113 and a distributed columnar database 114.
[0052] The distributed file system is connected to the second consumer cluster, the distributed column database and the track query server respectively.
[0053] The second consumer cluster consumes the trajectory data in the message queue cluster to send the trajectory data to the distributed file system.
[0054] The distributed file system divides the trajectory data into blocks and stores them in a distributed columnar database.
[0055] Figure 4 The system architecture diagram of the old car networking platform side after adopting the second consumer cluster, distributed file system and distributed column database is provided in the embodiment of the present invention. If the new car networking platform side also adopts the above configuration, its system architecture diagram is the same. Obviously, in order to solve the problem of massive data storage, the embodiment of the present invention introduces the technical combination of distributed file system HDFS and distributed column database HBASE.
[0056] In an embodiment of the present invention, when the smart sanitation system includes a relational database, a distributed file system, and a distributed column database, when the trajectory query server receives a trajectory query request, the trajectory query server generates a target random number between 0 and 1.
[0057] If the target random number is greater than a preset threshold, the trajectory query server determines the trajectory query result through the relational database.
[0058] If the target random number is less than or equal to the preset threshold, the trajectory query server determines the trajectory query result through the distributed file system and the distributed column database.
[0059] When the smart sanitation system uses both relational database and distributed file system + distributed column database to store trajectory data, the data content stored in the relational database and the distributed column database is consistent. Then, when the trajectory query server receives a trajectory query request, taking the target IoT device as an old IoT device as an example (the same applies to new IoT devices), the trajectory query server first generates a target random number between 0 and 1. If the target random number is greater than the preset threshold, the trajectory query result is determined through the relational database. At this time, you can refer to the method of querying the relational database above, first determine the number of the target data table, and then query the trajectory data from the target data table; if the target random number is not greater than the preset threshold, the trajectory query result is determined through the distributed file system and the distributed column database.
[0060] In order to further improve the query speed of trajectory data, in an optional implementation, the smart sanitation system also includes: a second scheduled task cluster 115 , a third scheduled task cluster 116 and a Redis cluster 117 .
[0061] The second scheduled task cluster is connected to the first relational database and the Redis cluster respectively; wherein the first relational database represents a relational database connected to the old Internet of Vehicles platform.
[0062] The third scheduled task cluster is connected to the second relational database and the Redis cluster respectively; wherein the second relational database represents a relational database connected to the new Internet of Vehicles platform.
[0063] The second scheduled task cluster and the third scheduled task cluster periodically obtain the trajectory data of the sanitation vehicle from the corresponding relational database, and send the trajectory data to the Redis cluster.
[0064] After receiving the trajectory query request, if the trajectory query server determines that the trajectory generation period of the target IoT device is within the trajectory query time limit of the Redis cluster, the trajectory query server determines the trajectory query result through the Redis cluster.
[0065] Figure 5 A system architecture diagram of a smart sanitation system using a Redis cluster is provided in an embodiment of the present invention. In an embodiment of the present invention, the trajectory data within M days is cached by the second scheduled task cluster and the third scheduled task cluster and stored in the memory database Redis cluster. If the trajectory query request needs to query the trajectory data of the target IoT device within M days, the trajectory query server can directly initiate a query request to the Redis cluster, which can not only improve the data query speed, but also alleviate the query pressure of the relational database, thereby reducing the probability of system crash and improving system stability.
[0066] In addition, if the new / old Internet of Vehicles platform uses a message queue cluster and a first consumer cluster, then in order to avoid wasting system resources and further improve system stability, the data stored in the Redis cluster should be consumed by introducing a new consumer cluster to consume the trajectory data in the message queue cluster, and then storing the trajectory data in the Redis cluster, instead of using a scheduled task cluster to periodically pull trajectory data from a relational database.
[0067] In summary, the embodiments of the present invention provide a variety of smart sanitation system architectures, all of which can provide stable technical support for the query of sanitation vehicle trajectory data. In addition, the introduction of a new Internet of Vehicles platform can reduce system implementation costs and improve system stability.
[0068] Embodiment 2 An embodiment of the present invention further provides a method for querying the trajectory of a sanitation vehicle. The method is applied to the smart sanitation system provided in the above-mentioned embodiment 1. The method for querying the trajectory of a sanitation vehicle provided in the embodiment of the present invention is introduced below.
[0069] like Figure 6 As shown, the sanitation vehicle trajectory query method provided by the embodiment of the present invention includes the following steps: Step S102: receiving a trajectory query request.
[0070] The trajectory query request includes: the number of the target IoT device and the time period when the trajectory was generated.
[0071] Step S104: If the new IoT device list contains the number of the target IoT device, and the trajectory generation period is after the time when the target IoT device is connected to the new Internet of Vehicles platform, a trajectory query request is sent to the new Internet of Vehicles platform.
[0072] Step S106: If the new IoT device list does not contain the number of the target IoT device, a track query request is sent to the old Internet of Vehicles platform.
[0073] Step S108, receiving the trajectory query result returned by the old Internet of Vehicles platform or the new Internet of Vehicles platform.
[0074] Specifically, the smart sanitation system establishes a communication connection with the user through its application service client. The application service client can display the user interface of application services such as garbage collection and transportation, mechanized operations and vehicle operation to the user. The user can send a trajectory query request of the sanitation vehicle to the smart sanitation system through the user interface.
[0075] If the smart sanitation system includes: multiple old IoT devices, old car networking platforms, multiple new IoT devices, new car networking platforms, track query servers, reverse proxy servers and application service clients (please refer to Example 1 for the connection relationship between the system components), then after the application service client receives the track query request, the application service client sends the track query request to the reverse proxy server, and after the reverse proxy server load balances multiple service processes of the track query server, the track query request is forwarded to the track query server. Next, the track query server determines the acceptance platform (new car networking platform or old car networking platform) of the track query request according to the number of the target IoT device carried in the track query request and the track generation period: if the number of the target IoT device is not in the list of new IoT devices pre-stored in the track query server, then the track query server sends the track query request to the old car networking platform; if the number of the target IoT device is in the list of new IoT devices pre-stored in the track query server, and the track generation period is after the time when the target IoT device is connected to the new car networking platform, then the track query server sends the track query request to the new car networking platform; for other abnormal situations that may occur when performing track queries, the application service client can feedback the reason for the failure of the track query to the user according to the actual situation. After receiving the trajectory query result returned by the old Internet of Vehicles platform or the new Internet of Vehicles platform, the trajectory query server can feed back the trajectory query result to the application service client through the reverse proxy server.
[0076] In an optional embodiment, if the smart sanitation system is based on the above-mentioned basic system structure (multiple old IoT devices, old Internet of Vehicles platforms, multiple new IoT devices, new Internet of Vehicles platforms, trajectory query servers, reverse proxy servers and application service clients), a first scheduled task cluster and a relational database are also set for the new Internet of Vehicles platform and / or the old Internet of Vehicles platform to avoid the problem of long response time or even response timeout of the vehicle trajectory query interface due to frequent calls to the vehicle trajectory query interface of the new Internet of Vehicles platform and / or the old Internet of Vehicles platform. Or on this basis, a message queue cluster and a first consumer cluster are further added to avoid the problem of loss of sanitation vehicle trajectory data due to power outages in the relational database computer room and crashes of the relational database. The sanitation vehicle trajectory query methods of the above two smart sanitation systems are as follows: The communication process between the application service client, the reverse proxy server and the trajectory query server remains unchanged. When the trajectory query server receives the trajectory query request, it also first determines the acceptance platform of the trajectory query request based on the number of the target IoT device and the trajectory generation period. The following takes the binding of the target IoT device to the new IoT platform as an example. If it is determined that the target IoT device is bound to the new IoT platform, and the trajectory data of all sanitation vehicles connected to the new vehicle networking platform have been stored in the corresponding relational database, then the trajectory query server first determines the number of the target data table in the relational database where the trajectory data of the corresponding sanitation vehicle is stored according to the number of the target IoT device, and then sends the number together with the trajectory query request to the relational database. After the relational database determines the trajectory query result based on the above data, it feeds back the trajectory query result to the trajectory query server, and then feeds back to the user interface of the application service client through the reverse proxy server.
[0077] In an optional embodiment, if the smart sanitation system further adds a second consumer cluster, a distributed file system and a distributed columnar database to the new Internet of Vehicles platform and / or the old Internet of Vehicles platform based on the above basic system structure, the first scheduled task cluster, the message queue cluster, the first consumer cluster and the relational database to meet the storage requirements of massive trajectory data, then the sanitation vehicle trajectory query method is as follows: After the user sends a trajectory query request through the application service client, the data processing flow corresponding to the IoT platform to which the target IoT device is bound is determined by the trajectory query server, which is the same as described above. The following takes the binding of the target IoT device to the old IoT platform as an example. If it is determined that the target IoT device is bound to the old IoT platform, and the trajectory data of all sanitation vehicles connected to the old vehicle networking platform have been stored in the corresponding relational database and distributed column database. In this case, the trajectory query server needs to generate a target random number between 0 and 1, and then select one of the relational database and the distributed column database to query the vehicle trajectory based on the result of comparing the target random number with the preset threshold. Specifically, if the target random number is greater than the preset threshold, the trajectory query result is determined through the relational database. The method for querying the trajectory of sanitation vehicles through the relational database can refer to the above; if the target random number is less than or equal to the preset threshold, the trajectory query result is determined through the distributed file system and the distributed column database.
[0078] In an optional embodiment, if the smart sanitation system, based on the above basic system structure, the first scheduled task cluster and the relational database, also adds a second scheduled task cluster for the old car networking platform and a third scheduled task cluster for the new car networking platform, and sets a Redis cluster to improve the query speed of sanitation vehicle trajectory data, then the sanitation vehicle trajectory query method of the smart sanitation system is as follows: The communication process between the application service client, the reverse proxy server and the trajectory query server remains unchanged. When the trajectory query server receives the trajectory query request, it first determines whether the trajectory to be queried by the user is within the trajectory query time limit of the Redis cluster based on the trajectory generation period of the target IoT device in the trajectory query request. If so, the trajectory query server directly determines the trajectory query result through the Redis cluster; if not, it is necessary to determine the acceptance platform of the trajectory query request based on the number of the target IoT device and the trajectory generation period, and then query the sanitation vehicle trajectory through the relational database connected to the acceptance platform. The query method has been introduced above and will not be repeated here.
[0079] Embodiment 3 See also Figure 7 An embodiment of the present invention provides an electronic device, which includes: a processor 60, a memory 61, a bus 62 and a communication interface 63, the processor 60, the communication interface 63 and the memory 61 are connected through the bus 62; the processor 60 is used to execute an executable module stored in the memory 61, such as a computer program.
[0080] The memory 61 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0081] The bus 62 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0082] Among them, the memory 61 is used to store programs, and the processor 60 executes the program after receiving the execution instruction. The method executed by the device defined by the process disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 60 or implemented by the processor 60.
[0083] The processor 60 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 60. The above processor 60 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 61, and the processor 60 reads the information in the memory 61 and completes the steps of the above method in combination with its hardware.
[0084] A computer program product of a smart sanitation system and a sanitation vehicle trajectory query method provided in an embodiment of the present invention includes a computer-readable storage medium storing a non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the method in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0085] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0086] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0087] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0088] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, or the positions or positional relationships in which the product of the invention is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific position, be constructed and operated in a specific position, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0089] In addition, the terms "horizontal", "vertical", "overhanging" and the like do not mean that the components are required to be absolutely horizontal or overhanging, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", and does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0090] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A smart sanitation system, characterized in that: include: Multiple old IoT devices, old IoV platforms, multiple new IoT devices, new IoV platforms, trajectory query servers, reverse proxy servers, and application service clients; One of the old IoT devices or one of the new IoT devices is installed on each sanitation vehicle; Each of the old IoT devices is bound to the old Internet of Vehicles platform, and each of the new IoT devices is bound to the new Internet of Vehicles platform; The new IoT devices include: IoT devices that support a specified communication protocol; The track query server is connected to the old vehicle networking platform, the new vehicle networking platform and the reverse proxy server respectively, and the reverse proxy server is also connected to the application service client; The track query server stores a list of new IoT devices and the time when each new IoT device is connected to the new Internet of Vehicles platform; The reverse proxy server receives the track query request sent by the application service client, and forwards the track query request to the track query server; wherein the track query request includes: the number of the target IoT device and the track generation period; If the number of the target IoT device is included in the new IoT device list, and the track generation period is after the time when the target IoT device is connected to the new Internet of Vehicles platform, the track query server sends the track query request to the new Internet of Vehicles platform; If the new IoT device list does not contain the number of the target IoT device, the track query server sends the track query request to the old Internet of Vehicles platform; The track query server receives the track query result returned by the old vehicle networking platform or the new vehicle networking platform, and feeds the track query result back to the application service client through the reverse proxy server.
2. The smart sanitation system according to claim 1, characterized in that: Also includes: The first scheduled task cluster and relational database; The first scheduled task cluster is connected to the target Internet of Vehicles platform and the relational database respectively, and the relational database is also connected to the trajectory query server; wherein the target Internet of Vehicles platform includes: an old Internet of Vehicles platform and / or a new Internet of Vehicles platform; if the target Internet of Vehicles platform includes an old Internet of Vehicles platform and a new Internet of Vehicles platform, the old Internet of Vehicles platform and the new Internet of Vehicles platform correspond to a group of first scheduled task clusters and a relational database respectively; The first scheduled task cluster periodically obtains the trajectory data of the sanitation vehicle from the target vehicle networking platform, and sends the trajectory data to the corresponding relational database; wherein the trajectory data of each sanitation vehicle is indexed by the number of the Internet of Things device installed on the sanitation vehicle; The relational database stores the trajectory data in separate tables based on the numbers of the IoT devices; After receiving the trajectory query request, the trajectory query server determines the number of the target data table in the relational database based on the number of the target IoT device; wherein the target data table stores the trajectory data of the sanitation vehicle corresponding to the target IoT device; The relational database determines a trajectory query result according to the trajectory query request and the number of the target data table, and feeds it back to the trajectory query server.
3. The intelligent sanitation system according to claim 2, characterized in that: The relational database stores the trajectory data in separate tables based on the numbers of the IoT devices, including: Calculate the remainder of the serial number of the first Internet of Things device and the total number of the preset data table; wherein the first Internet of Things device represents any device among all Internet of Things devices; The trajectory data of the sanitation vehicle corresponding to the first Internet of Things device is stored in the data table numbered as the remainder in the relational database.
4. The intelligent sanitation system according to claim 2, characterized in that: Also includes: Message queue cluster and first consumer cluster; The message queue cluster is connected to the first scheduled task cluster and the first consumer cluster respectively, and the first consumer cluster is also connected to the relational database; The first scheduled task cluster periodically obtains the trajectory data of the sanitation vehicle from the target Internet of Vehicles platform, and sends the trajectory data to the message queue cluster; The first consumer cluster consumes the trajectory data in the message queue cluster to store the trajectory data in the relational database.
5. The intelligent sanitation system according to claim 4, characterized in that: Also includes: Second consumer cluster, distributed file system and distributed columnar database; The distributed file system is connected to the second consumer cluster, the distributed column database and the track query server respectively; The second consumer cluster consumes the trajectory data in the message queue cluster to send the trajectory data to the distributed file system; The distributed file system blocks and stores the trajectory data in the distributed column database.
6. The intelligent sanitation system according to claim 5, characterized in that: In the case where the smart sanitation system includes the relational database, the distributed file system, and the distributed column database, when the trajectory query server receives a trajectory query request, the trajectory query server generates a target random number between 0 and 1; If the target random number is greater than a preset threshold, the trajectory query server determines the trajectory query result through the relational database; If the target random number is less than or equal to a preset threshold, the trajectory query server determines a trajectory query result through the distributed file system and the distributed column database.
7. The intelligent sanitation system according to claim 2, characterized in that: Also includes: The second scheduled task cluster, the third scheduled task cluster and the Redis cluster; The second scheduled task cluster is connected to the first relational database and the Redis cluster respectively; wherein the first relational database represents a relational database connected to the old Internet of Vehicles platform; The third scheduled task cluster is connected to the second relational database and the Redis cluster respectively; wherein the second relational database represents a relational database connected to the new Internet of Vehicles platform; The second scheduled task cluster and the third scheduled task cluster periodically obtain the trajectory data of the sanitation vehicle from the corresponding relational database, and send the trajectory data to the Redis cluster; After receiving the trajectory query request, if the trajectory query server determines that the trajectory generation period of the target IoT device is within the trajectory query time limit of the Redis cluster, the trajectory query server determines the trajectory query result through the Redis cluster.
8. A sanitation vehicle trajectory query method, characterized in that: The smart sanitation system applied to any one of claims 1 to 7 comprises: Receive a trajectory query request; wherein the trajectory query request includes: the number of the target IoT device and the trajectory generation period; If the number of the target IoT device is included in the new IoT device list, and the track generation period is after the time when the target IoT device is connected to the new Internet of Vehicles platform, then the track query request is sent to the new Internet of Vehicles platform; If the number of the target IoT device is not included in the new IoT device list, sending the track query request to the old Internet of Vehicles platform; Receive the trajectory query result returned by the old vehicle networking platform or the new vehicle networking platform.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein: When the processor executes the computer program, the sanitation vehicle trajectory query method described in claim 8 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by the processor, the sanitation vehicle trajectory query method described in claim 8 is implemented.
Citation Information
Patent Citations
Mass multi-protocol internet of vehicles terminal access technology
CN105897603A
Small-flow Internet of Things gateway upgrading method, apparatus and device, and storage medium
CN114726720A
Intelligent environmental sanitation vehicle visual section supervision system
CN115951383A
Basic service platform of Internet of Vehicles
CN117411911A
Method for calculating utilization rate of multi-data-dimension flowing high-altitude operation machine supporting continuous and non-continuous time
CN118735114A