Method and apparatus for starting control based on a hon gming system, medium and electronic device
By dynamically managing service startup through the service mapping table and association table of the HarmonyOS system, the problem of excessively long startup time of the roadside unit operating system has been solved, achieving efficient resource utilization and improved startup efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- VANJEE TECHNOLOGY CO LTD
- Filing Date
- 2024-12-30
- Publication Date
- 2026-07-10
AI Technical Summary
The roadside unit's operating system loads a large number of unnecessary services and applications during startup, resulting in excessive startup time, excessive resource consumption, and impact on the performance of critical applications.
A startup control method based on the HarmonyOS system is adopted, which dynamically manages service startup through service mapping tables and association tables to ensure that the startup strategy matches the system state, accurately determines the target service, and avoids unnecessary service loading.
It shortens startup time, reduces resource consumption, improves startup efficiency, reduces device power consumption and operating costs, and enhances resource utilization efficiency.
Smart Images

Figure CN122363765A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent transportation systems, and more specifically, to a startup control method, device, medium, and electronic device based on the HarmonyOS system. Background Technology
[0002] With the continuous development of IoT technology, Intelligent Transportation Systems (ITS) have become an important component of smart city development. Roadside Units (RSUs) are key devices for enabling communication between vehicles and infrastructure. HarmonyOS, a new distributed operating system developed by Huawei, is designed to provide seamless connectivity and efficient collaboration across devices, suitable for various smart devices, including roadside units. However, in practical applications of intelligent transportation, roadside units are typically deployed outdoors, with relatively limited hardware resources (such as CPU and memory). When the operating system of a roadside unit in related technologies starts up, it loads a large number of unnecessary services and applications, resulting in a relatively long startup time. Summary of the Invention
[0003] This application provides a startup control method, device, medium, and electronic device based on the HarmonyOS system, to at least solve the technical problem in the related art where the operating system of the roadside unit loads a large number of unnecessary services and applications during startup, resulting in a long startup time.
[0004] According to one aspect of the embodiments of this application, a startup control method based on the HarmonyOS system is provided, applied to a roadside unit, the method comprising:
[0005] When the roadside unit is powered on, a preliminary startup procedure is executed;
[0006] Upon completion of the initial startup procedure, the service startup management system is started. The service startup management system has a set of service mapping tables and service association tables. Each service mapping table is used to indicate a specified service to be started by the service startup management system within a preset time period. The service association tables are used to indicate services that have a relationship with each other in the service startup management system.
[0007] From the set of service mapping tables and the set of service registry, a target mapping table corresponding to the current time is determined, and from the association registry and the service association table, a target association table is determined. Each service registry in the set of service registry is used to indicate the specified service to be started by the latest recorded service startup management system within a preset time period, and the association registry is used to indicate the services with an association relationship in the latest recorded service startup management system.
[0008] Based on the target mapping table and the target association table, a set of target services to be started is determined and the set of target services is started. The set of target services includes a set of designated services, or the set of target services includes the set of designated services and a set of associated services. Each associated service in the set of associated services is associated with at least one designated service in the set of designated services.
[0009] According to another aspect of the embodiments of this application, a startup control device based on the HarmonyOS system is also provided, applied to a roadside unit, comprising:
[0010] The first execution unit is used to execute the initial startup procedure when the roadside unit is powered on;
[0011] The first startup unit is used to start the service startup management system after the initial startup procedure is completed. The service startup management system is configured with a set of service mapping tables and service association tables. Each service mapping table in the set of service mapping tables is used to indicate a specified service to be started by the service startup management system within a preset time period. The service association table is used to indicate services that have an association relationship in the service startup management system.
[0012] The first determining unit is configured to determine a target mapping table corresponding to the current time from the set of service mapping tables and the set of service registry tables, and to determine a target association table from the association registry and the service association table, wherein each service registry in the set of service registry tables is used to indicate the specified service to be started by the latest recorded service startup management system within a preset time period, and the association registry is used to indicate the services with an association relationship in the latest recorded service startup management system.
[0013] The second startup unit is configured to determine a set of target services to be started based on the target mapping table and the target association table, and to start the set of target services, wherein the set of target services includes a set of designated services, or the set of target services includes the set of designated services and a set of associated services, and each associated service in the set of associated services has an association relationship with at least one designated service in the set of designated services.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0015] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the steps in any of the method embodiments described above.
[0016] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the steps of any of the above method embodiments through the computer program.
[0017] This application enables the execution of a preliminary startup procedure when the roadside unit is powered on. Upon completion of the preliminary startup procedure, a service startup management system is initiated. This system determines the target mapping table corresponding to the current time from a set of service mapping tables and a set of service registry tables, and determines the target association table from the associated registry and service association tables. This ensures that the startup strategy matches the current system state, avoiding startup failures or service conflicts due to outdated configurations. Based on the target mapping table and target association table, a set of target services to be started can be accurately determined, including directly specified services and related services. This ensures that all necessary services are started to a certain extent, while avoiding the startup of unnecessary services, thereby shortening the startup time. This solves the technical problem in related technologies where the roadside unit's operating system loads a large number of unnecessary services and applications during startup, leading to long startup times. It improves startup efficiency. Furthermore, the exclusion of unnecessary services reduces memory and CPU usage, freeing up more system resources for the operation of target services and applications, improving resource utilization efficiency, and reducing device power consumption and operating costs. Attached Figure Description
[0018] Figure 1 This is a schematic diagram illustrating an application scenario of a startup control method based on the HarmonyOS system according to an embodiment of this application;
[0019] Figure 2 This is a flowchart illustrating an optional startup control method based on the HarmonyOS system according to an embodiment of this application;
[0020] Figure 3 This is a flowchart illustrating another optional startup control method based on the HarmonyOS system according to an embodiment of this application;
[0021] Figure 4 This is a structural block diagram of an optional startup control device based on the HarmonyOS system according to an embodiment of this application;
[0022] Figure 5 This is a computer system architecture block diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0025] According to one aspect of the embodiments of this application, a boot control method based on the HarmonyOS system is provided. Optionally, in this embodiment, the above-described boot control method based on the HarmonyOS system can be applied, but is not limited to, to applications such as... Figure 1 The hardware environment shown includes terminal device 102 and server 104. Server 104 can be connected to terminal device 102 via a network and can be used to provide services (e.g., application services, etc.) to terminal device 102 or clients installed on terminal device 102. A database can be set up on server 104 or independently of server 104 to provide data storage services for server 104.
[0026] The aforementioned network may include, but is not limited to, at least one of the following: wired network and wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), and local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity) and Bluetooth. Terminal device 102 may be, but is not limited to, PC (Personal Computer), mobile phone, tablet computer, etc. Server 104 may be, but is not limited to, cloud server, server cluster, or other server types.
[0027] The startup control method based on HarmonyOS in this application embodiment can be executed by server 104, terminal device 102, or jointly by server 104 and terminal device 102. Alternatively, the startup control method based on HarmonyOS in this application embodiment can be executed by a client installed on the terminal device 102.
[0028] Taking the startup control method based on the HarmonyOS system executed by terminal device 102 in this embodiment as an example, Figure 2 This is a flowchart illustrating an optional startup control method based on the HarmonyOS system according to an embodiment of this application, as shown below. Figure 2 As shown, the process of this method may include the following steps:
[0029] Step S202: With the roadside unit powered on, execute the initial startup procedure;
[0030] Step S204: After the initial startup procedure is completed, the service startup management system is started. The service startup management system has a set of service mapping tables and service association tables. Each service mapping table in the set of service mapping tables is used to indicate the specified service to be started by the service startup management system within a preset time period. The service association table is used to indicate the services that have a relationship in the service startup management system.
[0031] Step S206: Determine the target mapping table corresponding to the current time from a set of service mapping tables and a set of service registry tables, and determine the target association table from the association registry and service association table. Each service registry in the set of service registry tables is used to indicate the specified service to be started by the latest recorded service startup management system within a preset time period, and the association registry is used to indicate the services with association relationships in the latest recorded service startup management system.
[0032] Step S208: Based on the target mapping table and the target association table, determine a set of target services to be started, and start a set of target services. The set of target services includes a set of specified services, or the set of target services includes a set of specified services and a set of associated services. Each associated service in the set of associated services has an association relationship with at least one specified service in the set of specified services.
[0033] The startup control method based on the HarmonyOS system in this embodiment can be applied to the field of intelligent transportation, and is particularly suitable for communication scenarios between roadside units (RSUs) and on-board units (OBUs). In these scenarios, fast and secure system startup is crucial for improving transaction processing speed and reducing communication latency.
[0034] In the field of intelligent transportation, traditional operating system startup and resource allocation methods are often quite static. That is, when the system starts, it generally starts services and applications that were started before the last shutdown, in a fixed order and configuration. This can lead to long startup times and wasted resources. For example, if the system contains a large number of unnecessary services, the startup and operation of these services will consume valuable computing and network resources, affecting the performance of critical applications.
[0035] To at least partially address the aforementioned technical problems, this embodiment utilizes a dynamic service mapping table and an associated registry. This allows the roadside unit to intelligently select the target mapping table and target association table during system startup, enabling flexible service startup and management. This method not only shortens system startup time but also reduces resource consumption.
[0036] It should be noted that roadside units (RSUs) are key infrastructure in intelligent transportation systems. They are typically deployed at the roadside to communicate wirelessly with on-board units (OBUs) to enable functions such as automatic vehicle identification, information exchange, and transaction processing. An RSU typically includes a communication module, processing unit, storage device, and related software and services.
[0037] Powering on the roadside unit means that the power supply to the roadside unit is turned on, and the roadside unit begins to perform self-test and startup operations.
[0038] The initial boot process involves a series of operations during the initial startup of the HarmonyOS system used in the roadside unit, primarily consisting of kernel booting and hardware initialization. The initial boot process forms the foundation for the operating system startup of the roadside unit, providing the necessary environment and support for subsequent, more advanced services and applications.
[0039] A service startup management system is a system component responsible for managing, controlling, and optimizing the service startup process. In practice, the service startup management system can be created based on preset scripts, can be started through the HarmonyOS foundation process, or can be started without any other process.
[0040] A service mapping table can be a table that stores service startup configurations. Each service mapping table corresponds to a preset time period and records information about the specified services that should be started within that time period, including the service identifier, etc. Service mapping tables enable flexible adjustment of service startup strategies based on the current time or specific scenarios to adapt to different needs.
[0041] The service registry can contain the latest recorded service startup information, reflecting the current configuration status of the roadside unit. The service registry can be a dynamic version of the service mapping table, and can be used by the service startup management system to adjust service startup policies to adapt to changes in the system state within the roadside unit.
[0042] The service association table describes the dependencies between services within a roadside unit, recording which services are associated services—that is, the normal operation of one service depends on other services. The service association table ensures the logical order of service startup, avoiding system problems caused by missing services or incorrect dependencies.
[0043] The service registry can contain the latest recorded service startup information, reflecting the current configuration status of the roadside unit. The service registry is a dynamic version of the service mapping table and association table, and can be used by the service startup management system to adjust service startup policies to adapt to changes in the system state within the roadside unit.
[0044] For example, after the initial startup procedure is completed, the service startup management system can be activated to start the system. When the service startup management system is started, the service mapping table and service association table are loaded and parsed to determine the set of services that should be started within the current time period. Specifically, the service startup management system can have a set of service mapping tables and service association tables. Each service mapping table in the set can be used to indicate a specified service to be started by the service startup management system within a preset time period. The service association table is used to indicate services with relationships within the service startup management system. Optionally, the service startup management system can read a set of service registry entries, a set of service mapping tables, service association tables, and an association registry. Through comparison and updating, it determines the target mapping table that matches the current time from the set of service registry entries and the set of service mapping tables, and determines the target association table from the service association table and the association registry.
[0045] For example, the service startup management system determines a set of target services to be started based on the target mapping table and the target association table. This may include designated services that are started directly, as well as associated services that need to be started based on dependencies. For instance, if the transaction control service in the roadside unit needs to be started, then all encryption and decryption services related to transaction control will also be started according to the service association table. Specifically, a set of target services may include a set of designated services, or a set of target services may include a set of designated services and a set of associated services, where each associated service in the set of associated services is associated with at least one designated service in the set of designated services.
[0046] Specifically, designated services refer to services that the roadside unit's operating system plans to start within a specific preset time period according to the target mapping table. These services are directly related to the roadside unit's business needs at the current moment. For example, during weekday morning rush hour, ETC transaction control services, communication services (such as DSRC or cellular network communication), and log recording services are considered designated services.
[0047] Related services are services that depend on a designated service; that is, the normal operation of a designated service requires the support of other services or data sharing. In intelligent transportation scenarios, for example, the ETC transaction control service may rely on a security authentication service to verify the legitimacy of transactions, while the security authentication service may in turn rely on an encryption library service to perform data encryption and decryption. The existence of related services ensures the integrity and efficiency of the entire system's functionality, avoiding system failures caused by missing services or improper startup order.
[0048] The embodiments provided in this application execute a preliminary startup procedure when the roadside unit is powered on. Upon completion of the preliminary startup procedure, a service startup management system is activated. This system determines a target mapping table corresponding to the current time from a set of service mapping tables and a set of service registry tables, and determines a target association table from an association registry and a service association table. This ensures that the startup strategy matches the current system state, avoiding startup failures or service conflicts due to outdated configurations. Based on the target mapping table and the target association table, a set of target services to be started can be accurately determined, including directly specified services and related services. This ensures that all necessary services are started to a certain extent, while avoiding the startup of unnecessary services, thereby shortening the startup time to some extent. This solves the technical problem in related technologies where the roadside unit's operating system loads a large number of unnecessary services and applications during startup, leading to a long startup time. It improves startup efficiency. Furthermore, the exclusion of unnecessary services reduces memory and CPU usage, freeing up more system resources for the operation of target services and applications, improving resource utilization efficiency, and reducing device power consumption and operating costs.
[0049] In one exemplary embodiment, step S206 includes:
[0050] The service mapping table corresponding to the preset time period to which the current time belongs is determined from a set of service mapping tables, and the service registry corresponding to the preset time period to which the current time belongs is determined from a set of service registry tables, to obtain the target table pair;
[0051] If the information in the service mapping table and the service registry is consistent in the target table pair, the service mapping table in the target table pair shall be selected as the target mapping table.
[0052] If the information in the service mapping table and service registry of the target table pair is inconsistent, the service registry of the target table pair is used to update the service mapping table of the target table pair, and the updated service mapping table of the target table pair is selected as the target mapping table.
[0053] If the information in the associated registry and the service associated table is consistent, the service associated table is selected as the target associated table.
[0054] If the information in the association registry and the service association table is inconsistent, update the service association table using the association registry and select the updated service association table as the target association table.
[0055] It should be noted that a set of service mapping tables can be a list of predefined service startup configurations. Each service mapping table corresponds to a preset time period and lists the service information that needs to be started within that time period, such as the service ID. A set of service registry entries can contain the latest status and configuration information of the services currently registered in the system. Each service registry entry corresponds to a preset time period and is used to record the list of services actually running and their startup times.
[0056] Preset time periods can be defined based on time or specific events, such as peak hours on weekdays and off-peak hours on weekends and holidays. Each preset time period can have its own specific service startup requirements and service operation configurations. The preset time periods set in a set of service mapping tables and a set of service registry entries can be the same.
[0057] The target table can be a table pair consisting of a service mapping table and a service registry that correspond to a preset time period at the current time.
[0058] Optionally, a set of service registry entries, a set of service mapping tables, service association tables, and association registry entries can be configured with update timestamps, which can be used to indicate the most recent update time of the table. The update timestamps of these entries can be used to determine whether a set of service mapping tables and service association tables need to be updated. Alternatively, comparing the relevant information in the service mapping tables and service registry entries of the target table pair can determine whether the service mapping tables need to be updated. The relevant information in the service mapping tables and service registry entries can include service identifiers, service versions, service permissions, and the paths of programs the service depends on. If the relevant information in the service mapping tables and service registry entries of the target table pair is inconsistent, the service mapping tables are updated using the service registry entries of the target table pair.
[0059] By comparing the information in the association registry and the service association table, it is determined whether the service association table needs to be updated. Specifically, if the information in the association registry and the service association table is inconsistent, the service association table is updated using the association registry.
[0060] In one example, Roadside Units (RSUs) experience high traffic volume between 8:00 AM and 9:00 AM, Monday through Friday. During this period, ETC transaction processing, communication, and logging services need to be activated. The specific steps are as follows:
[0061] Step 1: After the roadside unit is powered on, select the service mapping table corresponding to the preset time period from 8:00 to 9:00 from a set of service mapping tables according to the current time (e.g., 8:15 a.m. on Monday), and at the same time determine the service registry corresponding to the same time period from a set of service registry, so as to obtain the target table pair.
[0062] Step 2: Compare the service mapping table and service registry in the target table pair to check if the information is consistent. If they are consistent, directly select the service mapping table as the target mapping table and prepare to start the service; if they are inconsistent, for example, if the logging service recorded in the service registry has been disabled, update the service mapping table with the latest service registry to reflect the current real state of the system.
[0063] Step 3: Similarly, the system checks the consistency of information in the association registry and the service association table. If they are consistent, the service association table is directly selected as the target association table; if they are inconsistent, for example, if the dependencies of the communication service have changed, the association registry is used to update the service association table to ensure the correctness of the service startup order and dependencies.
[0064] This embodiment, by comparing information in the mapping table and the registry, enables dynamic adjustment of service startup strategies. This ensures that the set of services started matches actual needs, avoiding unnecessary resource consumption and startup delays, and improving startup response speed. In cases of inconsistencies between the information in the associated registry and service association table, or between information in the target table pair, the service mapping table and service association table can be updated to ensure that the system state remains synchronized with the configuration file. This, to some extent, avoids startup failures or service conflicts caused by outdated or incorrect configuration files.
[0065] In an exemplary embodiment, determining a set of target services to be started based on a target mapping table and a target association table includes: determining a set of specified services to be started based on the target mapping table; and if it is determined based on the identification information of a set of specified services and the target association table that there are services that are associated with specified services in a set of specified services, then the services that are associated with specified services in a set of specified services are determined as a set of associated services.
[0066] It should be noted that the target mapping table can be a service startup configuration table determined based on the current time. The target mapping table can contain a list of services to be started, resource requirements, and other information to guide the service startup management system in starting services. The target association table is a configuration table of dependencies between services in the roadside unit. It can be used to indicate which services are interrelated, and whether the startup of one service may require the prior startup or support of other services. A set of specified services can be based on the services listed in the target mapping table, representing the set of services that need to be started within the current preset time period. A set of specified services is directly related to the business requirements of a specific time period. Each service has unique identification information, including service ID, name, type, etc., used to uniquely identify and locate each service in service management. If the startup of a specified service depends on other services, these other services are called associated services. The existence of associated services ensures the normal operation of services in the system and avoids system failures due to missing services or improper startup order.
[0067] In one example, the service startup management system, based on a target mapping table, first identifies a set of designated services. These services are pre-defined according to the current business needs of the roadside unit. For instance, during weekday morning rush hours, ETC transaction control services, communication services (such as DSRC and 4G / 5G communication), and logging services are necessary. Subsequently, the system checks against a target association table to see if these designated services have associated services. For example, the ETC transaction control service might depend on communication services and security authentication services, and the security authentication service might depend on encryption algorithm library services. If services associated with designated services in the target association table exist, these associated services are also identified as services to be started. In this way, all directly or indirectly dependent target services are started, ensuring the integrity of system functionality and the efficiency of transaction processing.
[0068] This embodiment utilizes a target mapping table and a target association table to precisely control which services should be started, avoiding unnecessary service loading, reducing resource consumption, and improving startup speed and system response efficiency. Simultaneously, the target association table ensures that all directly or indirectly related services are started, preventing system failures due to missing services or improper startup order, thus enhancing system stability and functional integrity.
[0069] In an exemplary embodiment, the target mapping table records the startup priority of each specified service in a set of specified services; starting a set of target services includes: if a set of target services includes a set of associated services, adjusting the startup priority of the associated services in the set of associated services according to the startup priority of the specified services associated with the associated services in the set of associated services, so that the startup priority of the associated services in the set of associated services is higher than the startup priority of the specified services associated with the associated services in the set of associated services; and starting each target service in the set of target services according to the startup priority of each target service in the set of target services.
[0070] It should be noted that the target mapping table is a configuration table used in the system to manage service startup strategies. It records the set of specified services that need to be started within a specific preset time period, as well as the startup priority of each specified service. A set of specified services includes services that need to be prioritized for startup within the current or future preset time period, based on the operational needs of the roadside unit. These services are directly related to business logic, such as ETC transaction control and DSRC communication. A set of related services: a collection of services that depend on a set of specified services; their startup or non-startation affects the normal operation of the specified services.
[0071] In the target mapping table, each specified service has a startup priority, which indicates the startup order of services managed by the system. Services with higher priority are loaded and started earlier to meet the urgency of business needs and the efficiency of resource utilization.
[0072] Specifically, target services with the same priority can be started concurrently. If the priority of the specified service corresponding to the associated service is the highest level, the priority of the specified service corresponding to the associated service can be lowered, and the priority of the associated service can be raised to the highest level.
[0073] In one example, after the roadside unit is powered on, the service startup management system first reads the target mapping table to determine a set of designated services that need to be started within the current preset time period. For example, during weekday morning rush hours, the ETC transaction control service, DSRC communication service, and log recording service need to be started first. Based on the service association table, services related to these designated services are identified, such as the security authentication service and the encryption algorithm library service. The startup priority of the associated services is then checked. If a service's priority is found to be lower than its associated designated service, its startup priority is adjusted to ensure it starts before the designated service. For example, if the ETC transaction control service has a priority of 10 and the security authentication service has a priority of 5, the system will adjust the security authentication service's priority to 11 to ensure it is ready before starting the ETC transaction control service. After the adjustment, the system starts each target service sequentially according to the modified service priorities.
[0074] This embodiment ensures that all target services start in the optimal order by adjusting the startup priority of associated services, reducing startup latency and improving device startup efficiency. Prioritizing the startup of associated services ensures that designated services receive necessary support, avoiding startup failures or operational anomalies due to missing services, and enhancing the integrity and reliability of service startup.
[0075] In an exemplary embodiment, step S202 includes: loading the kernel of the roadside unit; after the kernel is loaded, invoking an initialization process, and sequentially loading a first file system, a second file system, a hardware device interface, a system software partition, and a service configuration partition through the initialization process; wherein, the first file system is a file system running in memory of the roadside unit, the second file system is a pseudo file system that displays the kernel and process information of the roadside unit, the hardware device interface is used to establish a connection between the software system and the hardware system in the roadside unit, and the system software partition and service configuration partition are used to store the service information and configuration files of the roadside unit.
[0076] It should be noted that the kernel of the roadside unit is the core part of the operating system. It is the first component loaded during the startup process of the roadside unit and provides the basic operating environment for subsequent systems and services.
[0077] The initialization (Init) process is the first user-space process launched after the kernel is loaded. It is responsible for further initializing the system, including the first file system, second file system, hardware device interfaces, system software partitions, and service configuration partitions. The first file system (e.g., tmpfs) is the file system running in memory for the roadside unit, used to store temporary files and data. The second file system (e.g., procfs) is a pseudo-file system that displays kernel and process information for the roadside unit. The hardware device interface establishes connections between the software and hardware systems within the roadside unit, responsible for establishing and maintaining communication between them, including data input, output, and control signal transmission. In the roadside unit, the hardware device interface ensures that hardware components such as communication modules and storage devices can be effectively utilized by the software system.
[0078] The system software partition and service configuration partition can be used to store service information and configuration files for the roadside unit. The system software partition is the area within the roadside unit used to store system software, library files, and other runtime components. It contains system-level software such as the operating system, device drivers, and middleware. The service configuration partition is specifically used to store service information and configuration files for the roadside unit, including service startup parameters, permission settings, dependencies, and other data.
[0079] In this embodiment, by prioritizing the loading of the first and second file systems, the initialization process can quickly complete the system environment setup, accelerating the overall startup process of the roadside unit. By establishing hardware device interfaces, the software system within the roadside unit can access and control hardware resources more efficiently and directly, avoiding redundant hardware driver loading and improving hardware utilization efficiency.
[0080] In an exemplary embodiment, the target mapping table records the initial allocated resources for each specified service in a set of specified services; before starting a set of target services, the method further includes: allocating initial allocated resources for each target service in the set of target services;
[0081] After launching a set of target services, the above method further includes: monitoring the actual resource usage of each target service; and, if it is determined based on the actual resource usage of each target service that there is a first target service whose actual resource usage is greater than or equal to the corresponding first resource threshold, increasing the allocated resources of the first target service according to the first resource step size, wherein the first resource threshold corresponding to each target service is the product of the allocated resources of each target service and a first proportion, and the first resource step size is the product of the allocated resources of the first target service and a second proportion.
[0082] If, based on the actual resource usage of each target service, it is determined that there is a second target service whose actual resource usage is less than the corresponding second resource threshold, the allocated resources of the second target service are reduced according to the second resource step size. Here, the second resource threshold corresponding to each target service is the product of the allocated resources of each target service and the third ratio, and the second resource step size is the product of the allocated resources of the second target service and the fourth ratio.
[0083] The first proportion is greater than the third proportion, and the second proportion is greater than the fourth proportion.
[0084] It should be noted that, generally, the resources configured in roadside units are relatively low. The target mapping table can record the initial allocated resources for a set of specified services. Initial allocated resources refer to the hardware resources pre-allocated to the service when it starts. A set of specified services can be the core functions and business logic directly related to the roadside unit, such as ETC transaction processing and DSRC communication services. The initial allocated resources are the preset resource usage limit for each service at startup, which can be set based on historical data and estimated demand to ensure that the service has sufficient resources to run at startup.
[0085] The first and second resource thresholds can be used as monitoring standards for service resource usage. The first resource threshold is used to detect resource overload, and the second resource threshold is used to detect resource waste. They can be calculated based on the product of the initial allocated resources of the service and a specific ratio (first ratio, third ratio).
[0086] The first and second resource steps can be used to adjust the amount of service resources allocated when the service resource usage is detected to exceed or fall below a set threshold. The first resource step is used to increase resources, and the second resource step is used to decrease resources. They are calculated based on the product of the initial allocated resources and a specific ratio (second ratio, fourth ratio).
[0087] The first target service can be a target service whose actual resource usage is greater than or equal to the corresponding first resource threshold; the second target service can be a target service whose actual resource usage is less than the corresponding second resource threshold.
[0088] Specifically, the first, second, third, and fourth ratios can be set based on empirical values. The first ratio can be greater than the third ratio, and the second ratio can be greater than the fourth ratio.
[0089] Optionally, the roadside unit can monitor the actual resource usage of each target service in real time, or it can acquire the actual resource usage of each target service at preset time intervals. If the actual resource usage of a target service is found to be inconsistent with demand, the allocated resources for the target service can be increased or decreased. This dynamic resource monitoring and management mechanism can ensure that the roadside unit achieves efficient resource utilization in a resource-constrained environment, avoids resource waste, and meets the performance requirements of the service.
[0090] This embodiment shortens startup time and automatically addresses resource overload and waste by dynamically monitoring and adjusting service resource allocation, ensuring stable operation of the target service while reducing redundant resource allocation and improving resource utilization efficiency.
[0091] In one exemplary embodiment, the above method further includes:
[0092] When the roadside unit communicates with the cloud server, and the roadside unit passes the security verification with the cloud server, it sends service data back to the cloud server. The service data includes at least one of the following: service status information, service performance indicators, hardware resource usage information, interaction information, and environmental information.
[0093] The system receives an update instruction sent by a cloud server. The update instruction carries at least one of the following update information: first update information and second update information. The first update information is the update information predicted by the service prediction model, which inputs service data fed back by the roadside unit into the service prediction model. The service prediction model is used to predict the service demand and hardware resource allocation of the roadside unit. The first update information includes at least one of the following: identification information of the service to be started, the start priority of the service to be started, and the resource allocation of the service to be started. The second update information includes at least one of the following: a service update package and update association information of the service to be started. In response to the received update instruction, if the update information only includes the update association information of the service to be started, a set of service registry entries is not updated; if the update information includes the update association information of the service to be started, the associated registry entries are updated according to the update association information of the service to be started.
[0094] It should be noted that roadside units can communicate with cloud servers. Service data refers to information about the service's operational status, performance, and resource usage that roadside units report to the cloud server. This data can include service status information (such as whether the service is running normally), service performance metrics (such as response time and throughput), hardware resource usage information (such as CPU utilization and memory usage), interaction information (such as interactions between the vehicle and the roadside unit, between the roadside unit and the cloud server, and between the vehicle, the cloud, and the roadside unit), and environmental information (such as temperature, humidity, and network conditions). Service status information refers to the operational status of each service within the roadside unit, such as whether it is started, its runtime, and the number of errors. Service performance metrics are data used to measure the operational capabilities of the roadside unit's services, including but not limited to processing speed, latency, throughput, and success rate. Hardware resource usage information reflects the usage of the roadside unit's hardware resources (such as CPU, memory, and disk), helping to analyze the equipment's operational efficiency and resource bottlenecks. Interactive information can include interactions between the vehicle and roadside units (BSUs), between the BSUs and the cloud server, and between the vehicle, cloud, and BSUs. The interaction between the vehicle and BSUs primarily includes information for vehicle identification, status monitoring, transaction processing, information transmission, and security verification. For example, transaction processing can involve information generated from ETC transaction records processed by the BSU within the intelligent transportation system, including vehicle information, transaction amount, and transaction time. The interaction between the BSUs and the cloud server mainly includes data uploads, parameter updates, remote monitoring, and system optimization. For example, software updates, service configuration parameters, and security policies issued by the cloud server ensure the up-to-dateness and security of the BSU's functions. The interaction between the vehicle, cloud, and BSUs can be recorded during intelligent traffic management and efficient service, such as the calculation, confirmation, and payment of vehicle tolls. Through collaboration among the three terminals, a fast and secure transaction process is achieved. Real-time traffic information, weather warnings, and road conditions based on cloud data analysis are transmitted to the vehicle via the BSU to provide decision support for drivers. Environmental information can refer to the physical and network conditions of the environment in which the roadside unit is located, such as temperature, humidity, and network latency.
[0095] Service prediction models can be set up on cloud servers. They are models based on machine learning or data analysis used to predict the service demand and hardware resource allocation of roadside units. They can provide dynamic service configuration suggestions for roadside units based on factors such as historical service data, transaction patterns and environmental changes.
[0096] For example, when a roadside unit communicates with a cloud server, upon successful security verification between the roadside unit and the cloud server, it sends service data back to the cloud server. The cloud server receives the service data from the roadside unit, preprocesses it, and inputs the preprocessed service data into a service prediction model to obtain first update information. This first update information may include at least one of the following: the identifier information of the service to be started, the startup priority of the service to be started, and the resource allocation of the service to be started. If the service software version or associated configuration of the roadside unit to be updated is being considered, second update information may be generated. This second update information may be a service update package or update association information for the service to be started.
[0097] The cloud server can generate update instructions based on the update information and send them to the roadside unit. The roadside unit can respond to the received update instructions by not updating a set of service registry entries if the update information only includes update association information of the service to be started; and by updating the associated registry entries according to the update association information of the service to be started if the update information includes update association information of the service to be started.
[0098] It should be noted that updating a set of service registry entries or related registry entries requires successful security verification between the roadside unit and the cloud server. Specifically, the security verification process between the roadside unit and the cloud server can include: the cloud server receiving a connection request from the roadside unit, both parties initiating a communication handshake to confirm the establishment of the communication link, and the roadside unit generating a one-time authentication request, which may contain information such as the device ID, timestamp, random number, and encrypted signature. This one-time authentication request is sent to the cloud server, which uses pre-stored roadside unit identity information and keys to verify whether the request originates from a legitimate roadside unit. If the roadside unit is legitimate, the cloud server and the roadside unit exchange encryption keys. After successfully establishing the encryption key, all data transmission between the roadside unit and the cloud server will be encrypted to ensure that the communication content is not eavesdropped on or tampered with by third parties. During each data exchange, both the roadside unit and the cloud server sign and verify the data to ensure data integrity and the legitimacy of its origin.
[0099] In this embodiment, by using a service prediction model on a cloud server, roadside units can obtain dynamic service initiation strategies and resource allocation suggestions, improving service response speed and resource utilization efficiency. The cloud server predicts resource demands based on service data, guiding roadside units to dynamically adjust and optimize resources, avoiding resource waste and reducing operating costs.
[0100] The startup control method based on the HarmonyOS system in the embodiments of this application will be explained below with reference to optional examples. Figure 3This is a flowchart illustrating another optional startup control method based on the HarmonyOS system according to an embodiment of this application, as shown below. Figure 3 As shown, the process of this startup control method based on the HarmonyOS system may include the following steps:
[0101] Step S302: When the roadside unit is powered on, execute the initial startup procedure.
[0102] When the roadside unit powers on, the BootLoader loads the kernel, and the kernel starts the init process, which is the first user-space process during system startup. The init process then mounts tmpfs and procfs, creates basic dev device nodes, and builds the root file system. Simultaneously, the init process listens for kernel hot-plug events, dynamically creating and managing device nodes. After mounting the system and vendor partitions, the init process scans and executes the init startup scripts of each SA, starting system services. When system services start, they register with samgr (system service manager) to ensure service manageability and application accessibility.
[0103] Step S304: Start the service and start the management system.
[0104] Specifically, the service startup management system is started via the foundation process. The service startup management system can be generated by pre-programmed scripts.
[0105] Step S306: Identify a set of target services to be started and allocate resources for starting them.
[0106] Specifically, based on the target mapping table and the target association table, a set of target services to be started is determined, and resources are allocated for starting them. For example, the transaction control task program has the highest priority and will be started first. Its specific startup parameters, such as path and permissions, are obtained through the target mapping table, and the associated services are determined through the target association table.
[0107] Step S308: Enable lazy start mechanism.
[0108] Specifically, for certain applications that do not need to run immediately, such as encryption and decryption services, a lazy loading mechanism can be used to initialize them but not execute them immediately. They will only start execution when a specific event is received (such as a decryption request issued by a transaction control task), which greatly saves the resource consumption during the startup phase.
[0109] Step S310: Initiate the hot-swap mechanism.
[0110] Specifically, after startup, the roadside unit can listen for hot-plug events. The hot-plug mechanism allows the roadside unit to dynamically respond to the insertion or removal of hardware devices after startup, thereby activating or adjusting relevant functions as needed to adapt to low-power operation. For example, when a monitor is detected being inserted through an HDMI or VGA interface, the hot-plug mechanism immediately starts the graphical interface service, loads the necessary drivers and applications, and provides a user interface. Similarly, if a user requests to start the graphical interface through a specific signal (such as a predefined network request or hardware button press), the system will also respond to this request, providing visual operation when needed and maintaining a low-power state when not needed. Likewise, the roadside unit can also be equipped with other types of hot-plugs, such as USB, extended memory, synchronization line interfaces (e.g., RS-422 serial interfaces or fiber optic communication interfaces), GPS or BeiDou positioning modules, etc. After startup, the roadside unit can listen for these hot-plug events and, upon detecting the activation signal of these hot-plug events, activate the functions for these hot-plug events to adapt to the typically low-power requirements of the roadside unit.
[0111] Step S312: Notify the host computer.
[0112] Specifically, after all necessary services have been initiated, the roadside unit may not notify the host computer. However, the roadside unit can also notify the host computer via a network process, indicating that it is ready and entering a transaction waiting state. At this time, except for the DSRC communication process, which is active, all other processes are in a blocked waiting state until a transaction signal or other initiation request is received. The host computer can be a cloud server that communicates with the roadside unit.
[0113] This optional example, through the service startup management system and lazy loading mechanism, significantly reduces resource consumption during the system initialization phase, thereby accelerating system startup speed and shortening the time from power-on to a usable state. By dynamically adjusting the startup timing of services and applications, unnecessary resource consumption is avoided, especially in resource-constrained environments, improving resource utilization efficiency and extending device uptime.
[0114] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0115] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0116] According to another aspect of the embodiments of this application, a boot control device based on the HarmonyOS system is also provided. This boot control device can be used to implement the boot control method based on the HarmonyOS system provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0117] Figure 4 This is a structural block diagram of an optional startup control device based on the HarmonyOS system according to an embodiment of this application, such as... Figure 4 As shown, the startup control device based on the HarmonyOS system includes:
[0118] The first execution unit 402 is used to execute the initial start-up procedure when the roadside unit is powered on;
[0119] The first startup unit 404 is used to start the service startup management system after the initial startup program has been executed. The service startup management system is provided with a set of service mapping tables and service association tables. Each service mapping table in the set of service mapping tables is used to indicate a specified service to be started by the service startup management system within a preset time period. The service association table is used to indicate services that have a relationship in the service startup management system.
[0120] The first determining unit 406 is used to determine the target mapping table corresponding to the current time from a set of service mapping tables and a set of service registry, and to determine the target association table from the association registry and the service association table. Each service registry in the set of service registry is used to indicate the specified service to be started by the latest recorded service startup management system within a preset time period, and the association registry is used to indicate the services with association relationships in the latest recorded service startup management system.
[0121] The second startup unit 408 is used to determine a set of target services to be started according to the target mapping table and the target association table, and to start the set of target services. The set of target services includes a set of specified services, or the set of target services includes a set of specified services and a set of associated services. Each associated service in the set of associated services has an association relationship with at least one specified service in the set of specified services.
[0122] It should be noted that the first execution unit 402 in this embodiment can be used to execute the above step S202, the first startup unit 404 in this embodiment can be used to execute the above step S204, the first determination unit 406 in this embodiment can be used to execute the above step S206, and the second startup unit 408 in this embodiment can be used to execute the above step S208.
[0123] The embodiments provided in this application execute a preliminary startup procedure when the roadside unit is powered on. Upon completion of the preliminary startup procedure, a service startup management system is activated. This system determines a target mapping table corresponding to the current time from a set of service mapping tables and a set of service registry tables, and determines a target association table from an association registry and a service association table. This ensures that the startup strategy matches the current system state, avoiding startup failures or service conflicts due to outdated configurations. Based on the target mapping table and the target association table, a set of target services to be started can be accurately determined, including directly specified services and related services. This ensures that all necessary services are started to a certain extent, while avoiding the startup of unnecessary services, thereby shortening the startup time to some extent. This solves the technical problem in related technologies where the roadside unit's operating system loads a large number of unnecessary services and applications during startup, leading to a long startup time. It improves startup efficiency. Furthermore, the exclusion of unnecessary services reduces memory and CPU usage, freeing up more system resources for the operation of target services and applications, improving resource utilization efficiency, and reducing device power consumption and operating costs.
[0124] In an exemplary embodiment, the first determining unit 406 is further configured to: determine, from a set of service mapping tables, a service mapping table corresponding to a preset time period to which the current time belongs, and from a set of service registry tables, a service registry table corresponding to the preset time period to which the current time belongs, respectively, to obtain a target table pair; if the information in the service mapping table and the service registry table in the target table pair is consistent, select the service mapping table in the target table pair as the target mapping table; if the information in the service mapping table and the service registry table in the target table pair is inconsistent, update the service mapping table in the target table pair using the service registry table in the target table pair, and select the updated service mapping table in the target table pair as the target mapping table; if the information in the association registry table and the association table is consistent, select the service association table as the target association table; if the information in the association registry table and the association table table is inconsistent, update the service association table using the association registry table, and select the updated service association table as the target association table.
[0125] In an exemplary embodiment, the second startup unit 408 is further configured to: determine a set of specified services to be started according to a target mapping table; and if it is determined, based on the identification information of the set of specified services and the target association table, that there are services that are associated with the specified services in the set of specified services, determine the services that are associated with the specified services in the set of specified services as a set of associated services.
[0126] In one exemplary embodiment, the target mapping table records the startup priority of each specified service in a set of specified services;
[0127] The second startup unit 408 is further configured to: when a set of target services includes a set of associated services, adjust the startup priority of the associated services in the set of associated services according to the startup priority of the specified service associated with the associated services in the set of associated services, so that the startup priority of the associated services in the set of associated services is higher than the startup priority of the specified service associated with the associated services in the set of associated services; and start each target service in the set of target services according to the startup priority of each target service in the set of target services.
[0128] In an exemplary embodiment, the first execution unit 402 is further configured to: load the kernel of the roadside unit; after the kernel is loaded, call the initialization process, and load the first file system, the second file system, the hardware device interface, the system software partition, and the service configuration partition in sequence through the initialization process;
[0129] The first file system is a file system that runs in memory within the roadside unit. The second file system is a pseudo file system that displays the kernel and process information of the roadside unit. The hardware device interface is used to establish the connection between the software system and the hardware system in the roadside unit. The system software partition and service configuration partition are used to store the service information and configuration files of the roadside unit.
[0130] In one exemplary embodiment, the target mapping table records the initial allocated resources for each specified service in a set of specified services;
[0131] Before starting a set of target services, the startup control device based on the HarmonyOS system also includes: a first allocation unit, used to allocate initial allocation resources to each target service in the set of target services;
[0132] After initiating a set of target services, the startup control device based on the HarmonyOS system further includes: a second allocation unit, used to monitor the actual resource usage of each target service; if, based on the actual resource usage of each target service, it is determined that there is a first target service whose actual resource usage is greater than or equal to the corresponding first resource threshold, the allocated resources of the first target service are increased according to a first resource step size, wherein the first resource threshold corresponding to each target service is the product of the allocated resources of each target service and a first ratio, and the first resource step size is the product of the allocated resources of the first target service and a second ratio; if, based on the actual resource usage of each target service, it is determined that there is a second target service whose actual resource usage is less than the corresponding second resource threshold, the allocated resources of the second target service are decreased according to a second resource step size, wherein the second resource threshold corresponding to each target service is the product of the allocated resources of each target service and a third ratio, and the second resource step size is the product of the allocated resources of the second target service and a fourth ratio; wherein the first ratio is greater than the third ratio, and the second ratio is greater than the fourth ratio.
[0133] In one exemplary embodiment, the startup control device based on the HarmonyOS system further includes:
[0134] An update unit is used to, when the roadside unit communicates with the cloud server, feed back service data to the cloud server when the security verification between the roadside unit and the cloud server is successful. The service data includes at least one of the following: service status information, service performance indicators, hardware resource usage information, interaction information, and environmental information. The update unit also receives update instructions sent by the cloud server, wherein the update instructions carry at least one of the following update information: first update information and second update information. The first update information is the update information predicted by the service prediction model, which is used to predict the service requirements and hardware resource allocation of the roadside unit. The first update information includes at least one of the following: identification information of the service to be started, the start priority of the service to be started, and the resource allocation ratio of the service to be started. The second update information includes at least one of the following: a service update package and update association information of the service to be started. In response to the received update instruction, if the update information only includes the update association information of the service to be started, a set of service registry entries is not updated; if the update information includes the update association information of the service to be started, the associated registry entries are updated according to the update association information of the service to be started.
[0135] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0136] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program executes the steps in any of the above method embodiments when it is run.
[0137] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.
[0138] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is configured to perform the steps of any of the method embodiments described above via the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0139] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0140] According to another aspect of the embodiments of this application, a computer program product is also provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit 501, it performs various functions provided in the embodiments of this application. The sequence numbers of the embodiments of this application above are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0141] Figure 5 A schematic block diagram of a computer system architecture for implementing embodiments of the present application is shown. Figure 5 As shown, the computer system 500 includes a CPU (Central Processing Unit) 501, which can perform various appropriate actions and processes based on programs stored in ROM 502 or programs loaded into RAM 503 from storage section 508. Random access memory 503 also stores various programs and data required for system operation. The CPU 501, ROM 502, and RAM 503 are interconnected via bus 504. An I / O (Input / Output) interface 505 is also connected to bus 504.
[0142] The following components are connected to I / O interface 505: input section 506 including keyboard, mouse, etc.; output section 507 including CRT (Cathode Ray Tube), LCD (Liquid Crystal Display), etc., and speakers, etc.; storage section 508 including hard disk, etc.; and communication section 509 including network interface card, modem, etc. Communication section 509 performs communication processing via a network such as the Internet. Drive 510 is also connected to I / O interface 505 as needed. Removable media 511, such as disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 510 as needed so that computer programs read from them can be installed into storage section 508 as needed.
[0143] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit 501, it performs various functions defined in the system of this application.
[0144] It should be noted that, Figure 5 The computer system 500 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0145] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0146] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A startup control method based on the HarmonyOS system, characterized in that, Applied to roadside units, the method includes: When the roadside unit is powered on, a preliminary startup procedure is executed; Upon completion of the initial startup procedure, the service startup management system is started. The service startup management system has a set of service mapping tables and service association tables. Each service mapping table is used to indicate a specified service to be started by the service startup management system within a preset time period. The service association tables are used to indicate services that have a relationship with each other in the service startup management system. From the set of service mapping tables and the set of service registry, a target mapping table corresponding to the current time is determined, and from the association registry and the service association table, a target association table is determined. Each service registry in the set of service registry is used to indicate the specified service to be started by the latest recorded service startup management system within a preset time period, and the association registry is used to indicate the services with an association relationship in the latest recorded service startup management system. Based on the target mapping table and the target association table, a set of target services to be started is determined and the set of target services is started. The set of target services includes a set of designated services, or the set of target services includes the set of designated services and a set of associated services. Each associated service in the set of associated services is associated with at least one designated service in the set of designated services.
2. The method according to claim 1, characterized in that, The step of determining the target mapping table corresponding to the current time from the set of service mapping tables and the set of service registry tables, and determining the target association table from the association registry and the service association table, includes: The service mapping table corresponding to the preset time period to which the current time belongs is determined from the set of service mapping tables, and the service registry corresponding to the preset time period to which the current time belongs is determined from the set of service registry tables, to obtain the target table pair; If the information in the service mapping table and service registry of the target table pair is consistent, the service mapping table in the target table pair is selected as the target mapping table. If the information in the service mapping table and service registry in the target table pair is inconsistent, the service registry in the target table pair is used to update the service mapping table in the target table pair, and the updated service mapping table in the target table pair is selected as the target mapping table. If the information in the associated registry and the service association table are consistent, the service association table is selected as the target association table. If the information in the associated registry and the service association table is inconsistent, the associated registry is used to update the service association table, and the updated service association table is selected as the target association table.
3. The method according to claim 1, characterized in that, The step of determining a set of target services to be launched based on the target mapping table and the target association table includes: Based on the target mapping table, determine the set of specified services to be started; If, based on the identification information of the specified group of services and the target association table, it is determined that there are services that are associated with the specified services in the specified group of services, then the services that are associated with the specified services in the specified group of services are identified as a group of associated services.
4. The method according to claim 1, characterized in that, The target mapping table records the startup priority of each specified service in the set of specified services; The activation of the set of target services includes: If the set of target services includes a set of associated services, for the associated services in the set of associated services, the startup priority of the associated services in the set of associated services is adjusted according to the startup priority of the specified service associated with the associated services in the set of associated services, so that the startup priority of the associated services in the set of associated services is higher than the startup priority of the specified service associated with the associated services in the set of associated services. Each target service in the set of target services is started according to its startup priority.
5. The method according to claim 1, characterized in that, The execution of the initial startup procedure includes: Load the kernel of the roadside unit; After the kernel is loaded, the initialization process is invoked, and the first file system, the second file system, the hardware device interface, the system software partition, and the service configuration partition are loaded sequentially through the initialization process. The first file system is a file system that runs in memory on the roadside unit, the second file system is a pseudo file system that displays the kernel and process information of the roadside unit, the hardware device interface is used to establish a connection between the software system and the hardware system in the roadside unit, and the system software partition and the service configuration partition are used to store the service information and configuration files of the roadside unit.
6. The method according to claim 1, characterized in that, The target mapping table records the initial resource allocation for each specified service in the set of specified services; Before starting the set of target services, the method further includes: allocating initial allocation resources for each target service in the set of target services; After activating the set of target services, the method further includes: monitoring the actual resource usage of each target service; and, if it is determined based on the actual resource usage of each target service that there is a first target service whose actual resource usage is greater than or equal to a corresponding first resource threshold, increasing the allocated resources of the first target service according to a first resource step size, wherein the first resource threshold corresponding to each target service is the product of the allocated resources of each target service and a first ratio, and the first resource step size is the product of the allocated resources of the first target service and a second ratio. If, based on the actual resource usage of each target service, it is determined that there is a second target service whose actual resource usage is less than the corresponding second resource threshold, the allocated resources of the second target service are reduced according to the second resource step size. The second resource threshold corresponding to each target service is the product of the allocated resources of each target service and the third ratio, and the second resource step size is the product of the allocated resources of the second target service and the fourth ratio. Wherein, the first ratio is greater than the third ratio, and the second ratio is greater than the fourth ratio.
7. The method according to claim 1, characterized in that, The method further includes: When the roadside unit communicates with the cloud server, and the roadside unit passes the security verification with the cloud server, it sends service data back to the cloud server. The service data includes at least one of the following: service status information, service performance indicators, hardware resource usage information, interaction information, and environmental information. The system receives an update instruction sent by the cloud server, wherein the update instruction carries at least one of the following update information: first update information and second update information. The first update information is the update information predicted by the service prediction model after the service data fed back by the roadside unit is input into the service prediction model. The service prediction model is used to predict the service demand and hardware resource allocation of the roadside unit. The first update information includes at least one of the following: identification information of the service to be started, the start priority of the service to be started, and the resource allocation of the service to be started. The second update information includes at least one of the following: service update package and update association information of the service to be started. In response to the received update instruction, if the update information only includes the update association information of the service to be started, the group of service registry entries will not be updated; If the update information includes update association information for the service to be started, the associated registry is updated according to the update association information for the service to be started.
8. A startup control device based on the HarmonyOS system, characterized in that, Applied to roadside units, the device includes: The first execution unit is used to execute the initial startup procedure when the roadside unit is powered on; The first startup unit is used to start the service startup management system after the initial startup procedure is completed. The service startup management system is configured with a set of service mapping tables and service association tables. Each service mapping table in the set of service mapping tables is used to indicate a specified service to be started by the service startup management system within a preset time period. The service association table is used to indicate services that have an association relationship in the service startup management system. The first determining unit is configured to determine a target mapping table corresponding to the current time from the set of service mapping tables and the set of service registry tables, and to determine a target association table from the association registry and the service association table, wherein each service registry in the set of service registry tables is used to indicate the specified service to be started by the latest recorded service startup management system within a preset time period, and the association registry is used to indicate the services with an association relationship in the latest recorded service startup management system. The second startup unit is configured to determine a set of target services to be started based on the target mapping table and the target association table, and to start the set of target services, wherein the set of target services includes a set of designated services, or the set of target services includes the set of designated services and a set of associated services, and each associated service in the set of associated services has an association relationship with at least one designated service in the set of designated services.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
10. 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 computer program, it implements the steps of the method according to any one of claims 1 to 7.