Vehicle management method, device, electronic device and storage medium for operation platform
By determining the vehicle number and operation tenant based on the vehicle connection identifier in the operation platform, and updating and managing json files, the problem of low timeliness and accuracy of online vehicle statistics in the prior art is solved, and more efficient vehicle management is achieved.
Patent Information
- Application Number
- CN202211714774.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-12-29
AI Technical Summary
In the prior art, online vehicle statistics are low in timeliness and accuracy, resulting in low efficiency and lag in management systems.
By determining the vehicle number based on the vehicle connection identifier, the operating tenant associated with the vehicle is determined, the json file corresponding to the public network address is obtained, the json file is updated according to the vehicle status, and the json file of the temporary node is obtained when online vehicle statistics are performed, and the number of vehicles online for each operating tenant is determined.
It realizes the timeliness and accuracy of online vehicle statistics, improves the efficiency of the management system, and avoids lag in the management system.
Smart Images

Figure CN116110224B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of shared control technology, and in particular to a vehicle management method, device, electronic device and storage medium for an operation platform. Background Art
[0002] With the continuous development of the sharing economy, more sharing models are also constantly covering people's lives, such as shared power banks and shared electric motorcycles. For the existing sharing models, according to their own needs and the established sharing implementation methods, they can use the shared equipment, such as using shared power banks for charging and riding shared electric motorcycles.
[0003] Taking shared electric motorcycles as an example, when managing, the platform generally provides services to shared vehicle operating companies in a multi-tenant model. Improving the utilization rate of vehicles is related to the vital interests of the operating companies, and the vehicle online rate is a basic and important operating indicator.
[0004] The general method is to use a relational database to store the online status of the vehicle, and then query statistics from the database based on the ID assigned to the vehicle operating company and the online status of its vehicle. However, with the increasing number of operating companies and the increasing number of vehicles invested by operating companies, this method is inefficient and the timeliness of statistics is low, and it will also cause the management system to stall. Summary of the invention
[0005] The present invention provides a vehicle management method, device, electronic device and storage medium for an operation platform, which are used to solve the problem of low timeliness and accuracy of online vehicle statistics in the prior art.
[0006] The present invention provides a vehicle management method for an operation platform, comprising:
[0007] Determining the vehicle number of the vehicle according to the connection identifier of the vehicle;
[0008] Determining, according to the vehicle number, an operating tenant associated with the vehicle;
[0009] Obtain a json file associated with a first temporary node corresponding to a public network address, wherein the public network address corresponds to an operation platform connected to the operation tenant;
[0010] According to the vehicle status of the vehicle, the json file is updated and the updated json file is stored in the first temporary node, and when performing online vehicle statistics, the json file of the second temporary node associated with the operation platform is obtained to determine the number of online vehicles of each operating tenant in the operation platform.
[0011] According to a vehicle management method of an operation platform provided by the present invention, determining an operation tenant associated with the vehicle according to the vehicle number includes:
[0012] According to the vehicle number, a query and match is performed in a preset association list to determine an operating tenant identifier that matches the vehicle number;
[0013] An operating tenant associated with the vehicle is determined according to the operating tenant identifier.
[0014] According to a vehicle management method for an operation platform provided by the present invention, the step of obtaining a json file associated with a first temporary node corresponding to a public network address includes:
[0015] Obtaining a public network address connected to an operation platform, and determining whether the public network address is a temporary node associated with the operation platform, wherein the operation platform includes the operation tenant;
[0016] When it is determined that the public network address is a temporary node associated with the operation platform, obtaining a json file associated with a first temporary node corresponding to the public network address;
[0017] When it is determined that the public network address is not a temporary node associated with the operation platform, a json file associated with a corresponding first temporary node is obtained according to the public network address.
[0018] According to a vehicle management method of an operation platform provided by the present invention, the obtaining of a json file associated with the first temporary node corresponding to the public network address includes:
[0019] Send instruction information for creating a first temporary node corresponding to the public network address, and receive a json file of the first temporary node returned in response to the instruction information.
[0020] According to a vehicle management method of an operation platform provided by the present invention, the updating of the json file according to the vehicle status of the vehicle comprises:
[0021] Obtain the json value contained in the json file, and obtain the vehicle status of the vehicle, wherein the vehicle status includes an online status and an offline status;
[0022] The json value is updated according to the vehicle status.
[0023] According to a vehicle management method of an operation platform provided by the present invention, the updating of the json value according to the vehicle status includes:
[0024] When it is determined that the vehicle status is an online status, obtaining a json value corresponding to the json file, and adding one to the json value to obtain an updated json value;
[0025] When it is determined that the vehicle status is offline, the json value corresponding to the json file is obtained, and the json value is subtracted by one to obtain an updated json value.
[0026] According to a vehicle management method of an operation platform provided by the present invention, determining the vehicle number of the vehicle according to the connection identifier of the vehicle includes:
[0027] When receiving a login request from a vehicle, obtaining the vehicle number of the vehicle, and associating the first connection identifier marking the vehicle with the vehicle identifier, and storing the associations in a local cache;
[0028] When it is detected that the network connection of the vehicle is disconnected, a second connection identifier of the vehicle is obtained, and a query and match is performed according to the second connection identifier to obtain the vehicle number of the vehicle.
[0029] The present invention also provides a vehicle management device for an operation platform, comprising:
[0030] A login receiving module, used to receive a login message sent by a vehicle and obtain the vehicle number contained in the login message;
[0031] A platform determination module, configured to determine an operating tenant associated with the vehicle according to the vehicle number;
[0032] A file acquisition module, used to acquire a json file associated with a first temporary node corresponding to a public network address, wherein the public network address corresponds to an operation platform connected to the operation tenant;
[0033] A data update module is used to update the json file according to the vehicle status of the vehicle, store the updated json file in the first temporary node, and obtain the json file of the second temporary node associated with the operation platform when performing online vehicle statistics to determine the number of online vehicles of each operating tenant in the operation platform.
[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a vehicle management method for an operating platform as described in any one of the above is implemented.
[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a vehicle management method for an operating platform as described in any one of the above.
[0036] The vehicle management method, device, electronic device and storage medium of the operation platform provided by the present invention, when recording the online vehicles of each tenant on the multi-tenant operation platform, determine the vehicle number of the vehicle according to the connection identifier of the vehicle, and then determine the operation tenant associated with the vehicle, and then obtain the json file used to record the online information of the vehicle according to the public network address used by the operation platform, and update the json file according to the status of the vehicle, so that when performing statistics on online vehicles, the number of online vehicles of each operation tenant is obtained by obtaining the json file and traversing the information recorded in the json file. Through the management and control of the json file of the temporary node, the online status of the vehicle is updated in real time, so that when performing online vehicle statistics, the statistics and recording of the online vehicles of each tenant can be completed more quickly and accurately, and the timeliness and accuracy of online vehicle statistics are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 It is a flow chart of the vehicle management method of the operation platform provided by the present invention;
[0039] Figure 2 It is a flowchart of the steps of obtaining a json file provided by the present invention;
[0040] Figure 3 It is an interactive schematic diagram of online vehicle statistics of a multi-tenant shared vehicle operation platform provided by the present invention;
[0041] Figure 4 It is a structural schematic diagram of a vehicle management device of an operation platform provided by the present invention;
[0042] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. 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.
[0044] Combine the following Figure 1-Figure 3 Describe the vehicle management method of the operation platform of the present invention, Figure 1 It is a flow chart of the vehicle management method of the operation platform provided by the present invention, such as Figure 1 As shown, the method includes:
[0045] Step 101, determining the vehicle number of the vehicle according to the connection identifier of the vehicle.
[0046] When a multi-tenant shared vehicle operation platform (hereinafter referred to as the operation platform) counts its own online vehicles, the number of vehicles currently online on the operation platform is determined by recording and summarizing the currently connected vehicles. Specifically, when determining the online vehicles, the currently recorded connection identifier is first obtained, and then the vehicle number of the vehicle is determined according to the connection identifier.
[0047] The connection identifier is a label of the vehicle when it is connected online, which may be a number or letters, etc. The vehicle number is the identity identifier of the vehicle, which may be a vehicle ID or a digital number, etc.
[0048] In actual applications, vehicles exchange data with the operation platform through the IoT platform. Therefore, when a vehicle goes online, it is connected to the corresponding IoT platform to record the vehicle on the operation platform. The IoT platform will record and store the relevant information of the vehicle when the connection is established.
[0049] For example, when a vehicle establishes a connection with the IoT platform, the IoT platform will identify the relevant information of the vehicle, such as the vehicle number, and then establish a communication connection between the two with a specific and unique connection identifier. Therefore, for the vehicle that has completed the communication connection, its corresponding connection identifier will be recorded, and the connection identifier will correspond to the vehicle number.
[0050] Therefore, after the connection identifier of the vehicle is determined, the vehicle number corresponding to the connection identifier is obtained in the local cache for recording and storage, and then the operating platform to which the vehicle currently belongs is determined according to the vehicle number.
[0051] In addition, in actual applications, relative to the operation platform, vehicles have two states: online and offline, that is, normal network connection and disconnected network connection. When the vehicle goes online, it needs to log in, and then the vehicle becomes online when the login is successful. When the communication connection between the vehicle and the IoT platform is disconnected due to network anomalies, the vehicle will become offline. When counting vehicles online, the vehicles counted are those that are online.
[0052] Therefore, when determining the vehicle number, it includes: when a vehicle login request is received, the vehicle number of the vehicle is obtained, and the first connection identifier that marks the vehicle is associated with the vehicle identifier and stored in a local cache; when it is detected that the vehicle's network connection is disconnected, the second connection identifier of the vehicle is obtained, and a query and match is performed based on the second connection identifier to obtain the vehicle number of the vehicle.
[0053] Since the vehicle status is divided into online status and offline status, and when the vehicle is online, the vehicle needs to log in in advance, so for the vehicle that is logged in, when receiving the vehicle's login request, the vehicle number of the vehicle is obtained, and the vehicle is marked with a connection identifier, and then the first connection identifier used for marking is associated with the vehicle number and stored in the local cache. For the case where the connection has been completed but is disconnected due to network anomalies, the second connection identifier of the disconnected vehicle is obtained, and then a query and match is performed in the local cache based on the obtained second connection identifier to obtain the vehicle number corresponding to the vehicle.
[0054] Step 102: Determine the operating tenant associated with the vehicle according to the vehicle number.
[0055] When counting the number of online vehicles of each operating tenant in the operating platform, it is necessary to count the current vehicles on the operating platform, summarize and record the online vehicles, and exclude offline vehicles from the statistical number. Therefore, after determining the vehicle number, determine the currently associated operating tenant based on the vehicle number.
[0056] For example, different operating tenants are associated with different vehicles. A vehicle operating on one operating tenant will not operate on another operating tenant, so the vehicle and the operating tenant are uniquely corresponding. After obtaining the vehicle number, the operating tenant to which it is associated can be determined by query matching.
[0057] Specifically, when determining the associated operating tenant, it includes: performing a query and match in a preset associated list according to the vehicle number to determine the operating tenant identifier that matches the vehicle number; and determining the operating tenant associated with the vehicle according to the operating tenant identifier. After obtaining the vehicle number, since the relationship between the vehicle and the operating tenant is pre-recorded, a query and match can be performed in the corresponding list according to the vehicle number to determine the operating tenant identifier that matches the vehicle number, and then determine the associated operating tenant at this time.
[0058] From the above description, it can be seen that the correspondence between the operating tenants and the vehicles is pre-set according to the actual situation. By establishing the correspondence between each operating tenant and the vehicle on the operating platform, the vehicle number is associated with the operating tenant's identification to achieve the relationship maintenance between the two.
[0059] Step 103, obtaining a json file associated with the first temporary node corresponding to the public network address, wherein the public network address corresponds to the operation platform connected to the operation tenant.
[0060] After determining the operating tenant associated with the vehicle, obtain the corresponding file information for online vehicle recording. Specifically, after determining the operating tenant corresponding to the vehicle number, obtain the public network address used to connect to the operating platform, that is, the public network address used when the Internet of Things platform connects to the operating platform, and then obtain the json file associated with the corresponding first temporary node according to the determined public network address.
[0061] For example, when the operation platform is started, a corresponding permanent node will be established on Zookeeper. The permanent node can be named IOT. Then, when the IoT platform is connected to the operation platform, a temporary node is created under the permanent node to record the online status of the vehicle connected to the IoT platform.
[0062] Therefore, after determining the current corresponding operating tenant, determine the first temporary node corresponding to the public network address of the operating platform to which the operating tenant belongs, and then obtain the json file corresponding to the first temporary node on zookeeper. Among them, the json file records the operating tenant information and the number of online vehicles. The corresponding json value can be generated based on the two. By obtaining the json file, the current number of online vehicles of the operating tenant can be determined. At the same time, when the number of online vehicles changes, the corresponding json file needs to be updated. For example, when a vehicle is online, the number of online vehicles needs to be increased by one, and when a vehicle is offline, the number of online vehicles needs to be reduced by one.
[0063] In actual applications, since the status of a vehicle is determined by its own network status, the operation platform can only know it by obtaining the json file after the json file is updated. Therefore, when obtaining the json file associated with the first temporary node, first determine whether there is a first temporary node corresponding to the public network address, and then obtain the json file corresponding to the first temporary node. Therefore, when obtaining the json file of the first temporary node, refer to Figure 2 , Figure 2 It is a flowchart of the steps of obtaining a json file provided by the present invention, wherein the steps include steps 201 to 203.
[0064] Step 201, obtaining a public network address connected to the operation platform, and determining whether the public network address is a temporary node associated with the operation platform;
[0065] Step 201, when it is determined that the public network address is a temporary node associated with the operation platform, obtain a json file associated with the first temporary node corresponding to the public network address;
[0066] Step 203: When it is determined that the public network address is not a temporary node associated with the operation platform, a json file associated with the first temporary node corresponding to the public network address is obtained.
[0067] Specifically, after determining the public network address, determine whether the public network address is associated with a corresponding temporary node under the operation platform. When it is determined that there is an associated temporary node, the temporary node is determined to be the first temporary node, and the json file corresponding to the first temporary node is obtained. When it is determined that there is no associated temporary node, the corresponding first temporary node is created according to the determined public network address, and a json file corresponding to the first temporary node is generated.
[0068] In actual applications, since the vehicle may first log in to the IoT platform, the corresponding public network address may not be recorded on the operation platform at this time, so when matching the temporary node according to the public network address, there is no temporary node that matches the public network address. At this time, a new temporary node will be created to record the online status of the vehicle.
[0069] In addition, when obtaining the json file corresponding to the first temporary node, matching and file acquisition are performed under the permanent node corresponding to the operation platform on Zookeeper, and when a temporary node needs to be created, it is also created under the permanent node.
[0070] When creating the first temporary node, it includes: sending instruction information for creating the first temporary node corresponding to the public network address, and receiving the json file of the first temporary node returned in response to the instruction information. Specifically, when it is determined that there is no corresponding temporary node for the public network address, a corresponding temporary node will be created on zookeeper, and a corresponding temporary node will be created under the permanent node of the operation platform in zookeeper by sending relevant instruction information to zookeeper, and the corresponding json file will be returned.
[0071] Step 104, according to the vehicle status of the vehicle, the json file is updated, and the updated json file is stored in the first temporary node, and the json file of the temporary node associated with the operation platform is obtained when performing online vehicle statistics to determine the number of online vehicles of each operating tenant in the operation platform.
[0072] When performing online vehicle statistics, the json values in the json file recorded in all temporary nodes of the permanent node corresponding to the operation platform are obtained, and then the data is summarized and accumulated. However, due to the variable status of the vehicle, the json file needs to be updated in real time to ensure the accuracy of the data. Specifically, after obtaining the json file, the obtained json file is updated according to the vehicle status of the vehicle, and the updated json file is stored in the first temporary node. Then, when performing online vehicle statistics, the json files of all temporary nodes associated with the operation platform are obtained and accumulated to determine the number of online vehicles on the operation platform.
[0073] Exemplarily, the vehicle status includes an online status and an offline status, so when updating the json file according to the vehicle status, the json value recorded in the json file is obtained, and then the update of the json file is completed by updating the json value. When updating, it includes: obtaining the json value contained in the json file and obtaining the vehicle status of the vehicle, wherein the vehicle status includes an online status and an offline status; updating the json value according to the vehicle status.
[0074] Since the json file records the operation platform information and the number of online vehicles, vehicles that log in for the first time and disconnected vehicles need to be updated in a timely manner, including the increase and decrease of the number of online vehicles. When updating, the json value is updated according to the vehicle status of the vehicle. When the vehicle status is determined to be online, the json value corresponding to the json file is obtained, and the json value is added by one to obtain the updated json value; when the vehicle status is determined to be offline, the json value corresponding to the json file is obtained, and the json value is subtracted by one to obtain the updated json value.
[0075] In addition, when it is necessary to count the number of online vehicles on the operation platform, all temporary nodes associated with the permanent node corresponding to the operation platform are obtained from Zookeeper, and then all temporary nodes are traversed to obtain the json value of each temporary node. By accumulating the number of online vehicles corresponding to each operation tenant, the number of online vehicles of each operation tenant in the operation platform can be obtained.
[0076] Reference Figure 3 , Figure 3 It is an interactive schematic diagram of online vehicle statistics of the multi-tenant shared vehicle operation platform provided by the present invention.
[0077] Depend on Figure 3 It can be seen that when recording, updating and counting vehicles, the following steps are included:
[0078] 1. The multi-tenant vehicle operation platform maintains the correspondence between vehicles and tenants, that is, the vehicle number is bound to the tenant ID;
[0079] 2. The multi-tenant vehicle operation platform creates a permanent node on Zookeeper when it starts, such as naming the node IOT;
[0080] 3. The vehicle establishes a connection with the IoT platform and sends a login message;
[0081] 4. The IoT platform parses the login message to obtain the vehicle number, and saves it to the local cache with the assigned connection ID and vehicle number as a key-value pair;
[0082] 5. The IoT platform obtains the tenant ID bound to the vehicle from the multi-tenant vehicle operation platform based on the vehicle number;
[0083] 6. Get the public IP of the POD of the IoT platform in the K8S container. If the public IP is a temporary child node of the permanent node IOT on Zookeeper, get the value of the temporary child node from Zookeeper based on the public IP (the value is a json consisting of each tenant ID and the number of online vehicles corresponding to it); if the public IP is not a temporary node on Zookeeper, create a temporary child node under the permanent node IOT on Zookeeper with the public IP, and return a json with no content;
[0084] 7. If the tenant ID obtained in 5 exists in the json obtained in 6, take out the online number corresponding to the tenant ID, add 1, and rewrite it into json; if it does not exist in the json obtained in 6, write the tenant ID as the key and 1 as the value into json, and finally write the entire json as the value into the temporary node of the public network IP in 6;
[0085] 8. If the device is disconnected from the IoT platform due to network anomalies;
[0086] 9. The IoT platform monitors the disconnection event and obtains the vehicle number from the local cache in 4 according to the connection ID;
[0087] 10. The IoT platform obtains the tenant ID bound to the multi-tenant vehicle operation platform based on the vehicle number;
[0088] 11. According to the public IP of the server obtained in step 6, obtain the json value of the temporary node corresponding to the public IP from zookeeper, obtain the corresponding online number from json according to the tenant ID in step 10, subtract 1 from the online number and rewrite it into json, and finally write json as the value to the temporary node of the public IP;
[0089] 12. If the POD in the K8S container where the IoT platform is located is restarted, and Zookeeper cannot detect the heartbeat of the source pod, it will automatically delete all nodes under the permanent node IOT that use the public IP of the POD as a temporary node;
[0090] 13. The multi-tenant vehicle operation platform obtains all temporary nodes under the permanent node IOT from Zookeeper;
[0091] 14. Traverse all temporary nodes and obtain the json value of each temporary node, accumulate the number of online vehicles corresponding to each tenant ID, that is, the number of online vehicles for each tenant.
[0092] In actual applications, the public IP of the POD in the virtual container is used as the temporary node of Zookeeper to save the number of online vehicles of each tenant connected to the POD. By leveraging the characteristics of Zookeeper permanent nodes and temporary nodes, the total number of online vehicles of each tenant is counted in real time, which can efficiently and in real time count the number of online vehicles of each tenant.
[0093] In the vehicle management method of the operation platform provided by the embodiment of the present invention, when recording the online vehicles of each tenant on the multi-tenant operation platform, the vehicle number of the vehicle is determined according to the connection identifier of the vehicle, and then the operation tenant associated with the vehicle is determined, and then the json file used to record the online information of the vehicle is obtained according to the public network address used by the operation platform, and the json file is updated according to the status of the vehicle, so that when performing statistics on online vehicles, the number of online vehicles of each operation tenant is obtained by obtaining the json file and traversing the information recorded in the json file. Through the management and control of the json file of the temporary node, the online status of the vehicle is updated in real time, so that when performing online vehicle statistics, the statistics and records of the online vehicles of each tenant can be completed more quickly and accurately, and the timeliness and accuracy of online vehicle statistics are improved.
[0094] The vehicle management device of the operating platform provided by the present invention is described below. The vehicle management device of the operating platform described below and the vehicle management method of the operating platform described above can be referenced to each other.
[0095] Figure 4 It is a structural diagram of the vehicle management device of the operation platform provided by the present invention, such as Figure 4 As shown, the vehicle management device 400 of the operation platform includes:
[0096] The login receiving module 401 is used to receive the login message sent by the vehicle and obtain the vehicle number contained in the login message;
[0097] The platform determination module 402 is used to determine the operation tenant associated with the vehicle according to the vehicle number;
[0098] The file acquisition module 403 is used to acquire a json file associated with the first temporary node corresponding to the public network address, wherein the public network address corresponds to the operation platform connected to the operation tenant;
[0099] The data update module 404 is used to update the json file according to the vehicle status of the vehicle, store the updated json file in the first temporary node, and obtain the json file of the second temporary node associated with the operation platform when performing online vehicle statistics, and determine the online vehicle statistics of each operating tenant in the operation platform.
[0100] Based on the above embodiment, the platform determination module 402 is further used for:
[0101] According to the vehicle number, a query is performed in the preset association list to determine the operating tenant ID that matches the vehicle number;
[0102] Determine the operating tenant associated with the vehicle based on the operating tenant ID.
[0103] Based on the above embodiment, the file acquisition module 403 is further used for:
[0104] Obtain a public network address connected to an operation platform, and determine whether the public network address is a temporary node associated with the operation platform, where the operation platform includes an operation tenant;
[0105] When it is determined that the public network address is a temporary node associated with the operation platform, obtain a json file associated with the first temporary node corresponding to the public network address;
[0106] When it is determined that the public network address is not a temporary node associated with the operation platform, a json file associated with the first temporary node corresponding to the public network address is obtained.
[0107] Based on the above embodiment, the file acquisition module 403 is further used for:
[0108] Send instruction information for creating a first temporary node corresponding to the public network address, and receive a json file of the first temporary node returned in response to the instruction information.
[0109] Based on the above embodiment, the data updating module 404 is further used for:
[0110] Get the json value contained in the json file and get the vehicle status of the vehicle, where the vehicle status includes online status and offline status;
[0111] Update the json value according to the vehicle status.
[0112] Based on the above embodiment, the data updating module 404 is further used for:
[0113] When it is determined that the vehicle status is online, the json value corresponding to the json file is obtained, and the json value is added by one to obtain the updated json value;
[0114] When it is determined that the vehicle status is offline, the json value corresponding to the json file is obtained, and the json value is subtracted by one to obtain the updated json value.
[0115] Based on the above embodiment, the login receiving module 401 is further used for:
[0116] When receiving a login request from a vehicle, obtaining the vehicle number of the vehicle, and associating the first connection identifier marking the vehicle with the vehicle identifier, and storing them in a local cache;
[0117] When it is detected that the network connection of the vehicle is disconnected, a second connection identifier of the vehicle is obtained, and a query and match is performed according to the second connection identifier to obtain the vehicle number of the vehicle.
[0118] In the vehicle management device of the operation platform provided by the present invention, when recording the online vehicles of each tenant on the multi-tenant operation platform, the vehicle number of the vehicle is determined according to the connection identifier of the vehicle, and then the operation tenant associated with the vehicle is determined, and then the json file used to record the online information of the vehicle is obtained according to the public network address used by the operation platform, and the json file is updated according to the status of the vehicle, so that when performing online vehicle statistics, the number of online vehicles of each operation tenant is obtained by obtaining the json file and traversing the information recorded in the json file. Through the management and control of the json file of the temporary node, the online status of the vehicle is updated in real time, so that when performing online vehicle statistics, the statistics and recording of the online vehicles of each tenant can be completed more quickly and accurately, and the timeliness and accuracy of online vehicle statistics are improved.
[0119] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 complete mutual communication through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the vehicle management method of the operation platform, the method comprising: determining the vehicle number of the vehicle according to the connection identifier of the vehicle; determining the operation tenant associated with the vehicle according to the vehicle number; obtaining the json file associated with the first temporary node corresponding to the public network address, wherein the public network address corresponds to the operation platform connected to the operation tenant; updating the json file according to the vehicle status of the vehicle, and storing the updated json file in the first temporary node, and obtaining the json file of the second temporary node associated with the operation platform when performing online vehicle statistics, and determining the number of online vehicles of each operation tenant in the operation platform.
[0120] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in 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.
[0121] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the vehicle management method of the operation platform provided by the above methods, the method including: determining the vehicle number of the vehicle according to the vehicle connection identifier; determining the operation tenant associated with the vehicle according to the vehicle number; obtaining a json file associated with a first temporary node corresponding to a public network address, wherein the public network address corresponds to the operation platform connected to the operation tenant; updating the json file according to the vehicle status of the vehicle, and storing the updated json file in the first temporary node, and obtaining the json file of the second temporary node associated with the operation platform when performing online vehicle statistics, and determining the number of online vehicles of each operation tenant in the operation platform.
[0122] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the vehicle management method of the operation platform provided by the above-mentioned methods, the method comprising: determining the vehicle number of the vehicle according to the connection identifier of the vehicle; determining the operation tenant associated with the vehicle according to the vehicle number; obtaining a json file associated with a first temporary node corresponding to a public network address, wherein the public network address corresponds to the operation platform connected to the operation tenant; updating the json file according to the vehicle status of the vehicle, and storing the updated json file in the first temporary node, and obtaining the json file of the second temporary node associated with the operation platform when performing online vehicle statistics, to determine the number of online vehicles of each operation tenant in the operation platform.
[0123] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0125] 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vehicle management method for an operation platform, characterized in that: include: Determining the vehicle number of the vehicle according to the connection identifier of the vehicle; Determining, according to the vehicle number, an operating tenant associated with the vehicle; Obtain a json file associated with a first temporary node corresponding to a public network address, wherein the public network address corresponds to an operation platform connected to the operation tenant; According to the vehicle status of the vehicle, the json file is updated, and the updated json file is stored in the first temporary node, and when performing online vehicle statistics, the json file of the second temporary node associated with the operation platform is obtained to determine the number of online vehicles of each operation tenant in the operation platform; Wherein, determining the operating tenant associated with the vehicle according to the vehicle number includes: According to the vehicle number, a query and match is performed in a preset association list to determine an operating tenant identifier that matches the vehicle number; Determining, according to the operating tenant identifier, an operating tenant associated with the vehicle; The step of obtaining the json file associated with the first temporary node corresponding to the public network address includes: Obtaining a public network address connected to an operation platform, and determining whether the public network address is a temporary node associated with the operation platform, wherein the operation platform includes the operation tenant; When it is determined that the public network address is a temporary node associated with the operation platform, obtaining a json file associated with a first temporary node corresponding to the public network address; When it is determined that the public network address is not a temporary node associated with the operation platform, a json file associated with a corresponding first temporary node is obtained according to the public network address.
2. The vehicle management method of the operation platform according to claim 1, characterized in that: The obtaining of a json file associated with the first temporary node corresponding to the public network address includes: Send instruction information for creating a first temporary node corresponding to the public network address, and receive a json file of the first temporary node returned in response to the instruction information.
3. The vehicle management method of the operation platform according to claim 1, characterized in that: The updating of the json file according to the vehicle status of the vehicle includes: Obtain the json value contained in the json file, and obtain the vehicle status of the vehicle, wherein the vehicle status includes an online status and an offline status; The json value is updated according to the vehicle status.
4. The vehicle management method of the operation platform according to claim 3, characterized in that: The updating of the json value according to the vehicle status includes: When it is determined that the vehicle status is an online status, obtaining a json value corresponding to the json file, and adding one to the json value to obtain an updated json value; When it is determined that the vehicle status is offline, the json value corresponding to the json file is obtained, and the json value is subtracted by one to obtain an updated json value.
5. The vehicle management method of the operation platform according to claim 1, characterized in that: The step of determining the vehicle number of the vehicle according to the connection identifier of the vehicle includes: When receiving a login request from a vehicle, obtaining the vehicle number of the vehicle, and associating the first connection identifier marking the vehicle with the vehicle identifier, and storing them in a local cache; When it is detected that the network connection of the vehicle is disconnected, a second connection identifier of the vehicle is obtained, and a query and match is performed according to the second connection identifier to obtain the vehicle number of the vehicle.
6. A vehicle management device for an operation platform, characterized in that: include: A login receiving module, used to receive a login message sent by a vehicle and obtain the vehicle number contained in the login message; A platform determination module, configured to determine an operating tenant associated with the vehicle according to the vehicle number; A file acquisition module, used to acquire a json file associated with a first temporary node corresponding to a public network address, wherein the public network address corresponds to an operation platform connected to the operation tenant; A data update module, used to update the json file according to the vehicle status of the vehicle, store the updated json file in the first temporary node, and obtain the json file of the second temporary node associated with the operation platform when performing online vehicle statistics, and determine the number of online vehicles of each operation tenant in the operation platform; Wherein, determining the operating tenant associated with the vehicle according to the vehicle number includes: According to the vehicle number, a query and match is performed in a preset association list to determine an operating tenant identifier that matches the vehicle number; Determining, according to the operating tenant identifier, an operating tenant associated with the vehicle; The step of obtaining the json file associated with the first temporary node corresponding to the public network address includes: Obtaining a public network address connected to an operation platform, and determining whether the public network address is a temporary node associated with the operation platform, wherein the operation platform includes the operation tenant; When it is determined that the public network address is a temporary node associated with the operation platform, obtaining a json file associated with a first temporary node corresponding to the public network address; When it is determined that the public network address is not a temporary node associated with the operation platform, a json file associated with a corresponding first temporary node is obtained according to the public network address.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the vehicle management method of the operation platform as described in any one of claims 1 to 5 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the vehicle management method of the operation platform as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Internet of Things cloud management method and system
CN112087499A
Statistical method and device for online number of vehicles, server and storage medium
CN114625777A