Vehicle instance management method, vehicle instance acquisition method, equipment and medium
By creating a cloud instance pool that matches multiple vehicle models in the cloud server in advance, and quickly allocating target instances to on-board devices, the problem of time-consuming establishment of on-board devices and cloud servers is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202411593711.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-07
AI Technical Summary
When an on-board device requests a cloud server to establish an association, there is a problem that the association is time-consuming and affects the user experience.
Create a cloud instance pool that matches multiple vehicle models in advance in the cloud server. By determining the target instance pool that matches the vehicle model from the pre-created multiple cloud instance pools, quickly allocate the target instance to the on-board device.
It effectively avoids the time-consuming problem of creating an instance after the instance allocation request, reduces user login time, and improves user experience.
Smart Images

Figure CN119402555A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of instance management, and in particular to a vehicle instance management method, a vehicle instance acquisition method, a device and a medium. Background Art
[0002] With the continuous development of cloud technology, more and more manufacturers are deploying some services in the cloud to achieve seamless connection between multiple devices and between devices and the cloud, shield the differences in terminal capabilities of different devices, and thus realize digital twins.
[0003] Currently, when a new user logs in to a cloud instance for the first time on a vehicle-mounted device, it is necessary to request a cloud server to associate the vehicle-mounted device with the cloud. However, when the vehicle-mounted device requests the cloud server to associate the vehicle-mounted device with the cloud, the association establishment takes a long time, which affects the user experience. Summary of the invention
[0004] In view of this, the present application provides a vehicle instance management method, a vehicle instance acquisition method, a device and a medium, which can solve the current problem that the establishment of the association takes a long time and affects the user experience when the vehicle-mounted device requests the cloud server to realize the association between the vehicle-mounted device and the cloud.
[0005] An embodiment of the present application provides a vehicle instance management method, which is applied to a cloud server, and the method includes: obtaining a vehicle model of the vehicle in response to an instance allocation request of an on-board device installed in a vehicle; determining a target instance pool matching the vehicle model from a pre-created cloud instance pool, wherein the cloud instance pool has multiple instances; selecting the instance in the target instance pool as the target instance, and allocating the target instance to the on-board device.
[0006] Compared with the related art, the embodiment of the present application has at least the following advantages: a cloud instance pool matching multiple vehicle models is created in advance on the cloud server, so that when the vehicle-mounted device needs to obtain an instance and sends an instance allocation request to the cloud server, the target instance pool matching the vehicle model is determined from the pre-created multiple cloud instance pools, thus avoiding the problem of long time spent on instance creation after the vehicle-mounted device generates an instance allocation request. Thus, the user experience is improved.
[0007] In some possible implementations, after selecting the instance in the target instance pool as the target instance and assigning the target instance to the vehicle-mounted device, it includes: detecting whether the target instance is successfully assigned to the vehicle-mounted device; if it is detected that the target instance is successfully assigned to the vehicle-mounted device, creating an initial instance matching the vehicle model; and adding the initial instance to the target instance pool.
[0008] In some possible implementations, after detecting whether the target instance is successfully allocated to the vehicle-mounted device, the method further includes: if it is detected that the target instance is not successfully allocated to the vehicle-mounted device, returning the target instance to the target instance pool.
[0009] In some possible implementations, the remaining number of instances of the instances in the target instance pool is obtained; based on the remaining number of instances, the number of newly added instances is calculated; it is detected whether the number of newly added instances is greater than a preset new threshold; if it is detected that the number of newly added instances is greater than the preset new threshold, the initial instance is created.
[0010] In some possible implementations, the calculating the number of newly added instances based on the remaining number of instances includes: obtaining the instance capacity of the target instance pool; and taking the difference between the instance capacity and the remaining number of instances as the number of newly added instances.
[0011] In some possible implementations, before obtaining the remaining number of instances of the instance in the target instance pool, it includes: adding a distributed lock to the target instance pool; after detecting whether the number of newly added instances is greater than a preset new threshold, it also includes: if it is detected that the number of newly added instances is less than or equal to the preset new threshold, releasing the distributed lock of the target instance pool.
[0012] In some possible implementations, the selecting the instance in the target instance pool as the target instance and allocating the target instance to the vehicle-mounted device includes: selecting the instance in the target instance pool as the target instance and adding a distributed lock to the target instance; and allocating the locked target instance to the vehicle-mounted device.
[0013] The second aspect of the present application discloses a vehicle instance acquisition method, which is applied to a vehicle-mounted device, including: sending an instance allocation request and the vehicle model of the vehicle to a cloud server; obtaining a target instance determined by the cloud server, wherein the cloud server determines a target instance pool that matches the vehicle model from a pre-created cloud instance pool, and selects an instance in the target instance pool as the target instance, and the cloud instance pool has multiple instances.
[0014] The third aspect of the present application discloses an electronic device, which includes a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call the instructions in the memory so that the electronic device executes the above-mentioned vehicle instance management method or vehicle instance acquisition method.
[0015] A fourth aspect of the present application discloses a computer storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned vehicle instance management method or vehicle instance acquisition method.
[0016] It can be understood that the vehicle instance acquisition method of the second aspect, the electronic device of the third aspect, and the computer storage medium of the fourth aspect provided above all correspond to the method of the first aspect mentioned above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of a vehicle instance management method according to an embodiment of the present application.
[0018] Figure 2 Shows Figure 1 A schematic diagram of the process after the target instance is assigned to the vehicle-mounted device in the vehicle instance management method.
[0019] Figure 3 It is a flowchart of a vehicle instance acquisition method according to an embodiment of the present application.
[0020] Figure 4 It is a schematic diagram of the interaction between a cloud server and an in-vehicle device according to an embodiment of the present application.
[0021] Figure 5 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the implementation methods of the present application and the features in the implementation methods can be combined with each other without conflict.
[0023] In the following description, many specific details are set forth to facilitate a full understanding of the present application. The described implementations are only part of the implementations of the present application, rather than all the implementations.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0025] It should be further noted that, in this article, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0026] In this application, "at least one" means one or more, and "more" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0027] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0028] Please refer to Figure 1 , is a flow chart of the vehicle instance management method provided in an embodiment of the present application, and this embodiment is applied to the cloud. Specifically, it can be applied to a cloud server. The cloud is connected to a vehicle-mounted device provided in the vehicle. In this embodiment, the vehicle-mounted device is a vehicle-mounted computer. In other embodiments, the vehicle-mounted device may also be other electronic devices besides the vehicle-mounted computer, as long as it can be connected to the cloud.
[0029] The cloud is a software platform that uses application virtualization technology, integrating multiple functions such as software search, download, use, management, and backup. Through this platform, all kinds of commonly used software can be encapsulated in an independent virtualized environment, so that the application software will not be coupled with the system, achieving the purpose of green software use. At present, more and more car manufacturers are also choosing to deploy some services in the cloud to achieve seamless connection between multiple devices and between devices and the cloud, shielding the differentiation of terminal capabilities of different devices. Thereby improving the user experience.
[0030] The cloud may include an independent server, or a server network or server cluster composed of servers. For example, the cloud described in the embodiments of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0031] The vehicle instance management method comprises the following steps: Step 101: In response to an instance allocation request of an on-board device installed in a vehicle, obtain a vehicle model of the vehicle.
[0032] In some embodiments, an instance is a virtualized computing environment. In this embodiment, an instance is a collection of a group of related applications.
[0033] In some embodiments, when a user logs in to the vehicle-mounted device for the first time, the vehicle-mounted device sends a connection request to the cloud server. After the vehicle-mounted device successfully associates with the cloud instance to achieve instance binding between the person and the vehicle, the user can install the required application on the vehicle-mounted device. In other words, in order for the vehicle-mounted device to successfully associate with the cloud instance, the vehicle-mounted device needs to send an instance allocation request to the cloud server to achieve instance binding between the person and the vehicle. The vehicle-mounted device sends an instance allocation request to the cloud server, and the instance allocation request carries the vehicle model of the vehicle in which the vehicle-mounted device is located. The cloud server responds to the instance allocation request of the vehicle-mounted device and receives the vehicle model.
[0034] Step 102: Determine a target instance pool that matches the vehicle model from a pre-created cloud instance pool, wherein the cloud instance pool has multiple instances.
[0035] In some embodiments, different vehicles have different vehicle models. Therefore, one or more cloud instance pools can be created in advance on the cloud server, and each cloud instance pool corresponds to a vehicle model. Moreover, each cloud instance pool has multiple instances, and multiple instances in a cloud instance pool are stored in the form of queues. In this embodiment, multiple instances in the cloud instance pool can be stored in the form of Redis queues. Among them, using Redis queues for data storage has the advantages of not being limited by the memory limit of the Java Virtual Machine (java virtual machine), the influence of persistence, guaranteed data security, and meeting the orderliness of messages.
[0036] It should be noted that multiple instances in the same cloud instance pool are stored in the form of a queue, so that the multiple instances in the cloud instance pool are first-in-first-out, to ensure that the instance created first in the cloud instance pool is first allocated to the vehicle-mounted device.
[0037] The number of cloud instance pools is the same as the number of vehicle models. For example, a vehicle model library can be created in advance. When the number of vehicle models in the vehicle model library is 800, the number of cloud instance pools pre-created on the cloud server is also 800. When the number of vehicle models in the vehicle model library increases, a cloud instance pool matching the newly added vehicle models can be pre-created in the cloud instance pool in advance.
[0038] The number of instances in the cloud instance pool is set according to the actual instance acquisition requirements. For example, in high concurrency, there are often 1,000 instance allocation requests for a certain vehicle model. At this time, the number of instances in the cloud instance pool can be set to 1,000 or 1,200. That is, the number of instances in the cloud instance pool should be greater than or equal to the maximum number of instance allocation requests in high concurrency.
[0039] It is worth mentioning that in order to facilitate the configuration and adjustment of the cloud instance pool in the cloud server, a cloud management terminal is provided, on which cloud instance pools corresponding to different vehicle models can be set. In other words, if the number of vehicle models in the vehicle model library increases, a cloud instance pool matching the newly added vehicle models can be created in advance on the cloud management terminal. Moreover, the number of instances in each cloud instance pool can be set according to the maximum number of instance allocation requests under high concurrency.
[0040] Step 103: Select an instance in the target instance pool as the target instance, and allocate the target instance to the vehicle-mounted device.
[0041] In this embodiment, in order to ensure that the first created instance is allocated first, the data of the cloud instance pool is stored in the form of a queue. Therefore, when determining the target instance, an instance is taken out of the queue as the target instance according to the order of the pre-created instances in the queue, so that multiple instances in the target instance pool are taken out according to the first-in-first-out principle.
[0042] In other embodiments, if the data storage method of the cloud instance pool is other than the queue form, when determining the target instance, any instance in the target instance pool may be randomly selected as the target instance. This application is not limited to this.
[0043] Since the data of the cloud instance pool is stored in the form of Redis queues, Redis is a high-performance in-memory database that supports distributed deployment. Distributed locks can be implemented through Redis atomic operations, and keyword expiration time settings are supported. It is not prone to deadlock and has high performance and high availability.
[0044] In some embodiments, when multiple onboard devices of multiple vehicles of the same vehicle model simultaneously send instance allocation requests to the cloud server and simultaneously seize the same cloud instance pool, in order to avoid resource conflicts and data inconsistencies, a distributed lock is required. Distributed locks have the advantages of mutual exclusion, no dead-many, fairness, reentrancy, and high availability.
[0045] In this embodiment, an instance in the target instance pool is selected as the target instance, and a distributed lock is added to the target instance. Then, the locked target instance is allocated to the vehicle-mounted device. The use of distributed locks belongs to the prior art and will not be described in detail in this application.
[0046] For example, when a vehicle-mounted device sends an instance allocation request to a cloud server, the cloud server obtains the vehicle model from the instance allocation request. Then, based on the vehicle model, the target instance pool that matches the vehicle model is determined. When multiple vehicle-mounted devices of the same vehicle model send instance allocation requests to the cloud server at the same time, in order to avoid resource conflicts and data inconsistencies, after selecting an instance in the target instance pool as the target instance, a distributed lock is added to the target instance. Then, the locked target instance is allocated to the vehicle-mounted device.
[0047] It should be noted that in order to avoid data loss in multiple cloud instance pools, the data in multiple cloud instance pools are saved to a preset database. The preset database can be stored in a local server or a cloud server. This application does not limit the type and storage location of the preset database, and it can be set according to actual storage requirements.
[0048] Compared with the related art, the embodiment of the present application has at least the following advantages: a cloud instance pool matching multiple vehicle models is created in advance on the cloud server, so that when the vehicle-mounted device needs to obtain an instance and sends an instance allocation request to the cloud server, the target instance pool matching the vehicle model is determined from the pre-created multiple cloud instance pools. The problem of long time spent on instance creation after the vehicle-mounted device generates an instance allocation request is avoided. Thus, the user login time is reduced and the user experience is improved.
[0049] Please refer to Figure 2 , Figure 2 This is a flow chart of the target instance allocated to the vehicle-mounted device according to an embodiment of the present application. This embodiment is applied to the cloud server, and the specific process is as follows Figure 2 As shown, the following steps are included: Step 201: Check whether the target instance is successfully assigned to the vehicle-mounted device.
[0050] In some embodiments, after the cloud server assigns the target instance to the vehicle-mounted device, it is necessary to confirm whether the target instance is successfully assigned to the vehicle-mounted device. When the target instance is successfully assigned to the vehicle-mounted device, it indicates that the binding between the person and the vehicle instance is successful, and the user can request and install the required application from the cloud server on the vehicle-mounted device. When the target instance is not successfully assigned to the vehicle-mounted device, it indicates that the binding between the person and the vehicle instance fails, and the user cannot request and install the required application from the cloud server on the vehicle-mounted device for the time being.
[0051] Step 202: If it is detected that the target instance is successfully assigned to the vehicle-mounted device, an initial instance matching the vehicle model is created.
[0052] As mentioned above, if the target instance is successfully allocated to the vehicle device, the user can request and install the required application from the cloud server on the vehicle device. At this time, the number of instances in the cloud instance pool that matches the vehicle model is reduced. In order to avoid other vehicle devices sending instance allocation requests to the cloud server, the cloud server can allocate the corresponding instance to the vehicle device in time. It is necessary to add the corresponding instance in time so that the number of instances in the cloud instance pool is always equal to the preset number threshold. Among them, the preset number threshold is the maximum number of instance allocation requests under high concurrency.
[0053] The following are the steps to configure instances in a cloud instance pool in real time: In some embodiments, the number of remaining instances of instances in the target instance pool is obtained. Based on the number of remaining instances, the number of newly added instances is calculated. In this embodiment, the instance capacity of the target instance pool is obtained. The difference between the instance capacity and the number of remaining instances is used as the number of newly added instances. In this embodiment, the instance capacity is equal to a preset number threshold. It is detected whether the number of newly added instances is greater than the preset new threshold. If it is detected that the number of newly added instances is greater than the preset new threshold, an initial instance is created.
[0054] In some embodiments, when multiple on-board devices of the same vehicle model send instance allocation requests to the cloud server at the same time, a distributed lock is required to avoid instance allocation failure or data inconsistency. Specifically, before obtaining the number of remaining instances in the target instance pool, a distributed lock is added to the target instance pool. If it is detected that the number of newly added instances is less than or equal to the preset new threshold, the distributed lock of the target instance pool is released.
[0055] In this embodiment, the value of the preset new addition threshold is 0. When the number of new instances is greater than 0, it indicates that a new instance is required. Conversely, when the number of new instances is less than or equal to 0, it indicates that a new instance is not required. In other embodiments, the preset new addition threshold may also be other values. For example, when a plurality of instances are added in batches each time an instance is added, the preset new addition threshold may be set to 5 or 10. This application does not specifically limit the specific value of the preset new addition threshold.
[0056] It should be noted that the instance capacity of each cloud instance pool can be within the preset instance range, and when additional instances are needed, multiple instances can be added in batches. For example, the instance capacity of each cloud instance pool can be set within 2000 to 3000, and 10 instances can be added in batches each time. In this case, the preset additional threshold can be set to 10.
[0057] Step 203: Add the initial instance to the target instance pool.
[0058] In some embodiments, the newly added initial instance is added to the target instance pool to increase the number of instances in the target instance pool to avoid request failure when other vehicle-mounted devices send instance allocation requests to the cloud server.
[0059] Step 204: If it is detected that the target instance is not successfully allocated to the vehicle-mounted device, the target instance is returned to the target instance pool.
[0060] As mentioned above, when the target instance is not successfully assigned to the vehicle device, it indicates that the binding of the person-vehicle instance relationship has failed. The target instance needs to be put back into the target instance pool so that when other vehicle devices send instance allocation requests to the cloud server, the cloud server can allocate the instance to the vehicle device in time.
[0061] Compared with the related art, the embodiment of the present application has at least the following advantages: after the cloud server allocates the target instance to the vehicle-mounted device, it detects whether the target instance is successfully allocated to the vehicle-mounted device, and determines whether to create an initial instance or put the target instance back to the target instance pool based on the detection result, so as to avoid the situation where the target instance is occupied when it is not successfully allocated to the vehicle-mounted device, thereby affecting the instance allocation request of other vehicle-mounted devices. The utilization rate of the instance is improved.
[0062] Please refer to Figure 3 , Figure 3 It is a flowchart of a vehicle instance acquisition method provided in an embodiment of the present application.
[0063] This embodiment is applied to an in-vehicle device. Specifically, the in-vehicle device may be a vehicle computer. The specific process is as follows: Figure 3 As shown, the following steps are included: Step 301: Send an instance allocation request and the vehicle model of the vehicle to a cloud server.
[0064] In some embodiments, when a user needs to log in to the in-vehicle device for the first time to install a required application, the in-vehicle device sends an instance allocation request and the vehicle model of the vehicle to the cloud server.
[0065] Step 302: Obtain a target instance determined by the cloud server, wherein the cloud server determines a target instance pool that matches the vehicle model from a pre-created cloud instance pool, and selects an instance in the target instance pool as the target instance, wherein the cloud instance pool has multiple instances.
[0066] In some embodiments, the cloud server pre-creates one or more cloud instance pools, and each cloud instance pool corresponds to a vehicle model. Each cloud instance pool has multiple instances. The steps of the cloud server pre-creating the cloud instance pool and determining the target instance are described in detail above, and will not be repeated here to avoid repetition.
[0067] Compared with the related art, the embodiment of the present application has at least the following advantages: when a user needs to log in to the vehicle-mounted device for the first time to install the required application, the vehicle-mounted device sends an instance allocation request and the vehicle model of the vehicle to the cloud server. The vehicle-mounted device can obtain the instance pre-created by the cloud server as the target instance, which reduces the time for the first person-vehicle instance binding and improves the user experience.
[0068] Please refer to Figure 4 , is a schematic diagram of the interaction between the cloud server and the vehicle-mounted device provided in the embodiment of the present application. The specific steps are as follows: Step S1: The vehicle-mounted device sends an instance allocation request to the cloud server.
[0069] In some embodiments, when a user logs in to the vehicle-mounted device for the first time, the vehicle-mounted device needs to send a connection request to the cloud server, and after the vehicle-mounted device successfully associates with the cloud instance to implement the instance binding between the user and the vehicle. Specifically, the vehicle-mounted device needs to send an instance allocation request to the cloud server.
[0070] In this embodiment, the instance allocation request carries the vehicle model of the vehicle in which the vehicle-mounted device is located.
[0071] Step S2: The cloud server determines a target instance pool that matches the vehicle model from the pre-created cloud instance pool.
[0072] The cloud server may pre-create one or more cloud instance pools. Each cloud instance pool corresponds to a vehicle model. The creation content of the cloud instance pool can refer to the description in the above embodiment, and will not be repeated here to avoid repetition.
[0073] Step S3: The cloud server selects an instance in the target instance pool as the target instance, and allocates the target instance to the vehicle-mounted device.
[0074] In this embodiment, when the data in the cloud instance pool is stored in the form of a queue, the cloud server selects the first created instance in the target instance pool as the target instance to ensure that the first created instance is first allocated to the vehicle-mounted device.
[0075] Step S4: Detect whether the target instance is successfully assigned to the vehicle-mounted device, and determine whether to create an initial instance matching the vehicle model based on the detection result.
[0076] In order to ensure the utilization rate of the instance, after allocating the target instance to the vehicle-mounted device, the cloud server also needs to detect whether the target instance is successfully allocated to the vehicle-mounted device, and determine whether to create an initial instance matching the vehicle model based on the detection result.
[0077] Specifically, when it is detected that the target instance is successfully assigned to the vehicle device, it indicates that the target instance and the vehicle device are successfully associated, and the user can use the vehicle device to access the content in the cloud server, thereby installing the required application on the vehicle device. At the same time, an initial instance matching the vehicle model is created. The initial instance is added to the target instance pool. The steps for creating the initial instance can refer to the above content.
[0078] When it is detected that the target instance is not successfully allocated to the vehicle device, it indicates that the target instance and the vehicle device have not been successfully associated, and the user cannot use the vehicle device to access the content in the cloud server to install the required application on the vehicle device. At this time, the user can use the vehicle device to send an instance allocation request to the cloud server again. The cloud server needs to put the target instance pool back to the target instance pool to ensure that other vehicle devices send instance allocation requests to the cloud server, and the cloud server can allocate the instance to the vehicle device in time, thereby improving the utilization rate of the instance.
[0079] Compared with the related art, the embodiment of the present application has at least the following advantages: a cloud instance pool matching multiple vehicle models is created in advance on the cloud server, so that when the vehicle-mounted device needs to obtain an instance and sends an instance allocation request to the cloud, the target instance pool matching the vehicle model is determined from the pre-created multiple cloud instance pools. The problem of long time spent on instance creation after the vehicle-mounted device generates an instance allocation request is avoided. Thus, the user login time is reduced and the user experience is improved.
[0080] Please refer to Figure 5 , is a schematic diagram of the hardware structure of the electronic device 1000 provided in the embodiment of the present application. Figure 5 As shown, the electronic device 1000 may include a processor 1001 and a memory 1002. The memory 1002 is used to store one or more computer programs 1003. The one or more computer programs 1003 are configured to be executed by the processor 1001. The one or more computer programs 1003 include instructions, and the above instructions can be used to implement the above method in the electronic device 1000.
[0081] It is understandable that the structure shown in this embodiment does not constitute a specific limitation on the electronic device 1000. In other embodiments, the electronic device 1000 may include more or fewer components than shown, or combine or separate some components, or arrange the components differently.
[0082] The processor 1001 may include one or more processing units, for example, the processor 1001 may include an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0083] The processor 1001 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 1001 is a cache memory. The memory may store instructions or data that the processor 1001 has just used or circulated. If the processor 1001 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 1001, and thus improves the efficiency of the system.
[0084] In some embodiments, the processor 1001 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and / or a USB interface, etc.
[0085] In some embodiments, processor 1001 is used to execute acceleration schemes such as single instruction multiple data (SIMD) and very long instruction word (VLIW).
[0086] In some embodiments, memory 1002 may include high-speed random access memory and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0087] This embodiment also provides a storage medium, in which computer instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the vehicle instance management method in the above-mentioned embodiment.
[0088] Among them, the electronic device and storage medium provided in this embodiment are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0089] In practical applications, the above functions can be distributed to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0090] In several embodiments provided in the present application, the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are schematic. For example, the division of the modules or units is a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0091] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0092] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0093] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A vehicle instance management method, characterized in that: Applied to cloud servers, including: In response to an instance allocation request of an onboard device installed in a vehicle, obtaining a vehicle model of the vehicle; Determine a target instance pool matching the vehicle model from a pre-created cloud instance pool, wherein the cloud instance pool has a plurality of instances; The instance in the target instance pool is selected as a target instance, and the target instance is allocated to the vehicle-mounted device.
2. The vehicle instance management method according to claim 1, characterized in that: After selecting the instance in the target instance pool as the target instance and allocating the target instance to the vehicle-mounted device, the method further includes: Detecting whether the target instance is successfully assigned to the vehicle-mounted device; If it is detected that the target instance is successfully assigned to the vehicle-mounted device, creating an initial instance matching the vehicle model; The initial instance is added to the target instance pool.
3. The vehicle instance management method according to claim 2, characterized in that: After detecting whether the target instance is successfully assigned to the vehicle-mounted device, the method further includes: If it is detected that the target instance is not successfully allocated to the vehicle-mounted device, the target instance is returned to the target instance pool.
4. The vehicle instance management method according to claim 2, characterized in that: The creating an initial instance matching the vehicle model comprises: Obtaining the number of remaining instances of the instance in the target instance pool; Calculate the number of newly added instances based on the remaining number of instances; Detecting whether the number of newly added instances is greater than a preset new threshold; If it is detected that the number of newly added instances is greater than the preset new threshold, the initial instance is created.
5. The vehicle instance management method according to claim 4, characterized in that: The calculating the number of newly added instances based on the remaining number of instances includes: Obtaining the instance capacity of the target instance pool; The difference between the instance capacity and the remaining number of instances is used as the number of newly added instances.
6. The vehicle instance management method according to claim 4, characterized in that: Before obtaining the number of remaining instances of the instance in the target instance pool, the method includes: Adding a distributed lock to the target instance pool; After detecting whether the number of newly added instances is greater than a preset new threshold, the method further includes: If it is detected that the number of newly added instances is less than or equal to the preset new threshold, the distributed lock of the target instance pool is released.
7. The vehicle instance management method according to claim 1, characterized in that: The selecting the instance in the target instance pool as the target instance and allocating the target instance to the vehicle-mounted device includes: Selecting the instance in the target instance pool as the target instance, and adding a distributed lock to the target instance; The locked target instance is allocated to the vehicle-mounted device.
8. A vehicle instance acquisition method, characterized in that: Applied to vehicle-mounted equipment, including: sending an instance allocation request and a vehicle model of the vehicle to a cloud server; Obtain a target instance determined by the cloud server, wherein after the cloud server determines a target instance pool matching the vehicle model from a pre-created cloud instance pool, an instance in the target instance pool is selected as the target instance, and the cloud instance pool has a plurality of such instances.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the electronic device executes the vehicle instance management method described in any one of claims 1 to 7 or the vehicle instance acquisition method described in claim 8.
10. A computer storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the vehicle instance management method according to any one of claims 1 to 7 or the vehicle instance acquisition method according to claim 8.
Citation Information
Patent Citations
Resource allocation method and device
CN104461744A
Cloud game operation method and device, equipment and storage medium
CN115501579A
Database scheduling method and device, equipment and storage medium
CN116954863A
Task scheduling method and device, electronic equipment and readable storage medium
CN117492940A