Vehicle-mounted service starting method and system based on container

By using startup management programs and global files to describe application properties in containers, the problem of startup association complexity between service processes under containerized deployment is solved, orderly and reliable service startup is achieved, and system availability and resource utilization are improved. Rate.

CN118567755AInactive Publication Date: 2024-08-30AUTOCORE INTELLIGENT TECH (NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411056777.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the case of containerized deployment, the complexity of the startup association and sequence relationship between service processes leads to an increase in system maintenance costs, which may cause hidden dangers to driving safety, especially in the vehicle field.

Method used

By creating multiple containers, each container contains a startup manager and a global file that describes the application's attribute information, including dependencies and startup sequence. The startup manager automatically starts the application based on this information and handles cross-container dependencies through a broadcast mechanism. Relationship, use timing thread to ensure that the application is started according to time and duration.

Benefits of technology

It simplifies the complexity of startup correlation between processes, ensures orderly and reliable startup of services, improves system availability and resource utilization, and avoids invalid resource occupation and performance degradation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567755A
    Figure CN118567755A
Patent Text Reader

Abstract

The invention provides a container-based vehicle-mounted service starting method and system.The method comprises the steps that a plurality of containers are created, each container comprises a starting management program and a global file, and the global file is used for describing attribute information of all application programs running in the containers; the attribute information of the application programs comprises a dependency relationship and / or a starting sequence among the application programs; starting each container, activating and running the starting management program in each container, loading the local global file, analyzing the attribute information of all the application programs, and starting the application programs by the starting management program according to the attribute information. According to the method, the attribute information of all the application programs is described through the global file, the attribute information comprises the dependency relationship and / or the starting sequence among the application programs, the starting execution chain is reasonably configured, the availability of the started service and the starting dependency of the service are ensured, and the starting of the service is more orderly and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a container-based vehicle service startup method and system. Background Art

[0002] In traditional process deployment, the process is directly deployed on the operating system of the physical machine, and the startup method is that the user directly starts the binary executable file stored in the file system. The startup association and sequence between processes are manually confirmed by the user. In this way, the maintenance cost and coupling of the system will be greatly increased.

[0003] Containers use virtualization technology to isolate different processes running on a host, so that processes and the host operating system are isolated from each other and do not affect each other. Such isolated processes are called containers, which have their own set of file system resources and subordinate processes.

[0004] Containerized deployment is to divide processes, and functionally related processes can be placed in one container or different containers. Although container deployment saves costs, one problem it brings is that the association and sequence of starting processes becomes more complicated. Especially in the automotive field, this complexity is more prominent, so a set of methods and systems are needed for automatic maintenance to ensure that the start and stop of service processes during the driving of the car will not pose a hidden danger to driving safety. Summary of the invention

[0005] The technical purpose of the present application is to provide a container-based vehicle service startup method, device and electronic device to address the technical problems of the complexity of the association and sequence relationship between the startup of service processes in the case of containerized deployment.

[0006] In order to achieve the above technical objectives, this application adopts the following technical solutions.

[0007] In a first aspect, the present application provides a container-based vehicle service startup method, comprising: Creating multiple containers, each of which includes a startup management program and a global file, wherein the global file is used to describe attribute information of all applications running in the container, and the attribute information of the application includes dependencies and / or startup sequence between the applications; Each of the containers is started, the startup management program in each of the containers is activated and runs, the startup management program loads the local global file, parses the attribute information of all the applications, and the startup management program starts the application according to the attribute information.

[0008] In some implementations, the attribute information of the application further includes unique identification information of each application and a path of each application.

[0009] In some implementations, the startup method further includes: after the startup management program is successfully started, loading the local global file, parsing the global file, and determining the dependency relationship between the application programs; If the startup management program determines that the application and the dependent application are in the same container, the startup management program traverses the global file, determines the attribute information of the dependent application, and starts the dependent application according to the attribute information.

[0010] In some embodiments, the startup method also includes: if the startup management program determines that the application and the dependent application are not in the same container, the startup management program initiates a first broadcast message to the broadcast address; the startup management programs of other containers receive the first broadcast message through the broadcast address, and when it is determined according to the first broadcast message that the dependent application is in the local container, the local global file is traversed to determine the attribute information of the dependent application and start it.

[0011] In some embodiments, the startup method also includes: the startup management program reads the configuration file of the application before starting the application; if the configuration file includes a startup time, the startup management program creates a first timing thread, calculates the difference between the current time and the startup time in the first timing thread, and sets a first timer according to the difference; in response to the timing result of the first timer reaching a preset time point, executes the startup task of the application.

[0012] In some embodiments, the startup method also includes: the startup management program reads the configuration file of the application before starting the application. If the configuration file includes the startup duration, the startup management program creates a second timing thread, and in the second timing thread, sets a second timer, and the second timer starts timing when executing the startup task of the application. In response to the timing result of the second timer reaching the startup duration, the startup task of the application is stopped.

[0013] In some implementations, the global file is used to describe the attribute information of the container, the attribute information of the container includes the unique identification information of the current container and the unique identification information of other containers, and the node attributes of each of the containers, the node attributes including the master node and the slave node.

[0014] In some implementations, the startup method further includes: after the startup management program is successfully started, loading the local global file, parsing the global file, and determining the node attributes of the container; The node attribute starts a management program in a container of the master node, initiates a second broadcast message to a broadcast address, and the second broadcast message is used to broadcast the start time of the first application program; In all other containers whose node attribute is a child node, a management program is started to receive the second broadcast information; The startup management program of each container starts the first application according to the startup time of the first application.

[0015] In a second aspect, the present application provides a container-based vehicle service startup system, including: a container creation module, used to create multiple containers, each of which includes a startup management program and a global file, the global file is used to describe the attribute information of all applications running in the container, and the attribute information of the application includes the dependency relationship and / or startup order between each of the applications; The container startup module is used to start each of the containers. The startup management program in each of the containers is activated and runs. The startup management program loads the local global file, parses the attribute information of all the applications, and starts the application according to the attribute information.

[0016] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a processor and a memory; wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement a container-based in-vehicle service startup method provided in any possible implementation manner of the first aspect.

[0017] Compared with the prior art, the container-based in-vehicle service startup method provided by the present application has the following beneficial technical effects: the attribute information of all applications is described through a global file, the attribute information includes the dependencies and / or startup sequence between applications, and the startup execution chain is reasonably configured to ensure the availability of the service after startup and the startup dependency of the service; the startup manager can start the application based on the dependencies and / or the correct order, which simplifies the association complexity between process startups and makes the startup of the service more orderly and reliable.

[0018] The container-based vehicle service startup system provided in the present application has the same beneficial technical effects as the container-based vehicle service startup method, and will not be described in detail. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are for explanation purposes only and are not intended to limit the scope of the present application in any way. In addition, the shapes and proportional dimensions of the components in the drawings are only for illustration purposes and are used to help understand the present application. They do not specifically limit the shapes and proportional dimensions of the components of the present application. Under the guidance of the present application, those skilled in the art can select various possible shapes and proportional dimensions to implement the present application according to specific circumstances. In the drawings: Figure 1 A schematic diagram of the principle of a container-based vehicle service startup method provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of a container-based vehicle service startup system provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0021] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features.

[0022] Containerized deployment is to divide processes and place functionally related processes in one container or different containers. Each container runs in an independent environment and will not affect each other, providing better resource isolation and security.

[0023] Although containerized deployment brings the benefit of simplified deployment, it also increases the complexity of the startup association and sequence relationship between processes. In particular, in a complex application (Application, APP), multiple containers may need to be started together to form a complete system, and there may be dependencies between these containers. In the automotive field, this complexity is even more prominent.

[0024] The embodiments of the present application provide a container-based vehicle service startup method, device and electronic device, which reasonably configure the startup execution chain, ensure the availability of the service after startup and the startup dependency of the service, and make the startup of the service more orderly and reliable.

[0025] See also Figure 1 As shown, the embodiment of the present application provides a method for starting an in-vehicle service based on a container, comprising step S1: creating multiple containers, each container including a startup management program and a global file, the global file is used to describe the attribute information of all applications running in the container, and the attribute information of the application includes the dependency relationship and / or startup sequence between the applications; Step S2: start each container, activate and run the startup management program in each container, load the local global file, parse the attribute information of all applications, and start the application according to the attribute information.

[0026] The launch manager is responsible for launching all applications listed in the global file. The global file lists the globally unique application manifest in the local container and describes the application's attribute information.

[0027] In a specific embodiment, creating a container includes: determining an application that needs to run in the container to be created; generating a global file for the container to be created; generating a container image build file based on the global file and a preset startup management program, the startup management program is used to read the global file, parse out the attribute information of all applications, and start the application according to the attribute information; building a container image based on the container image build file; creating a container based on the container image, and allocating corresponding resources (such as network resources and storage resources, etc.) to the container.

[0028] In some embodiments, each application has a configuration file that describes configuration information, which is used to specify how the application runs and configures its various settings and startup parameters. The configuration file can be packaged into the container image together with the application, or the configuration file of the application can be injected into the container by mounting a volume when the container is started.

[0029] The configuration information of the application includes, but is not limited to, startup parameters, startup cycle, startup time and / or startup duration.

[0030] A sample global file is as follows: { “container_id” : “1”, "exec_apps": [ { “name” : “app1”, "path" : " / path / to / app1", "dependence": "" }, { “name” : “app2”, "path" : " / path / to / app2", "dependence" : "container1::APP3" }, { “name” : “app3”, "path" : " / path / to / app3", "dependence" : "container2::APP6" } ] } Among them, "container_id" is the unique identification information of the container, exec_apps{} indicates the list of applications running in the container; "name" is the unique identification information of the application; "path" is the path of the application; and "dependence" indicates the dependency relationship between applications.

[0031] An example of an application configuration file is as follows: { “name” : “app1”, "argv": "-v=0.0.1", "time" : "2023 / 05 / 17 12:00:00", "duration" : "60second" } "name" is the unique identification information of the application; "argv" is the startup parameter of the application parameter; "time" is the startup time of the application; and "duration" is the startup duration of the application.

[0032] In some embodiments, the container starts and launches a startup management program. Optionally, all startup management programs are set to the same broadcast address.

[0033] Optionally, after the startup management program is successfully started, the global file is loaded, the global file is parsed, and the dependency relationship between applications is determined; if the startup management program determines that the application and the dependent application are in the same container, the startup management program traverses the global file, determines the attribute information of the dependent application and starts it.

[0034] In some embodiments, if the startup management program determines that the application and the dependent application are not in the same container, the startup management program initiates a first broadcast message to the broadcast address; the startup management programs of other containers receive the first broadcast message through the broadcast address, and when it is determined according to the first broadcast message that the dependent application is in the local container, the local global file is traversed to determine the attribute information of the dependent application and start it.

[0035] The container-based vehicle service startup method provided in the embodiment of the present application realizes the modularization of services by deploying different services or applications in separate containers; the global file is used to describe the attribute information of the application, including the dependencies and startup order between them. This enables the startup manager to accurately determine the startup order of the applications and which applications need to be started before other applications, ensuring the correct and sequential startup of the services. When an application in a container needs to depend on applications in other containers, the startup manager will initiate a broadcast message so that the containers can dynamically discover and communicate with each other.

[0036] See also Figure 1 , For example, the startup management program in container 1 traverses the first APP1 in exec_apps, finds the path where APP1 is located according to the path, and determines whether the "dependence" of APP1 has a value. If there is a value, it means that the startup of the current APP1 depends on other processes. If it is in the current container, it traverses the entire global file to find the dependent APP, and then determines whether the dependent APP has dependencies, and repeats the above search and traversal process; if the application that APP1 depends on is not in the current container, it sends the first broadcast message to the broadcast address. When the startup management program in the corresponding container 2 receives the first broadcast message, it determines that it is the container 2 where it is located that starts the APP, and then traverses the currently started APP. If it is not started, it traverses the global files in the current container 2, finds the corresponding APP and starts it, and sends a broadcast message to notify that the specified APP in the current container 2 has been started. After receiving the broadcast message, the startup management program in container 1 starts the APP and continues the subsequent traversal startup process until all APPs are started.

[0037] In some embodiments, the startup method further includes: the startup management program reads the configuration file of the application before starting the application, and if the configuration file includes the startup time, the startup management program creates a new first timing thread, calculates the difference between the current time and the startup time in the first timing thread, and sets the first timer according to the difference; in response to the timing result of the first timer reaching the preset time point, executes the startup task of the application. If the startup time point "time" is set in the configuration file of the APP, the startup management program creates a new thread, calculates the difference between the current time and "time" in the thread, and sets the timer. After the timer expires, the startup task of the process is executed.

[0038] The startup method provided in this embodiment allows each application to set the startup time according to its specific needs, so that the service can be customized according to the actual operating environment and business needs, thereby making more efficient use of system resources. By setting the startup time accurately to a specific time point, it can ensure that the application is started within the optimal time window, avoid conflicts with other high-load tasks, and improve the overall performance of the system.

[0039] In some embodiments, the startup method also includes: the startup management program reads the configuration file of the application before starting the application. If the configuration file includes the startup duration, the startup management program creates a new second timing thread. In the second timing thread, the timing starts in response to the startup task of executing the application. When the timing result reaches the startup duration, the execution of the application is stopped.

[0040] This embodiment monitors the startup time of the application program. If the application program fails to start normally within the predetermined time, the system can release the resources occupied by the application program in time so that other services or processes can use them. This avoids invalid occupation of resources and improves overall resource utilization.

[0041] In some embodiments, the attribute information of the container includes the unique identification information of the current container and the unique identification information of other containers, as well as the node attributes of each container, and the node attributes include the master node and the slave node. The startup method also includes: after the startup management program is successfully started, the local global file is loaded, the global file is parsed, and the node attributes of the container are determined; the startup management program in the container whose node attribute is the master node initiates a second broadcast message to the broadcast address, and the second broadcast message is used to broadcast the startup time of the first application; the startup management program in all other containers whose node attribute is the child node receives the second broadcast message; the startup management program of each container starts the first application according to the startup time of the first application.

[0042] In the startup method provided in the embodiment of the present application, the startup management program in the master node container broadcasts the startup time of the first application to ensure that all slave node containers can receive this information at the same time and start the first application at the same time; this synchronization helps to maintain the consistency of various components of the system and avoid potential problems caused by time differences; at the same time, since all containers start the first application at the same time, resource waste and performance degradation caused by time differences can be avoided.

[0043] Corresponding to the container-based vehicle service startup method provided in the above embodiment, the embodiment of the present application also provides a container-based vehicle service startup device, such as Figure 2 As shown, it includes a container creation module and a container startup module.

[0044] The container creation module is used to create multiple containers. Each container includes a startup management program and a global file. The global file is used to describe the attribute information of all applications running in the container. The attribute information of the application includes the dependency relationship and / or startup order between each application.

[0045] The container startup module is used to start each container. The startup management program in each container is activated and runs. The startup management program loads the local global file, parses the attribute information of all applications, and starts the application according to the attribute information.

[0046] The container-based vehicle service startup device provided in the embodiment of the present application describes the attribute information of all applications through a global file. The attribute information includes the dependency relationship and / or startup sequence between applications, and reasonably configures the startup execution chain to ensure the availability of the service after startup and the startup dependency of the service.

[0047] Those skilled in the art may further appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0048] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0049] Please refer to Figure 3 , Figure 3 The present invention provides a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, wherein the electronic device may include a processor and a memory, and may further include an information input / information output (I / O) interface and the like.

[0050] The processor is used to control the overall operation of the electronic device to complete all or part of the steps in the above-mentioned container-based vehicle service startup method; the memory is used to store various types of data to support the operation of the electronic device, and these data may include, for example, instructions for any application or method used to operate on the electronic device, and application-related data. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. One or more.

[0051] The container-based in-vehicle service startup method, device and electronic device provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the concept of the present application and should not be understood as limiting the scope of protection of the present application.

Claims

1. A container-based vehicle service startup method, characterized in that: include: Creating multiple containers, each of which includes a startup management program and a global file, wherein the global file is used to describe attribute information of all applications running in the container, and the attribute information of the application includes dependencies and / or startup sequence between the applications; Each of the containers is started, the startup management program in each of the containers is activated and runs, the startup management program loads the local global file, parses the attribute information of all the applications, and the startup management program starts the application according to the attribute information.

2. The container-based vehicle service startup method according to claim 1, characterized in that: The attribute information of the application program also includes unique identification information of each application program and a path of each application program.

3. The container-based vehicle service startup method according to claim 1, characterized in that: The startup method further comprises: after the startup management program is successfully started, loading the local global file, parsing the global file, and determining the dependency relationship between the application programs; If the startup management program determines that the application and the dependent application are in the same container, the startup management program traverses the global file, determines the attribute information of the dependent application, and starts the dependent application according to the attribute information.

4. The container-based vehicle service startup method according to claim 3, characterized in that: The startup method further includes: if the startup management program determines that the application and the dependent application are not in the same container, the startup management program initiates a first broadcast message to a broadcast address; and the startup management programs of other containers receive the first broadcast message through the broadcast address; When it is determined according to the first broadcast information that the dependent application is in a local container, the local global file is traversed to determine the attribute information of the dependent application and start it.

5. The container-based vehicle service startup method according to claim 1, characterized in that: The startup method also includes: the startup management program reads the configuration file of the application before starting the application; if the configuration file includes the startup time, the startup management program creates a first timing thread, calculates the difference between the current time and the startup time in the first timing thread, and sets a first timer according to the difference; in response to the timing result of the first timer reaching a preset time point, executes the startup task of the application.

6. The container-based vehicle service startup method according to claim 1, characterized in that: The startup method also includes: the startup management program reads the configuration file of the application before starting the application. If the configuration file includes the startup duration, the startup management program creates a second timing thread, and in the second timing thread, sets a second timer, the second timer starts timing when executing the startup task of the application, and stops executing the startup task of the application in response to the timing result of the second timer reaching the startup duration.

7. The container-based vehicle service startup method according to claim 1, characterized in that: The global file is used to describe the attribute information of the container, the attribute information of the container includes the unique identification information of the current container and the unique identification information of other containers, and the node attributes of each container, the node attributes include the master node and the slave node.

8. The container-based vehicle service startup method according to claim 7, characterized in that: The method further comprises: After the startup management program is successfully started, the local global file is loaded, the global file is parsed, and the node attributes of the container are determined; The node attribute starts a management program in a container of the master node, initiates a second broadcast message to a broadcast address, and the second broadcast message is used to broadcast the start time of the first application program; In all other containers whose node attribute is a child node, a management program is started to receive the second broadcast information; The startup management program of each container starts the first application according to the startup time of the first application.

9. A container-based vehicle service startup system, characterized in that: include: A container creation module, used to create multiple containers, each of which includes a startup management program and a global file, the global file is used to describe the attribute information of all applications running in the container, and the attribute information of the application includes the dependency relationship and / or startup sequence between the applications; The container startup module is used to start each of the containers. The startup management program in each of the containers is activated and runs. The startup management program loads the local global file, parses the attribute information of all the applications, and starts the application according to the attribute information.

Citation Information

Patent Citations

  • Service instance starting method and device, equipment and storage medium

    CN117492853A

  • State dependent optimization for sequential booting of heterogeneous systems

    US20150019851A1