Process initialization method and related device

Through parallel initialization and configuration information management, the problem of long multi-process initialization time is solved, and a more efficient process collection initialization process is realized.

WO2025145590A1PCT designated stage expired Publication Date: 2025-07-10HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/110582
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-05
Filing Date
2024-08-08
Publication Date
2025-07-10

AI Technical Summary

Technical Problem

During the initialization process of multiple processes, due to the existence of dependencies, the initialization process takes a long time and is inefficient.

Method used

Using the parallel initialization method, all processes are started through the process management module, and the process initialization process is divided into the first step that does not depend on other process services and the second step that depends on specific services. The configuration information and communication pipelines are used to ensure the accuracy and security of service-ready notifications.

Benefits of technology

It shortens the initialization time of process collection, improves the efficiency and fluency of the overall initialization process, and reduces the phenomenon of stuck caused by dependencies between processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024110582_10072025_PF_FP_ABST
    Figure CN2024110582_10072025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in embodiments of the present application are a process initialization method and a related device. The method can be used for initializing at least two processes in a device. The method comprises: a process management module triggers all processes in a process set to be initialized, the process set comprising a first process and a second process; if the first process determines that the first process depends on a first service, an initialization procedure of the first process is divided into a first step and a second step, and the first process executes the first step and sends, to a first module, subscription information for instructing to subscribe a service-ready notification of the first service; upon completing the initialization of the first service, the second process sends, to the first module, first information indicating that the first service is ready; on the basis of the subscription information, the first module sends, to the first process, second information indicating that the first service is ready; and in response to the received second information, the first process triggers to continue to execute the second step. The present application is beneficial to improving the efficiency of the initialization procedures of the entire process set.
Need to check novelty before this filing date? Find Prior Art

Description

A process initialization method and related equipment

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on January 5, 2024, with application number 202410030435.4 and application name “A process initialization method and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of computer technology, and in particular to a process initialization method and related devices. Background Art

[0003] Multiple processes are generally deployed in the operating systems of various electronic devices. In the initialization process of the aforementioned multiple processes, there may be dependencies between different processes in the multiple processes. For example, multiple processes may include process 1 and process 2, and the execution of process 1 depends on a service provided by process 2. In the process of initializing the aforementioned multiple processes, the solution adopted in the relevant technology is to initialize process 2 first, and after completing the initialization of process 2, start the initialization of process 1.

[0004] However, in the process of initializing multiple processes, processes with dependencies are initialized in a serial manner, resulting in a long time consumed in the initialization process of the multiple processes.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a process initialization method and related equipment, which shorten the total time consumed in the initialization process of the entire process set, and are conducive to improving the efficiency of the initialization process of the entire process set.

[0007] In a first aspect, embodiments of the present application provide a process initialization method that can be used to initialize at least two processes in a device (hereinafter referred to as a first device for ease of description). In this method, a process management module in the first device starts all processes in a process set to trigger all processes in the process set to begin initialization in parallel, where the process set includes at least two processes to be initialized, and the at least two processes include a first process and a second process.

[0008] The first process in the first device executes the first step and sends subscription information to the first module in the first device, where the subscription information is used to indicate a service readiness notification for subscribing to the first service, wherein, when the first process determines that the first process depends on the first service, the initialization process of the first process is divided into a first step and a second step, the execution of the first step does not depend on the services provided by other processes in the process set, and the execution of the second step depends on the first service provided by the second process; illustratively, the first step includes part of the process in the entire initialization process of the first process, and the execution of the part of the process included in the aforementioned first step does not depend on the services provided by other processes in the process set; the second step includes other processes other than the first step in the entire initialization process of the first process. It should be noted that the first process can send subscription information to the first module while executing the first step; or, the first process can send subscription information to the first module after executing the first step; or, it can first send subscription information to the first module and then execute the first step, etc.

[0009] When the second process in the first device completes the initialization of the first service, the second process can send a first message to the first module, and the first message indicates that the first service is ready; after the first module determines that the first service provided by the second process is ready, it can determine which processes have subscribed to the service ready notification of the first service based on the received subscription information, and then send a second message to each first process that has subscribed to the service ready notification of the first service, and the second information indicates that the first service is ready; after receiving the second message, the first process triggers the continuation of the second step in response to the received second information to complete the initialization process of the first process.

[0010] In this implementation, the process management module starts all processes that need to be initialized, and all processes that need to be initialized can begin to be initialized in parallel. Since the first process depends on the first service of the second process, the entire initialization process of the first process is divided into a first step and a second step. The execution of the first step does not depend on the services provided by other processes in the process set, and the execution of the second step depends on the first service provided by the second process. After executing the first step, the first process can send a subscription message to the first module to subscribe to the service readiness notification of the first service; when the second process completes the initialization of the first service, it sends a first message to the first module to inform the first module that the first service is ready; then the first module can send a second message to the first process to inform the third process that the first service is ready, thereby triggering the third process to continue to execute the second step. Through the above scheme, some steps in the initialization process of the first process and the second process with a dependent relationship are executed in parallel. Compared with a completely serial method, the total time consumed in the initialization process of the entire process set is shortened, which is conducive to improving the efficiency of the initialization process of the entire process set.

[0011] In one possible implementation, in this method, the first module may store preset configuration information, the preset configuration information indicating the services that each third process in at least one third process can provide, the process set includes at least one third process, and the second process is one of the at least one third process. For example, in one scenario, all processes included in the at least one third process may be a subset of the process set, and each third process in the at least one third process can provide services to other processes in the process set. In another scenario, the scope of "at least one third process" and "process set" is the same, that is, each process in the process set is a third process, and the configuration information indicates the services that each process in the process set can provide. The first module may also determine at least one service that the second process can provide based on the preset configuration information. The first module sending the second information to the first process may include: if the first module determines that the at least one service that the second process can provide includes the first service, the first module sending the second information to the first process.

[0012] In this implementation, the preset configuration information indicates at least one service that each process in at least one third process can provide, so that after receiving the first information sent by the second process, the first module can determine whether the at least one service provided by the second process includes the first service in the first information based on the preset configuration information. Only when the at least one service that the second process can provide includes the first service will the second information be sent to the first process. When other processes impersonate the second process to send a service ready notification of the first service to the first module, the first module can identify it in time, which is conducive to improving the accuracy of the second information sent by the first module to the first process, thereby further avoiding the first process from getting stuck when executing the second step, so as to ensure the smoothness of the initialization process.

[0013] In one possible implementation, in this method, the first module may store preset configuration information, the preset configuration information indicating at least one service that each of at least one fourth process can rely on, the process set including at least one fourth process, and the first process being one of the at least one fourth process. The first module may also determine, based on the preset configuration information, at least one service that the first process can rely on. The first module sending the second information to the first process may include: if the first module determines that the at least one service that the first process can rely on includes the first service, the first module sending the second information to the first process.

[0014] In this implementation, the preset configuration information indicates at least one service that each fourth process in at least one fourth process can legally depend on. Then, after receiving the subscription information sent by the first process, it can be determined whether the at least one service that the first process can depend on includes the first service in the subscription information. That is, the validity of the subscription information will be judged with the help of the configuration information, thereby ensuring that the subscription to the service readiness notification can be successfully completed only based on a legal dependency relationship, further improving the security of this solution.

[0015] In one possible implementation, in this method, the first module may further establish a first communication channel and a second communication channel between the first module and the first process based on the process identifier (PID) of the first process, where the first communication channel is used to transmit subscription information, and the second communication channel is used to transmit the second information. Furthermore, / or, the first module may further establish a third communication channel between the first module and the second process based on the PID of the second process, where the third communication channel is used to transmit the first information.

[0016] In this implementation, the first module creates a first communication channel and a second communication channel for communication between the first module and the first process based on the PID of the first process. The first module can then determine the mapping relationship between the interface of the first communication channel and the PID of the first process, as well as the mapping relationship between the interface of the second communication channel and the PID of the first process. Thus, the first module can determine which process the information transmitted through a certain communication channel originates from based on the mapping relationship between the communication channel and the process PID, thereby preventing a process from impersonating another process to send subscription information to the first module. This improves the authenticity and security of the "readiness notification of the subscription service." Furthermore, after the first module determines that the first service is ready, it can ensure that the process subscribed to the readiness notification of the first service can receive the second information based on the mapping relationship between the interface of the second communication channel and the PID of the first process. This ensures the smoothness of the initialization process of the first process and helps reduce the time consumption caused by "all processes in the process set completing the initialization process."

[0017] The first module creates a third communication pipe for communication between the first module and the second process based on the PID of the second process. The first module can then determine the mapping relationship between the interface of the third communication pipe and the PID of the second process. Thus, the first module can determine which process the information transmitted through a certain communication pipe comes from based on the mapping relationship between the communication pipe and the PID of the process, thereby avoiding a certain process from impersonating another process to send the first information to the first module, thereby improving the accuracy of the first information obtained by the first module; since the first process needs to ensure that the first service is ready when executing the second step in the initialization process, "improving the accuracy of the first information" is also conducive to avoiding the first process from getting stuck when executing the second step in the initialization process, and is conducive to improving the fluency of the first process in executing the initialization process.

[0018] In one possible implementation, in this method, after starting all processes in the process set, the process management module can obtain the PID of each process in the process set, and then send the PID of each process in the process set to the first module. The PID of each process in the process set includes the PID of the first process and the PID of the second process.

[0019] The "Process Identifier" (PID) is also called the "Process Identification Number." The PID is randomly assigned by the operating system while a process is running. While the process is running, the PID remains unchanged. However, after a process terminates, the PID is recycled by the operating system and may be assigned to a new process. This means that while a first process is running, the PID of the first process can temporarily and uniquely identify the first process; while a second process is running, the PID of the second process can temporarily and uniquely identify the second process.

[0020] In this implementation, since the process management module can easily obtain the PID of each process in the process set after starting all processes in the process set, the process management module sends the PID of each process in the process set to the first module, and then the first module can build a one-to-one communication pipeline between the first module and the process based on the PID of the process, providing a convenient and fast "first module obtains the PID of the process" solution, and the authenticity of the PID of the process obtained by the process management module is relatively high, which can further ensure the authenticity of the information obtained by the first module through the communication pipeline.

[0021] In one possible implementation, the first step includes at least one of the following steps: loading a dynamic link library, reading the configuration file and configuration parameters of the first process, requesting resources used by the first process, communicating with hardware corresponding to the first process, or generating data corresponding to the service of the first process. Exemplarily, "loading the dynamic link library" includes reading the executable file associated with the first process. "Requesting resources used by the first process" can also be referred to as "requesting system resources used by the first process." For example, the aforementioned system resources may include memory resources, thread resources, or other system resources. "Communicating with hardware corresponding to the first process" can be used to notify the hardware that the first process has been started. For example, if the service provided by the first process includes taking photos, the hardware corresponding to the first process includes a sensor for image capture. For another example, if the service provided by the first process includes playing songs, the hardware corresponding to the first process includes speakers. For example, if the service provided by the first process includes encryption and decryption, "data corresponding to the function of the first process" includes the key used when performing encryption and / or decryption. For another example, if the service provided by the first process includes playing songs, "data corresponding to the function of the first process" includes information about the song played.

[0022] In this implementation, the above description provides specific steps for the first step, which reduces the difficulty of implementing this solution; "loading the dynamic link library, reading the configuration file and configuration parameters of the first process, applying for resources used by the first process, communicating with the hardware corresponding to the first process, and generating data corresponding to the service of the first process". These steps in the initialization process do not need to rely on the services provided by other processes and are very time-consuming. Since in the method provided in this application, when the first process depends on the first service provided by the second process, the first process executes the first step and the second process executes the initialization process in parallel, compared to the first process starting initialization after the second process completes initialization, the longer the time consumed in the first step, the more time is saved by adopting the method provided in the application.

[0023] In one possible implementation, the method is applied to a first device, which is any of the following: a vehicle, a robot, a household appliance, an industrial computer, a mobile phone, or a tablet. This implementation provides multiple specific product forms for the first device, greatly expanding the application scenarios of this solution and increasing its implementation flexibility.

[0024] In a second aspect, an embodiment of the present application provides a process initialization device, which can be used to initialize at least two processes in a first device. The process initialization device includes: a process management module, which is used to start all processes in a process set to trigger the initialization of all processes in the process set, wherein the process set includes at least two processes that need to be initialized, and the at least two processes include a first process and a second process; a first process, which is used to execute a first step and send subscription information to a first module, the subscription information is used to indicate a service readiness notification for subscribing to a first service, wherein, when the first process determines that the first process depends on the first service, the initialization process of the first process is divided into a first step and a second step, the execution of the first step does not depend on the services provided by other processes in the process set, and the execution of the second step depends on the first service provided by the second process; the second process, which is used to send a first message to the first module when the second process completes the initialization of the first service, the first message indicating that the first service is ready; the first module, which is used to send a second message to the first process based on the subscription information, the second message indicating that the first service is ready; and the first process, which is further used to trigger the continuation of the second step in response to the received second message.

[0025] In the second aspect of this application, the process initialization device is also used to execute the steps in the first aspect and various possible implementation methods of the first aspect. The specific implementation methods, meanings of nouns and beneficial effects brought about by the steps in the second aspect can all be referred to the first aspect and will not be repeated here.

[0026] In a third aspect, an embodiment of the present application provides a device including a processor and a memory, wherein the processor is coupled to the memory, the memory is used to store programs, and the processor is used to execute the programs in the memory, so that the device executes the method described in the first aspect above.

[0027] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method described in the first aspect above.

[0028] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a program. When the program runs on a computer, it enables the computer to execute the method described in the first aspect above.

[0029] In a sixth aspect, the present application provides a chip system, which includes a processor for supporting the implementation of the functions involved in the above aspects, for example, sending or processing the data and / or information involved in the above methods. In one possible design, the chip system also includes a memory, which is used to store program instructions and data necessary for the terminal device or communication device. The chip system can be composed of a chip or can include a chip and other discrete devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] FIG1 is a flow chart of a method for initializing a process according to an embodiment of the present application;

[0031] FIG2 is another schematic diagram of a process initialization method provided in an embodiment of the present application;

[0032] FIG3 is a schematic diagram of the beneficial effects of the method provided in this application;

[0033] FIG4 is another flowchart of a method for initializing a process provided in an embodiment of the present application;

[0034] FIG5 is another schematic diagram of a process initialization method provided in an embodiment of the present application;

[0035] FIG6 is a schematic diagram of the structure of a process initialization device provided in an embodiment of the present application;

[0036] FIG7 is a schematic structural diagram of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0038] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0039] In the embodiments of the present application, "indication" may include direct indication and indirect indication, and may also include explicit indication and implicit indication. The information indicated by a certain information (such as the indication information described below) is called information to be indicated. In the specific implementation process, there are many ways to indicate the information to be indicated, such as but not limited to, the information to be indicated can be directly indicated, such as the information to be indicated itself or the index of the information to be indicated. The information to be indicated can also be indirectly indicated by indicating other information, wherein there is an association between the other information and the information to be indicated; it is also possible to indicate only a part of the information to be indicated, while the other parts of the information to be indicated are known or agreed in advance, for example, the indication of specific information can be achieved with the help of the arrangement order of each information agreed in advance (such as predefined by the protocol), thereby reducing the indication overhead to a certain extent. The present application does not limit the specific method of indication. It is understandable that, for the sender of the indication information, the indication information can be used to indicate the information to be indicated, and for the receiver of the indication information, the indication information can be used to determine the information to be indicated.

[0040] The method provided in the present application can be applied to a scenario in which a set of processes in a device (hereinafter referred to as the "first device" for the convenience of description) is initialized; illustratively, the first device can be a vehicle, a robot, a household appliance, an industrial computer, a mobile phone, a tablet or other types of electronic devices, etc. The present application provides a variety of specific product forms of the first device, which greatly expands the application scenarios of the present solution and improves the implementation flexibility of the present solution. It should be noted that the specific electronic devices to which the present application can be applied can be flexibly determined in combination with the actual application scenarios, and are not limited in the embodiments of the present application.

[0041] When initializing multiple processes in a process set, which may include process 1 and process 2, if the execution of process 1's initialization process depends on a service provided by process 2, that is, the completion of process 1's initialization process requires that the service provided by process 2 is in a ready state, then "the service is in a ready state" in this application can also be understood as "the service is in a state where it can provide services externally." In related art, to meet this prerequisite, process 2 is initialized first. After the initialization of process 2 is completed, the initialization process of process 1 is executed. Because the initialization of process 1 and process 2 is completely serial, the initialization process of the entire process set consumes a long time.

[0042] In order to shorten the time consumed by the initialization process of the entire process set, the present application provides a process initialization method. The following describes the specific implementation process of the method provided by the present application. Specifically, please refer to Figure 1, which is a flow chart of a process initialization method provided by an embodiment of the present application. The process initialization method provided by an embodiment of the present application may include:

[0043] 101. The process management module starts all processes in a process set to trigger initialization of all processes in the process set, where the process set includes at least two processes that need to be initialized.

[0044] In an embodiment of the present application, the execution management (EM) module in the first device may first start the first module in the first device to trigger the first module to start initialization; illustratively, the process management module and the first module may both be specifically expressed as processes.

[0045] The process management module may further determine a process set, where the process set includes all processes that need to be initialized on the first device at the current moment, where at least two processes are among the processes that need to be initialized. After the first module completes initialization, the process management module may start all processes in the process set to trigger all processes in the process set to begin initialization.

[0046] 102. The first process executes the first step and sends subscription information to the first module, where the subscription information is used to indicate a service readiness notification for subscribing to the first service, wherein the at least two processes in the process set include a first process and a second process. When the first process determines that the first process depends on the first service, the initialization process of the first process is divided into a first step and a second step, the execution of the first step does not depend on services provided by other processes in the process set, and the execution of the second step depends on the first service provided by the second process.

[0047] In an embodiment of the present application, at least one legitimate first dependency exists between at least two processes included in the process set. Any of the at least one legitimate first dependency can be a first process that depends on a first service provided by a second process. For example, the service provided by a first process includes navigation, and the first service is a positioning service. When providing the navigation service, it is necessary to first determine the location of the first device through the first service. In this case, the first process can be said to be dependent on the first service provided by the second process. It should be understood that the examples here are only for the convenience of understanding this solution and are not used to limit this solution.

[0048] It should be noted that there may be multiple first dependency relationships in at least two processes included in the above process set. The meaning of "first process" is the dependent party in each first dependency relationship; the meaning of "second process" is the dependent party providing services in each first dependency relationship.

[0049] When the first process determines that it depends on the first service, the entire initialization process of the first process can be divided into a first step and a second step. The execution of the first step does not depend on the services provided by other processes in the process set. That is, each of the at least one first process does not depend on the services provided by other processes in the process set when executing the first step of the initialization process. The execution of the second step depends on the first service provided by the second process. That is, when each first process executes the second step of the initialization process, the first service provided by the second process must be in a ready state.

[0050] Exemplarily, the first step includes a partial process in the entire initialization process of the first process, and the execution of the partial process included in the aforementioned first step does not depend on the services provided by other processes in the process set; the second step includes other processes other than the first step in the entire initialization process of the first process.

[0051] Optionally, the first step includes at least one of the following steps: loading a dynamic link library, reading the configuration file and configuration parameters of the first process, applying for resources used by the first process, communicating with the hardware corresponding to the first process, generating data corresponding to the service of the first process, or other steps that are not dependent on the services provided by other processes in the process set.

[0052] Exemplarily, "loading a dynamic link library" includes reading an executable file associated with the first process. "Requesting resources for use by the first process" can also be referred to as "requesting system resources for use by the first process." For example, the aforementioned system resources may include memory resources, thread resources, or other system resources. "Communicating with the hardware corresponding to the first process" can be used to inform the hardware that the first process has been started. For example, if the service provided by the first process includes taking photos, the hardware corresponding to the first process includes a sensor for image acquisition. For another example, if the service provided by the first process includes playing songs, the hardware corresponding to the first process includes speakers. For example, if the service provided by the first process includes encryption and decryption, "data corresponding to the function of the first process" includes the key used when performing encryption and / or decryption. For another example, if the service provided by the first process includes playing songs, "data corresponding to the function of the first process" includes information about the songs played. It should be understood that the examples here are merely for facilitating understanding of this solution and are not intended to limit this solution.

[0053] After the process management module starts all processes in the process set, all processes in the process set begin to initialize in parallel. Each of the at least one first process included in the process set can execute the first step and send subscription information to the first module. Correspondingly, after receiving the subscription information, the first module can determine, based on the subscription information, that the first process has subscribed to the service readiness notification of the first service provided by the second process. For example, the first process can send the subscription information to the first module while executing the first step; alternatively, the first process can send the subscription information to the first module after completing the first step; alternatively, the first process can first send the subscription information to the first module and then execute the first step, etc.

[0054] For example, after each first process sends the subscription information to the first module, the initialization process of each first process can be switched to a pause state, which can also be called a semi-service state, a waiting state, a suspended state or other terms.

[0055] 103. When the second process completes initialization of the first service, it sends first information to the first module, where the first information indicates that the first service is ready.

[0056] In an embodiment of the present application, after the process management module starts all processes in the process set, all processes in the process set begin to initialize in parallel. After the second process in the aforementioned process set completes the initialization of the first service, it can send the first information to the first module; correspondingly, the first module can determine that the first service provided by the second process is ready based on the aforementioned first information.

[0057] 104. The first module sends second information to the first process according to the subscription information, where the second information indicates that the first service is ready.

[0058] In an embodiment of the present application, when the first module determines that the first service provided by the second process is ready, it can determine which processes have subscribed to the service ready notification of the first service based on the received subscription information, and then send the second information to each first process that has subscribed to the service ready notification of the first service. Correspondingly, each first process can determine that the first service is ready based on the received second information.

[0059] Exemplarily, in one case, the second information may specifically include the identity information of the first service, and the identity information of the first service is used to inform the first process that the first service is ready; in another case, the second information may include a preset identification information, when the identification information represents that the first service is ready, for example, the identification information may be "1111", "YYYY" or other identification information, etc. It should be noted that the example of the second information here is only for the convenience of understanding this solution and is not used to limit this solution.

[0060] 105. In response to the received second information, the first process triggers the continuation of the second step.

[0061] In an embodiment of the present application, each first process can wake up the initialization process in the waiting state in response to the received second information, triggering the continuation of the second step in the initialization process to complete the initialization process of the first process, so that the service provided by the first process is also ready.

[0062] To understand this solution more intuitively, please refer to Figures 2 and 3. Figure 2 is another schematic diagram of the process initialization method provided in an embodiment of the present application, and Figure 3 is a schematic diagram of the beneficial effects brought about by the method provided in the present application. First, refer to Figure 2. In Figure 2, a process set including process A, process B, process C, process D, and process E is taken as an example, wherein process A and process B both rely on service 1 provided by process C, process C does not rely on services provided by other processes in the process set, process D relies on service 2 provided by process E, and process E does not rely on services provided by other processes in the process set. Service 1 is provided through process C, and service 2 and service 3 are provided through process E. In the initialization process of process E, the initialization of service 2 will be performed first, and then the initialization of service 3 will be performed. It should be noted that in the example of Figure 2, a dependency relationship 1 is formed between process A and process C. In dependency relationship 1, process A is the first process and process C is the second process; a dependency relationship 2 is formed between process B and process C. In dependency relationship 2, process B is the first process and process C is the second process; a dependency relationship 3 is formed between process D and process E. In dependency relationship 3, process D is the first process and process E is the second process.

[0063] After the process management module starts all processes in the process set, process A, process B, process C, process D and process E are triggered to start initialization in parallel.

[0064] Since process A and process B depend on service 1 provided by process C, and process D depends on service 2 provided by process E, process A sends subscription information 1 to the first module while executing the first step in the initialization process. Subscription information 1 is used to inform the first module that process A has subscribed to the service ready notification of service 1; process B sends subscription information 2 to the first module while executing the first step in the initialization process. Subscription information 2 is used to inform the first module that process B has subscribed to the service ready notification of service 1; process D sends subscription information 3 to the first module while executing the first step in the initialization process. Subscription information 3 is used to inform the first module that process D has subscribed to the service ready notification of service 2.

[0065] Since process C and process E do not rely on the services provided by other processes in the process set, process C and process E can directly complete the entire initialization process after starting initialization. Among them, after process C completes the initialization process, that is, process C completes the initialization of service 1, process C can send first information 1 to the first module. First information 1 is used to inform the first module that service 1 is ready. In the initialization process of process E, after process E completes the initialization of service 2, it can send first information 2 to the first module. First information 2 is used to inform the first module that service 2 is ready. Process E can continue to execute the initialization of service 3 in parallel to complete the entire initialization process of process E.

[0066] The first module can send second information 1 to process A, and the second information 1 is used to inform process A that service 1 is ready; the first module can also send second information 2 to process B, and the second information 2 is used to inform process B that service 1 is ready; the first module can also send second information 3 to process D, and the second information 3 is used to inform process D that service 2 is ready.

[0067] In response to the received second information 1, process A triggers the continuation of the second step of the initialization process to complete the initialization process of process A. In response to the received second information 2, process B triggers the continuation of the second step of the initialization process to complete the initialization process of process B. In response to the received second information 3, process D triggers the continuation of the second step of the initialization process to complete the initialization process of process D. It should be understood that the example in FIG3 is only for facilitating the understanding of this solution and is not intended to limit this solution.

[0068] Please continue to refer to Figure 3, which includes two sub-schematic diagrams (a) and (b). Both sub-schematic diagrams (a) and (b) of Figure 3 take process 1 and process 2 as examples, and process 1 depends on the services provided by process 2. First, refer to the sub-schematic diagram (a) of Figure 3. In the related art, the initialization process of process 1 is executed first, and after the initialization process of process 1 is completed, the initialization process of process 2 is executed, that is, the initialization processes of process 1 and process 2 are completely serial. Refer to the sub-schematic diagram (b) of Figure 3 again. When the method provided by the present application is adopted, since the process management module starts process 1 and process 2 in parallel, process 1 and process 2 start to execute the initialization process in parallel. Process 1 enters a pause state after executing the first step. After process 2 completes the initialization process, process 1 starts to execute the second step, thereby completing the initialization process of process 1. By comparing the sub-schematic diagram (a) of Figure 3 and the sub-schematic diagram (b) of Figure 3, it can be seen that the method provided by the present application can save the time when process 1 executes the first step, thereby greatly shortening the total time for multiple processes to execute the initialization process. It should be understood that the example in Figure 3 is only for the convenience of understanding this solution and is not used to limit this solution.

[0069] In an embodiment of the present application, through the above-mentioned scheme, the first step in the initialization process of the first process and the initialization process of the second process are executed in parallel, that is, some steps in the initialization process of the first process and the second process with a dependent relationship are executed in parallel. Compared with the serial method between processes with a dependent relationship, the total time consumed in the initialization process of the entire process set is shortened, which is beneficial to improving the efficiency of the initialization process of the entire process set.

[0070] In addition, the above description provides the specific steps of the first step, which reduces the difficulty of implementing this solution; "loading the dynamic link library, reading the configuration file and configuration parameters of the first process, applying for resources used by the first process, communicating with the hardware corresponding to the first process, and generating data corresponding to the service of the first process". These steps in the initialization process do not need to rely on the services provided by other processes and are very time-consuming. Since in the method provided in this application, when the first process depends on the first service provided by the second process, the first process executes the first step and the second process executes the initialization process in parallel, compared to the first process starting initialization after the second process completes initialization, the longer the time spent in the first step, the more time is saved by adopting the method provided in the application.

[0071] Optionally, based on the embodiment corresponding to FIG. 1 above, please refer to FIG. 4 , which is another flowchart of a method for initializing a process provided in an embodiment of the present application. The method for initializing a process provided in an embodiment of the present application may include:

[0072] 401. The process management module starts all processes in a process set to trigger initialization of all processes in the process set, where the process set includes at least two processes that need to be initialized.

[0073] In the embodiment of the present application, the specific implementation of step 401 can refer to the above description of step 101 and will not be repeated here.

[0074] Because the EM starts the first module before executing step 401 to trigger the initialization of the first module, optionally, during the initialization process of the first module, the first module can load preset configuration information. The configuration information may indicate the services that each of the at least one third process can provide, and the process set includes the aforementioned at least one third process; and / or, the configuration information may indicate at least one service that each of the at least one fourth process can rely on, and the process set includes the aforementioned at least one fourth process; and / or, the configuration information may also indicate other information, etc., which are not exhaustive here.

[0075] The at least one third process includes the second process, and the at least one fourth process includes the first process. It should be noted that "third process" refers to a process recorded in the configuration information that can provide services. For example, in one scenario, all processes included in the at least one third process can be a subset of a process set, and each third process in the at least one third process can provide services to other processes in the process set. In another scenario, "at least one third process" and "process set" have the same scope, meaning that each process in the process set is a third process, and the configuration information indicates the services that each process in the process set can provide. "Fourth process" refers to a process recorded in the configuration information that relies on services provided by other processes in the process set. "First process" and "second process" refer to a set of processes with a dependency relationship included in all processes that need to be initialized during the initialization process. The first process is one of the at least one fourth process, and the service that the first process relies on is provided by the second process in the at least one third process.

[0076] The configuration information may include the identity information of each third process and information about the services that each third process can provide. The configuration information may also include the identity information of each fourth process and information about each of the at least one service that each fourth process can rely on. For example, the identity information of the third process may be the name of the third process or other identity information. The information about the services that the third process can provide may be the name of the service or other information. The identity information of the fourth process may be the name of the fourth process or other identity information. The information about the services that the fourth process can rely on may be the name of the service that the fourth process can rely on, etc., all of which are not limited here.

[0077] For example, the configuration information may record at least one valid second dependency. Any of these at least one valid second dependency may be a fourth process's dependency on a service provided by a third process. The fourth process is the dependent party of the configuration information record, and the third process is the dependent party of the configuration information record. Each valid dependency recorded in the configuration information includes the identity information of the third process, information about the service provided by the third process, and the identity information of the fourth process. To facilitate understanding of this solution, the configuration information is shown in table form below. Please refer to Table 1 below.

[0078] Table 1

[0079] As shown in the first row of Table 1, process A depends on service 1 provided by process C, which is a legal dependency. Process A can be understood as the identity information of the fourth process recorded in the configuration information, process C can be understood as the identity information of the third process recorded in the configuration information, and service 1 is the information of the service provided by the third process. For the contents of rows 2 to 6 in Table 1, please refer to the above introduction to row 1 for understanding, and will not be repeated here one by one. It should be noted that the above Table 1 only uses the six dependency relationships A, B, C, D, E, and F as examples to explain at least one legal dependency recorded in the configuration information, and is not used to limit this solution.

[0080] Optionally, the configuration information may further include first correspondences, each first correspondence including identity information of a third process and information about services that the third process can provide. For a more intuitive understanding of this solution, please refer to Table 2 below.

[0081] Table 2

[0082] As shown in the second row of Table 2 above, process C is an example of the third process, and service 1 is an example of all services that can be provided by the third process. For the contents of the third and fourth rows in Table 2, please refer to the above introduction to row 2 for understanding, and will not be repeated here. It should be noted that the examples in Table 2 are only for the convenience of understanding this solution and are not used to limit this solution.

[0083] Optionally, the configuration information further includes a second correspondence, each second correspondence including identity information of a fourth process and information about each of at least one service that the fourth process can rely on. For a more intuitive understanding of this solution, please refer to Table 3 below.

[0084] Table 3

[0085] As shown in the second row of Table 3 above, process A is an example of the fourth process, and service 1 is an example of the service on which the fourth process depends. For the contents of rows 3 to 6 in Table 3, please refer to the above introduction to row 2 for understanding, and will not be repeated here. It should be noted that the examples in Table 3 are only for the convenience of understanding this solution and are not used to limit this solution.

[0086] Optionally, after starting all processes in the process set, the process management module can obtain a process identifier (PID) for each process in the process set, where the PID of each process in the process set includes the PID of the first process and the PID of the second process. The process management module can send the PID of each process in the process set to the first module, and the first module can correspondingly obtain the PID of each process in the process set. Exemplarily, the process management module can send first mapping information to the first module, where the first mapping information includes a mapping relationship between the identity information of each process in the process set and the PID of each process in the process set.

[0087] The "Process Identifier" (PID) is also called the "Process Identification Number." The PID is randomly assigned by the operating system while a process is running. While the process is running, the PID remains unchanged. However, after a process terminates, the PID is recycled by the operating system and may be assigned to a new process. This means that while a first process is running, the PID of the first process can temporarily and uniquely identify the first process; while a second process is running, the PID of the second process can temporarily and uniquely identify the second process.

[0088] Exemplarily, after completing initialization, the first module can construct a one-to-one fourth communication channel between the first module and the process management module, and the fourth communication channel is used to enable the first module to receive messages from the process management module; then the process management module can send the PID of each process in the process set to the first module through the fourth communication channel. For example, the process management module can send the first mapping information to the first module through the fourth communication channel.

[0089] 402. The first process executes the first step and sends subscription information to the first module, where the subscription information is used to indicate a service readiness notification for subscribing to the first service, wherein the at least two processes in the process set include a first process and a second process. When the first process determines that the first process depends on the first service, the initialization process of the first process is divided into a first step and a second step, the execution of the first step does not depend on services provided by other processes in the process set, and the execution of the second step depends on the first service provided by the second process.

[0090] In the embodiment of the present application, the specific implementation method of step 402 can be included in the above description of step 102 and will not be repeated here.

[0091] Optionally, after completing initialization, the first module can create a one-to-one communication pipe between the first module and each first process; the one-to-one communication pipe between the first module and each first process includes a first communication pipe and a second communication pipe, the first communication pipe is used to enable the first module to receive messages from the first process, and the second communication pipe is used to enable the first process to receive messages from the first module.

[0092] Optionally, after completing initialization, the first module can create a one-to-one communication pipe between the first module and each fourth process according to the configuration information; since at least one fourth process includes the first process, the one-to-one communication pipe between the first module and each fourth process includes the first communication pipe and the second communication pipe.

[0093] Optionally, the first module may create a one-to-one communication channel between the first module and each first process based on the PID of the first process. The first module may then store second mapping information, where the second mapping information includes a mapping relationship between an interface of each communication channel established by the first module and the PID. The second mapping information includes a mapping relationship between the interface of the first communication channel and the PID of the first process, and a mapping relationship between the second communication channel and the PID of the first process.

[0094] Since the PID of a process can temporarily and uniquely point to the process during the operation of each process, and the first module can determine the corresponding PID based on the interface of each communication pipe, that is, it can determine the corresponding process based on the interface of each communication pipe. The first module can then determine the PID corresponding to the interface of the first communication pipe, that is, it can determine that the information obtained from the interface of the first communication pipe is sent by the first process based on the interface of the first communication pipe; the first module can also determine the PID corresponding to the interface of the second communication pipe, that is, it can determine that the information written to the interface of the second communication pipe is sent to the first process based on the interface of the second communication pipe.

[0095] In step 402, the first process executes the first step and sends subscription information to the first module through the first communication channel; correspondingly, the first module can receive the subscription information through the first communication channel, and determine, based on the subscription information received from the first communication channel, that the first process wants to subscribe to the service readiness notification of the first service provided by the second process.

[0096] Exemplarily, since the first module receives subscription information from the first communication pipe, the first module can determine the PID of the process that sends the subscription information through the first communication pipe based on the interface of the first communication pipe and the second mapping information; and then, the identity information of the first process can be determined based on the aforementioned determined PID and the first mapping information.

[0097] Exemplarily, the first process may send subscription information to the first module through the first communication channel while executing the first step; alternatively, the first process may send subscription information to the first module through the first communication channel after executing the first step; alternatively, the subscription information may be sent to the first module through the first communication channel first, and then the first step may be executed, etc. The specific details may be determined based on actual conditions and are not limited in this application.

[0098] It should be noted that the first module and the first process may also communicate in other ways. For example, the first module and the first process may also communicate through shared memory, etc. This is not limited in the embodiments of the present application.

[0099] Exemplarily, in one implementation, the subscription information may carry the identity information of the first service. For example, the identity information of the first service may include the name of the first service. The first module may then determine, based on the identity information of the first service carried in the subscription information, which service (that is, the first service) the first process wants to subscribe to for service readiness notification; and further, based on the preset configuration information, may determine which process (that is, the second process) provides the first service.

[0100] In another implementation, the subscription information may carry the identity information of the second process and the identity information of the first service. For example, the identity information of the second process may include the name of the second process, and the identity information of the first service may include the name of the first service. The first module may then determine that the first process wants to subscribe to the service readiness notification of the first service provided by the second process based on the identity information of the second process and the identity information of the first service carried in the subscription information.

[0101] Optionally, the subscription information may also carry other information, such as the identity information of the first process, the PID of the first process or other information. The specific information carried in the subscription information can be determined in combination with the actual application scenario and is not limited in the embodiments of this application.

[0102] 403. The first module determines, based on preset configuration information, at least one service that the first process can rely on, wherein the configuration information indicates at least one service that each fourth process in at least one fourth process can rely on, the at least one fourth process is included in the process set, and the first process is one of the at least one fourth process.

[0103] In the embodiment of the present application, step 403 is an optional step. After obtaining the subscription information, the first module can also determine at least one service that the first process can rely on based on the preset configuration information.

[0104] Exemplarily, in one implementation, since the first module obtains the subscription information through the first communication pipe, the first module can determine the PID of the process that sends the subscription information based on the interface of the first communication pipe and the second mapping information, and then determine the identity information of the process that sends the subscription information based on the PID of the process that sends the subscription information and the first mapping information, that is, the first module can determine the identity information of the first process with the help of the interface of the first communication pipe. Since the preset configuration information indicates at least one service that each fourth process in at least one fourth process can rely on, and the at least one fourth process includes the first process, the first module can determine at least one service that the first process can rely on from the preset configuration information based on the identity information of the first process.

[0105] In an embodiment of the present application, the first module creates a first communication pipe and a second communication pipe used for communication between the first module and the first process based on the PID of the first process. The first module can determine the mapping relationship between the interface of the first communication pipe and the PID of the first process, and can also determine the mapping relationship between the interface of the second communication pipe and the PID of the first process. Therefore, the first module can determine which process the information transmitted through a certain communication pipe comes from based on the mapping relationship between the communication pipe and the PID of the process, thereby avoiding a certain process impersonating another process to send subscription information to the first module, and thus improving the authenticity and security of the "readiness notification of subscription service" process.

[0106] In another implementation, the first module may also obtain the PID of the first process from the subscription information, and determine the identity information of the first process based on the PID of the first process and the first mapping information; and then determine at least one service that the first process can rely on from the preset configuration information based on the identity information of the first process.

[0107] 404. The first module determines whether the at least one service that the first process can rely on includes the first service. If the determination result is yes, the subscription information is determined to be valid. If the determination result is no, the subscription information is determined to be invalid.

[0108] In the embodiment of the present application, step 404 is an optional step. If the judgment result is yes, that is, if the first module determines that the at least one service that the first process can rely on includes the first service, then the first module can determine that the subscription information is valid, that is, if the first process can successfully subscribe to the service readiness notification of the first service provided by the second process; if the judgment result is no, that is, if the first module determines that the at least one service that the first process can rely on does not include the first service, then the first module can determine that the subscription information is invalid, that is, if the first process has not successfully subscribed to the service readiness notification of the first service provided by the second process, and subsequent steps may not be executed.

[0109] 405. When the second process completes initialization of the first service, it sends first information to the first module, where the first information indicates that the first service is ready.

[0110] In the embodiment of the present application, the implementation of step 405 can refer to the above description of step 103 and will not be repeated here.

[0111] Optionally, after completing initialization, the first module may create a third communication channel between the first module and the second process, where the third communication channel is used to transmit the first information, that is, for the first module to receive the first information from the second module.

[0112] Optionally, after completing initialization, the first module can create a one-to-one communication channel between the first module and each third process according to the preset configuration information; since at least one third process includes the second process, the one-to-one communication channel between the first module and each third process includes the third communication channel.

[0113] Exemplarily, the first module can create a one-to-one third communication pipe between the first module and the second process based on the PID of the second process. The above-mentioned second mapping information also includes a mapping relationship between the interface of the third communication pipe between the first module and the second process and the PID of the second process. The first module can then determine the PID corresponding to the interface of the third communication pipe.

[0114] Then in step 405, when the second process completes the initialization of the first service, the second process may send the first information to the first module through the third communication channel; correspondingly, the first module may receive the first information through the third communication channel.

[0115] Exemplarily, since the first module receives the first information from the third communication pipe, the first module can determine the PID corresponding to the interface of the third communication pipe based on the second mapping information; and then determine the identity information of the second process based on the PID corresponding to the interface of the third communication pipe and the first mapping information.

[0116] Exemplarily, the first information includes the identity information of the first service, which indicates that the first service is ready. Optionally, the first information also includes the identity information of the second process, the PID of the second process, and / or other information. The specific information included in the first information can be flexibly set based on the actual application scenario.

[0117] 406. The first module determines, based on preset configuration information, at least one service that the second process can provide, wherein the configuration information indicates a service that each of at least one third process can provide, the at least one third process is included in the process set, and the second process is one of the at least one third process.

[0118] In an embodiment of the present application, step 406 is an optional step. For example, in one implementation, since the first module obtains the first information through the third communication pipe, the first module can determine the PID of the process that sends the first information based on the interface of the third communication pipe and the second mapping information, and then determine the identity information of the process that sends the first information based on the PID of the process that sends the first information and the first mapping information, that is, the first module can determine the identity information of the second process with the help of the interface of the third communication pipe. Since the preset configuration information indicates at least one service that each fourth process in at least one fourth process can rely on, and the aforementioned at least one fourth process includes the second process, the first module can determine at least one service that the second process can provide from the preset configuration information based on the identity information of the second process.

[0119] In another implementation, the first module may also obtain the PID of the second process from the first information, and determine the identity information of the second process based on the PID of the second process and the first mapping information; and then determine at least one service that the second process can provide from the preset configuration information based on the identity information of the second process.

[0120] In an embodiment of the present application, the first module creates a third communication pipe for communication between the first module and the second process based on the PID of the second process. The first module can determine the mapping relationship between the interface of the third communication pipe and the PID of the second process, so that the first module can determine which process the information transmitted through a certain communication pipe comes from based on the mapping relationship between the communication pipe and the PID of the process, thereby avoiding a certain process from impersonating another process to send the first information to the first module, thereby improving the accuracy of the first information obtained by the first module; since the first process needs to ensure that the first service is ready when executing the second step in the initialization process, "improving the accuracy of the first information" is also conducive to avoiding the first process from getting stuck when executing the second step in the initialization process, and is conducive to improving the fluency of the first process in executing the initialization process.

[0121] After starting all processes in the process set, the process management module can easily obtain the PID of each process in the process set. The process management module sends the PID of each process in the process set to the first module, and then the first module can build a one-to-one communication channel between the first module and the process based on the PID of the process, providing a convenient and fast "first module obtains the PID of the process" solution. The authenticity of the PID of the process obtained by the process management module is high, which can further ensure the authenticity of the information obtained by the first module through the communication channel. It should be noted that the first module can also obtain the PID of the first process and the PID of the second process by other means. For example, the first module can also obtain the PID of the first process and the PID of the second process from the operating system (OS) kernel, etc. In the embodiment of the present application, the ways in which the first module obtains the PID of the process are not listed one by one.

[0122] 407. The first module determines whether the at least one service that the second process can provide includes the first service. If the determination result is yes, the process proceeds to step 408. If the determination result is no, the process determines that the first information is invalid.

[0123] In the embodiment of the present application, step 407 is an optional step. After determining the at least one service that the second process can provide, the first module can determine whether the at least one service that the second process can provide includes the first service. If the determination result is yes, then the first information sent by the second process is valid, that is, it is determined that the second service is indeed ready. If the determination result is no, then the second process does not provide the first service at all, and the first information can be determined to be invalid, that is, it is determined that the second service is not ready, and the waiting can continue.

[0124] 408. The first module sends second information to the first process according to the subscription information, where the second information indicates that the first service is ready.

[0125] In the embodiment of the present application, the specific implementation method of step 408 can be understood by referring to the above description of step 104, which will not be repeated here. For example, the first module can send the second information to the first process through the second communication pipe, and the second information is used to inform the first process that the first service is ready. In the embodiment of the present application, since the first module constructs the first communication pipe and the second communication pipe according to the PID of the first process, and the PID of the process can temporarily and uniquely point to a process, the first module can determine the mapping relationship between each communication pipe and the PID of the process. After the first module determines that the first service is ready, it can ensure that the process that subscribes to the readiness notification of the first service can receive the second information, thereby ensuring the smoothness of the initialization process of the first process, and also helping to reduce the time consumption caused by "all processes in the process set completing the initialization process".

[0126] Among them, steps 403 and 404 as well as steps 406 and 407 are all optional. If steps 403 and 404 as well as steps 406 and 407 are all executed, step 408 may include: when the first module determines that at least one service that the first process can rely on includes the first service (that is, the subscription information is valid), and at least one service that the second process can provide includes the first service, sending the second information to the first process.

[0127] If steps 403 and 404 are executed, and steps 406 and 407 are not executed, then after executing step 405, step 408 can be directly entered. Step 408 may include: when the first module determines that at least one service that the first process can rely on includes the first service (that is, the subscription information is valid), sending the second information to the first process.

[0128] If steps 406 and 407 are performed, and steps 403 and 404 are not performed, step 408 may include: sending second information to the first process if the at least one service that the second process can provide includes the first service.

[0129] For a more intuitive understanding of this solution, please refer to Figure 5, which is another schematic diagram of the process initialization method provided in an embodiment of the present application. As shown in Figure 5, while executing the first step in the initialization process, process A sends subscription information 1 to the first module. The subscription information 1 is used to indicate the service readiness notification of the subscription service 1. After the first module obtains the subscription information 1, it can determine that process A wants to subscribe to the service 1 provided by process C, and then can perform validity authentication on the subscription information 1 (i.e., determine whether the subscription information 1 is valid) based on the preset configuration information. After completing the initialization of service 1, process C can also send the first information 1 to the first module. The first information 1 is used to indicate that service 1 is ready. After obtaining the first information 1, the first module can perform validity authentication on the first information 1 (i.e., determine whether the first information 1 is valid) based on the configuration information. If the subscription information 1 is valid and the first information 1 is valid, the first module sends the second information 1 to process A. The second information 1 is used to indicate that service 1 is ready to trigger process A to continue to execute the second step. It should be understood that the example in Figure 5 is only for the convenience of understanding this solution and is not used to limit this solution.

[0130] In an embodiment of the present application, preset configuration information is deployed in the first module, and the configuration information indicates at least one service that each fourth process of at least one fourth process included in the first device can legally rely on. After receiving the subscription information sent by the first process, it can be determined whether the at least one service that the first process can rely on includes the first service in the subscription information, that is, the validity of the subscription information will be judged with the help of the configuration information, thereby ensuring that the subscription to the service readiness notification can only be successfully completed based on a legal dependency relationship, further improving the security of the present solution.

[0131] The configuration information also indicates at least one service that each process in at least one third process can provide, so that after receiving the first information sent by the second process, the first module can determine whether the at least one service provided by the second process includes the first service in the first information. Only when the at least one service that the second process can provide includes the first service, the first information is determined to be valid, that is, the second information is sent to the first process. When other processes impersonate the second process to send a service readiness notification of the first service to the first module, the first module can identify it in time, which is conducive to improving the accuracy of the second information sent by the first module to the first process, thereby further avoiding the first process from getting stuck when executing the second step, so as to ensure the smoothness of the initialization process.

[0132] 409. The first process triggers to continue executing the second step in response to the received second information.

[0133] In the embodiment of the present application, the specific implementation of step 409 can be understood by referring to the above description of step 105, which will not be repeated here.

[0134] In order to more intuitively understand the beneficial effects brought about by the method provided by the present application, the following is explained in conjunction with specific experiments. Taking the experiment on the on-board system in the vehicle as an example, the process set includes 13 processes. In the relevant technology, the aforementioned 13 processes are divided into three groups of processes. The three groups of processes may include Group 1, Group 2 and Group 3. The initialization process of the processes in Group 2 depends on the services provided by the processes in Group 1, and the initialization process of the processes in Group 3 depends on the services provided by the processes in Group 2. The initialization of all processes in Group 1 is completed in parallel first, and then the initialization of all processes in Group 2 is completed in parallel, and then the initialization of all processes in Group 3 is completed in parallel.

[0135] In the method provided in this application, all 13 processes are first started, triggering them to begin executing the initialization process in parallel. After completing the first step, the processes in Groups 2 and 3 enter a waiting state. The processes in Group 1 directly complete the initialization process. After the services provided by the processes in Group 1 are ready, the processes in Group 2 are triggered to continue executing the second step to complete the initialization process. After the services provided by the processes in Group 2 are ready, the processes in Group 3 are triggered to continue executing the second step to complete the initialization process. The time consumed by "all 13 processes completing the initialization process" is reduced by 40%.

[0136] On the basis of the embodiments corresponding to FIG. 1 to FIG. 5 , in order to better implement the above-mentioned solutions of the embodiments of the present application, related devices for implementing the above-mentioned solutions are also provided below. 6 , which is a schematic diagram of a process initialization apparatus provided in an embodiment of the present application. The process initialization apparatus 600 includes: a process management module 601, configured to start all processes in a process set to trigger initialization of all processes in the process set, wherein the process set includes at least two processes to be initialized, wherein the at least two processes include a first process and a second process; a first process 602, configured to execute a first step and send subscription information to a first module, where the subscription information is used to indicate a service readiness notification for a first service subscribed to. When the first process determines that the first process depends on the first service, the initialization process of the first process is divided into a first step and a second step, where the execution of the first step is independent of services provided by other processes in the process set, and the execution of the second step is dependent on the first service provided by the second process; a second process 603, configured to send a first message to the first module when the second process completes initialization of the first service, where the first message indicates that the first service is ready; a first module 604, configured to send a second message to the first process based on the subscription information, where the second message indicates that the first service is ready; and the first process 602 is further configured to trigger execution of the second step in response to the received second message.

[0137] Optionally, the first module 604 is further used to determine at least one service that the second process can provide based on preset configuration information, wherein the configuration information indicates the service that each third process in at least one third process can provide, the process set includes at least one third process, and the second process is one of the at least one third process; the first module 604 is specifically used to send the second information to the first process when the first module 604 determines that the at least one service that the second process can provide includes the first service.

[0138] Optionally, the first module 604 is further used to determine at least one service that the first process can rely on based on preset configuration information, wherein the configuration information indicates at least one service that each fourth process in at least one fourth process can rely on, the process set includes at least one fourth process, and the first process is one of the at least one fourth process; the first module 604 is specifically used to send second information to the first process when the first module 604 determines that the at least one service that the first process can rely on includes the first service.

[0139] Optionally, the first module 604 is further used to create a first communication channel and a second communication channel between the first module 604 and the first process based on the process identifier PID of the first process, the first communication channel being used to transmit subscription information, and the second communication channel being used to transmit second information; and / or, the first module 604 is further used to create a third communication channel between the first module 604 and the second process based on the PID of the second process, the third communication channel being used to transmit the first information.

[0140] Optionally, the process management module 601 is further configured to send the PID of each process in the process set to the first module 604 , where the PID of each process in the process set includes the PID of the first process and the PID of the second process.

[0141] Optionally, the first step includes at least one of the following steps: loading a dynamic link library, reading a configuration file and configuration parameters of the first process, applying for resources used by the first process, communicating with hardware corresponding to the first process, or generating data corresponding to the service of the first process.

[0142] Optionally, the process initialization device 600 is applied to a device, and the device is any of the following: a vehicle, a robot, a household appliance, an industrial computer, a mobile phone, or a tablet.

[0143] It should be noted that the information interaction, execution process, etc. between the modules / units in the process initialization device 600 are based on the same concept as the various method embodiments corresponding to Figures 1 to 5 in this application. For specific contents, please refer to the description in the method embodiments shown above in this application, and will not be repeated here.

[0144] Next, a device provided in an embodiment of the present application is described. Please refer to Figure 7, which is a schematic structural diagram of a device provided in an embodiment of the present application. Specifically, the device 700 includes: a receiver 701, a transmitter 702, a processor 703, and a memory 704 (wherein the number of processors 703 in the device 700 can be one or more, and Figure 7 uses one processor as an example). The processor 703 may include an application processor 7031 and a communication processor 7032. In some embodiments of the present application, the receiver 701, the transmitter 702, the processor 703, and the memory 704 may be connected via a bus or other means.

[0145] The memory 704 may include a read-only memory and a random access memory, and provides instructions and data to the processor 703. A portion of the memory 704 may also include non-volatile random access memory (NVRAM). The memory 704 stores processor and operation instructions, executable modules, or data structures, or subsets or extended sets thereof. The operation instructions may include various operation instructions for implementing various operations.

[0146] Processor 703 controls the operation of the device. In specific applications, the various components of the device are coupled together via a bus system. In addition to a data bus, the bus system may also include a power bus, a control bus, and a status signal bus. However, for clarity, all bus systems are referred to as a bus system in the figure.

[0147] The methods disclosed in the above embodiments of the present application can be applied to or implemented by the processor 703. The processor 703 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor 703 or by software instructions. The above processor 703 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and can further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 703 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application can be directly implemented as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 704, and processor 703 reads the information in memory 704 and performs the steps of the above method in conjunction with its hardware.

[0148] Receiver 701 can be used to receive input digital or character information and generate signal input related to device settings and function control. Transmitter 702 can be used to output digital or character information through the first interface. Transmitter 702 can also be used to send instructions to the disk pack through the first interface to modify data in the disk pack. Transmitter 702 can also include a display device such as a display screen.

[0149] In the embodiment of the present application, the processor 703 is used to execute the method for executing each module and process in the first device in the embodiment corresponding to Figures 1 to 5. It should be noted that the specific manner in which the application processor 7031 in the processor 703 executes the aforementioned steps is based on the same concept as the various method embodiments corresponding to Figures 1 to 5 in the present application, and the technical effects brought about are the same as the various method embodiments corresponding to Figures 1 to 5 in the present application. For specific details, please refer to the description of the method embodiments shown above in the present application, and will not be repeated here.

[0150] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a program for signal processing. When the program is run on a computer, the computer executes the method described in the embodiments shown in Figures 1 to 5 above.

[0151] An embodiment of the present application also provides a computer program product, which includes a program. When the program is run on a computer, the computer executes the method described in the embodiments shown in Figures 1 to 5 above.

[0152] The execution device and training device provided in the embodiments of the present application can specifically be a chip, which includes: a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, a pin, or a circuit. The processing unit can execute computer-executable instructions stored in the storage unit to enable the chip to perform the methods described in the embodiments shown in Figures 1 to 5 above. Optionally, the storage unit is a storage unit within the chip, such as a register, a cache, etc. The storage unit can also be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM), etc.

[0153] The processor mentioned in any of the above places can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the above-mentioned first aspect method.

[0154] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.

[0155] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.

[0156] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0157] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

Claims

1. A method for initializing a process, characterized in that, The method includes: The process management module starts all processes in the process set to trigger initialization of all processes in the process set. The process set includes at least two processes that need to be initialized, and the at least two processes include a first process and a second process; The first process executes a first step and sends subscription information to a first module. The subscription information is used to indicate subscribing to a service ready notification of the first service. Wherein, when the first process determines that the first process depends on the first service, the initialization process of the first process is divided into the first step and a second step. Execution of the first step does not depend on services provided by other processes in the process set, and execution of the second step depends on the first service provided by the second process; When the second process completes initialization of the first service, the second process sends first information to the first module, and the first information indicates that the first service is ready; The first module sends second information to the first process according to the subscription information, and the second information indicates that the first service is ready; In response to receiving the second information, the first process triggers execution of the second step to continue; 2. The method according to claim 1, characterized in that, The method further includes: The first module determines at least one service that the second process can provide according to preset configuration information. The configuration information indicates services that each of at least one third process can provide. The process set includes the at least one third process, and the second process is one of the at least one third process; The first module sending the second information to the first process includes: When the first module determines that at least one service that the second process can provide includes the first service, the first module sends the second information to the first process; 3. The method according to claim 1 or 2, characterized in that, The method further includes: The first module determines at least one service that the first process can depend on according to preset configuration information. The configuration information indicates at least one service that each of at least one fourth process can depend on. The process set includes the at least one fourth process, and the first process is one of the at least one fourth process; The first module sending the second information to the first process includes: When the first module determines that at least one service that the first process can depend on includes the first service, the first module sends the second information to the first process; 4. The method according to claim 1 or 2, characterized in that, The method further includes: The first module creates a first communication pipeline and a second communication pipeline between the first module and the first process according to the process identifier PID of the first process. The first communication pipeline is used to transmit the subscription information, and the second communication pipeline is used to transmit the second information; and / or, The first module creates a third communication pipeline between the first module and the second process according to the PID of the second process, and the third communication pipeline is used to transmit the first information; 5. The method according to claim 4, wherein The method further includes: The process management module sends the PID of each process in the process set to the first module, and the PID of each process in the process set includes the PID of the first process and the PID of the second process.

6. The method according to claim 1 or 2, characterized in that, The first step includes at least one of the following steps: loading a dynamic link library, reading the configuration file and configuration parameters of the first process, applying for resources used by the first process, communicating with the hardware corresponding to the first process, or generating data corresponding to the service of the first process.

7. The method according to claim 1 or 2, characterized in that, The method is applied to a device, and the device is any one of the following: a vehicle, a robot, a home appliance, an industrial control computer, a mobile phone, or a tablet.

8. An initialization device for a process, characterized in that, The device includes: A process management module, configured to start all processes in a process set to trigger initialization of all processes in the process set, where the process set includes at least two processes that need to be initialized, and the at least two processes include a first process and a second process; The first process is configured to execute the first step and send subscription information to the first module, where the subscription information is used to indicate subscribing to a service ready notification of the first service. Wherein, when the first process determines that the first process depends on the first service, the initialization process of the first process is divided into the first step and the second step. The execution of the first step does not depend on services provided by other processes in the process set, and the execution of the second step depends on the first service provided by the second process; The second process is configured to send first information indicating that the first service is ready to the first module when the second process completes the initialization of the first service; The first module is configured to send second information indicating that the first service is ready to the first process according to the subscription information; The first process is further configured to trigger the continuation of the execution of the second step in response to the received second information.

9. The device according to claim 8, wherein The first module is further configured to determine at least one service that the second process can provide according to preset configuration information, where the configuration information indicates services that each of at least one third process can provide, the process set includes the at least one third process, and the second process is one of the at least one third process; The first module is specifically configured to send the second information to the first process when the first module determines that at least one service that the second process can provide includes the first service.

10. The device according to claim 8 or 9, wherein The first module is further configured to determine at least one service that the first process can depend on according to preset configuration information, where the configuration information indicates at least one service that each of at least one fourth process can depend on, the process set includes the at least one fourth process, and the first process is one of the at least one fourth process; The first module is specifically configured to send the second information to the first process when the first module determines that at least one service on which the first process can depend includes the first service.

11. The apparatus according to claim 8 or 9, wherein the first module is further configured to create a first communication pipeline and a second communication pipeline between the first module and the first process according to the process identifier PID of the first process, where the first communication pipeline is used to transmit the subscription information, and the second communication pipeline is used to transmit the second information; and / or the first module is further configured to create a third communication pipeline between the first module and the second process according to the PID of the second process, where the third communication pipeline is used to transmit the first information.

12. The apparatus according to claim 11, wherein the process management module is further configured to send the PID of each process in the process set to the first module, where the PID of each process in the process set includes the PID of the first process and the PID of the second process.

13. The device according to claim 8 or 9, characterized in that, The first step includes at least one of the following steps: loading a dynamic link library, reading a configuration file and configuration parameters of the first process, applying for resources used by the first process, communicating with hardware corresponding to the first process, or generating data corresponding to a service of the first process.

14. The device according to claim 8 or 9, characterized in that, The apparatus is applied to a device, and the device is any one of the following: a vehicle, a robot, a home device, an industrial control computer, a mobile phone, or a tablet.

15. A device, characterized in that, comprising a processor and a memory, the processor being coupled to the memory the memory is used to store a program; the processor is configured to execute the program in the memory, so that the device executes the method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that, A program is stored in the computer-readable storage medium, and when the program runs on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

17. A computer program product, characterized in that, The computer program product includes a program, and when the program runs on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Process initialization method and related equipment

    CN120276813A

  • Cluster-based Node.js multi-process management method and system

    CN113986491A

  • Control device

    CN114407909A

  • Cross-process event processing method and device, electronic equipment, storage medium and vehicle

    CN115373874A

  • Techniques for managing software container dependencies

    US20180246729A1

Cited By

  • Starting method and starting device of embedded system, storage medium and vehicle

    CN121680944A