Process initialization method and related equipment

Through parallel initialization and configuration information management, the problem of long-term initialization time of multi-processes is solved, and an efficient, safe and smooth initialization process of process collections is realized.

CN120276813APending Publication Date: 2025-07-08HUAWEI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410030435.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-05
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

During the initialization process of multiple processes, due to the existence of dependencies, the process 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 dependent process 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 process time of process collection, improves the efficiency and fluency of the initialization process, and reduces the risk of stuck under inter-process dependencies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276813A_ABST
    Figure CN120276813A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a process initialization method and related equipment. The method can be used for initializing at least two processes in the equipment. The method comprises the following steps: a process management module triggers all processes in a process set to initialize, wherein the process set comprises a first process and a second process; if 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, and the first process executes the first step and sends subscription information for indicating a service ready notification for subscribing to the first service to the first module; when the second process completes the initialization of the first service, sending first information indicating that the first service is ready to the first module; the first module sends second information indicating that the first service is ready to the first process according to the subscription information; and the first process responds to the received second information to trigger to continue to execute the second step, so that the efficiency of the initialization process of the whole process set is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technologies, and in particular, to a method for initializing a process and related devices. Background Art

[0002] Generally, multiple processes are deployed in the operating systems of various electronic devices. In the initialization processes of the foregoing multiple processes, there may be dependency relationships between different processes among the multiple processes. For example, the multiple processes may include Process 1 and Process 2, and the execution of Process 1 depends on a certain service provided by Process 2. Then, in the process of initializing the foregoing multiple processes, the solution adopted in the related art is to first initialize Process 2, and after the initialization of Process 2 is completed, then start to execute the initialization of Process 1.

[0003] However, in the process of initializing multiple processes, a serial manner is adopted between processes with dependency relationships, resulting in a relatively long time consumed by the initialization processes of the multiple processes. Summary of the Invention

[0004] The embodiments of the present application provide a method for initializing a process and related devices, which shortens the total time consumed in the initialization process of the entire process set and is beneficial to improving the efficiency of the initialization process of the entire process set.

[0005] In a first aspect, the embodiments of the present application provide a method for initializing a process. This method can be used to initialize at least two processes in a device (hereinafter referred to as the first device for convenience of description). In this method, a process management module in the first device starts all processes in the process set to trigger all processes in the process set to start initializing in parallel. The foregoing 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.

[0006] The first process in the first device executes the first step and sends subscription information to the first module in the first device. The subscription information is used to indicate subscribing to the service ready notification of the first service. Among them, 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. Exemplarily, the first step includes a part of the entire initialization process of the first process, and the execution of the part of the process included in the foregoing first step does not depend on the services provided by other processes in the process set; the second step includes other processes in the entire initialization process of the first process except the first step. It should be noted that the first process can send the subscription information to the first module while executing the first step; or, the first process can also send the subscription information to the first module after executing the first step; or, it can also send the subscription information to the first module first and then execute the first step, etc.

[0007] When the second process in the first device completes the initialization of the first service, the second process can send the first information to the first module. The first information 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 according to 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. The second information indicates that the first service is ready; after receiving the second information, the first process, in response to the received second information, triggers the continuation of the execution of the second step to complete the initialization process of the first process.

[0008] In this implementation manner, the process management module starts all the processes that need to be initialized, and then all the processes that need to be initialized can start 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 the first process finishes executing the first step, it can send subscription information to the first module to subscribe to the service ready notification of the first service; when the second process completes the initialization of the first service, it sends the first information to the first module to inform the first module that the first service is ready; then the first module can send the second information to the first process to inform the third process that the first service is ready, thereby triggering the third process to continue executing the second step; through the foregoing solution, some steps in the initialization processes of the first process and the second process with a dependency relationship are executed in parallel. Compared with the completely serial manner, the total duration 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.

[0009] In a possible implementation, in this method, preset configuration information may be stored in the first module. The aforementioned preset configuration information indicates the services that each of 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. Exemplarily, in one case, all the processes included in at least one third process may be a subset of the process set, and each of the at least one third processes can provide services to other processes in the process set. In another case, the scope of "at least one third process" is the same as that of the "process set", 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 can also determine at least one service that the second process can provide according to the preset configuration information. Then, the first module sending the second information to the first process may include: 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.

[0010] In this implementation, the preset configuration information indicates at least one service that each process in at least one third process can provide. Thus, after the first module receives the first information sent by the second process, it can determine whether the at least one service provided by the second process includes the first service in the first information according to the preset configuration information. Only when the at least one service that the second process can provide includes the first service, will it send the second information to the first process. Then, when other processes impersonate the second process to send a service ready notice for the first service to the first module, the first module can identify it in time, which is beneficial to improving the accuracy of the second information sent by the first module to the first process, thereby further avoiding the first process getting stuck when executing the second step, so as to ensure the smoothness of the initialization process.

[0011] In a possible implementation, in this method, preset configuration information may be stored in the first module. The aforementioned preset configuration information indicates at least one service that each of at least one fourth process can depend 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 can also determine at least one service that the first process can depend on according to the preset configuration information. Then, the first module sending the second information to the first process may include: 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.

[0012] In this implementation manner, the preset configuration information indicates at least one service that each of the at least one fourth process can legally depend on. Then, after receiving the subscription information sent by the first process, it can determine whether at least one service that the first process can depend on includes the first service in the subscription information. That is, it will use this configuration information to judge the validity of the subscription information, thereby ensuring that the subscription of the service ready notification can be successfully completed only based on legal dependency relationships, and further improving the security of this solution.

[0013] In a possible implementation manner, in this method, the first module can also 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. The first communication pipeline is used to transmit subscription information, and the second communication pipeline is used to transmit second information. And / or, the first module can also create a third communication pipeline between the first module and the second process according to the PID of the second process. The third communication pipeline is used to transmit first information.

[0014] In this implementation manner, the first module creates a first communication pipeline and a second communication pipeline used for communication between the first module and the first process according to the PID of the first process. Then, the first module can determine the mapping relationship between the interface of the first communication pipeline and the PID of the first process, and the mapping relationship between the interface of the second communication pipeline and the PID of the first process. Thus, the first module can determine which process the information transmitted through a certain communication pipeline comes from according to the mapping relationship between the communication pipeline and the PID of the process, thereby preventing a certain process from impersonating another process to send subscription information to the first module. That is, it improves the authenticity and security of the process of "subscribing to the ready notification of the service". And after the first module determines that the first service is ready, it can ensure that the process subscribing to the ready notification of the first service can receive the second information based on the mapping relationship between the interface of the second communication pipeline and the PID of the first process, 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 complete the initialization process".

[0015] The first module creates a third communication pipeline for communication between the first module and the second process based on the PID of the second process. Then the first module can determine the mapping relationship between the interface of the third communication pipeline and the PID of the second process. Thus, the first module can determine which process the information transmitted through a certain communication pipeline comes from according to the mapping relationship between the communication pipeline and the PID of the process, thereby preventing a certain process from impersonating another process to send the first information to the first module, and 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 of the initialization process, "improving the accuracy of the first information" also helps to prevent the first process from getting stuck when executing the second step of the initialization process, which is beneficial to improving the fluency of the first process when executing the initialization process.

[0016] In a possible implementation manner, in this method, after the process management module starts all processes in the process set, it 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.

[0017] Among them, "process identifier" can also be called "process identification number". The PID is randomly assigned by the operating system when the process is running and will not change during the process running. However, when the process terminates, the PID will be recycled by the operating system and may be reassigned to a newly running process. That is, when the first process is running, the PID of the first process can temporarily and uniquely point to the first process; when the second process is running, the PID of the second process can temporarily and uniquely point to the second process.

[0018] In this implementation manner, since the process management module can conveniently obtain the PID of each process in the process set after starting all processes in the process set, and the process management module sends the PID of each process in the process set to the first module, then the first module can construct a one-to-one communication pipeline between the first module and the process according to the PID of the process, providing a convenient and fast solution for "the first module to obtain the PID of the process", 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.

[0019] In a 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, 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. Exemplarily, "loading a dynamic link library" includes reading the executable file related to the first process. "Applying for resources used by the first process" can also be referred to as "applying for system resources used by the first process". For example, the aforementioned system resources may include memory resources, thread resources, or other system resources, etc. "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 pictures, the hardware corresponding to the first process includes a sensor for image acquisition; another example, if the service provided by the first process includes playing songs, the hardware corresponding to the first process includes a speaker, etc. For example, if the service provided by the first process is encryption and decryption, "data corresponding to the function of the first process" includes the key used during encryption and / or decryption; another example, if the service provided by the first process is playing songs, "data corresponding to the function of the first process" includes information about the songs being played, etc.

[0020] In this implementation, the above description provides what specific steps the first step embodies, reducing the implementation difficulty of this solution; the steps in the initialization process such as "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, and generating data corresponding to the service of the first process" do not need to rely on services provided by other processes and take a long time. 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 executing the first step and the second process executing the initialization process are parallel. Compared with the first process starting to initialize after the second process completes the initialization, the longer the time consumed in the first step, the more time is saved by adopting the method provided in the application.

[0021] In a possible implementation, the method is applied to a first device, and the first device is any one of the following: a vehicle, a robot, a home appliance, an industrial control computer, a mobile phone, or a tablet. In this implementation, various specific product forms of the first device are provided, greatly expanding the application scenarios of this solution and improving the implementation flexibility of this solution.

[0022] Second aspect, an embodiment of the present application provides an initialization device for processes, which can be used to initialize at least two processes in a first device. The initialization device for processes includes: a process management module, configured to start all processes in a 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 is configured to execute a first step and send subscription information to a first module. The subscription information is used to indicate subscribing to a service ready notification of 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 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, when the second process completes the initialization of the first service, send a first message to the first module, and the first message indicates that the first service is ready; the first module is configured to send a second message to the first process according to the subscription information, and the second message indicates that the first service is ready; the first process is further configured to, in response to receiving the second message, trigger the continuation of the execution of the second step.

[0023] In the second aspect of the present application, the initialization device for processes is further configured to execute the steps in the first aspect and various possible implementation manners of the first aspect. For the specific implementation manners of the steps, the meanings of the terms, and the beneficial effects brought in the second aspect, reference can be made to the first aspect, which will not be elaborated here.

[0024] Third aspect, an embodiment of the present application provides a device, including a processor and a memory. The processor is coupled to the memory. The memory is configured to store a program; the processor is configured to execute the program in the memory, so that the device executes the method described in the first aspect above.

[0025] Fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program runs on a computer, it causes the computer to execute the method described in the first aspect above.

[0026] Fifth aspect, an embodiment of the present application provides a computer program product. The computer program product includes a program. When the program runs on a computer, it causes the computer to execute the method described in the first aspect above.

[0027] 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, it can send or process the data and / or information involved in the above methods. In a possible design, the chip system further includes a memory for storing the necessary program instructions and data of the terminal device or communication device. The chip system can be composed of chips or can include chips and other discrete devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 FIG. is a schematic flowchart of an initialization method for a process provided by an embodiment of the present application;

[0029] Figure 2 FIG. is another schematic diagram of an initialization method for a process provided by an embodiment of the present application;

[0030] Figure 3 FIG. is a schematic diagram of the beneficial effects brought by the method provided by the present application;

[0031] Figure 4 FIG. is another schematic flowchart of an initialization method for a process provided by an embodiment of the present application;

[0032] Figure 5 FIG. is another schematic diagram of an initialization method for a process provided by an embodiment of the present application;

[0033] Figure 6 FIG. is a schematic structural diagram of an initialization device for a process provided by an embodiment of the present application;

[0034] Figure 7 FIG. is a schematic structural diagram of a device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] The embodiments of the present application will be described below with reference to the accompanying drawings. Those of ordinary skill in the art will understand that with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0036] The terms "first", "second", etc. in the specification and claims of the present application and the above accompanying drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances, which is only a way of distinguishing when describing objects with the same attributes in the embodiments of the present application. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, so that a process, method, system, product or device including a series of units does not have to be limited to those units, but may include other units not clearly listed or inherent to these processes, methods, products or devices.

[0037] In the embodiments of the present application, "indication" may include direct indication and indirect indication, and may also include explicit indication and implicit indication. If the information indicated by a certain piece of information (such as the indication information described below) is called the information to be indicated, then in the specific implementation process, there are many ways to indicate the information to be indicated. For example, 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, etc. It is also possible to indirectly indicate the information to be indicated by indicating other information that has an association relationship with the information to be indicated; it is also possible to only indicate a part of the information to be indicated, while the other parts of the information to be indicated are known or pre-agreed. For example, the arrangement order of each piece of information pre-agreed (such as protocol pre-definition) can be used to implement the indication of specific information, thereby reducing the indication overhead to a certain extent. The present application does not limit the specific manner of indication. It can be understood 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.

[0038] The method provided by the present application can be applied to the scenario of initializing a set of processes in a device (for the convenience of description, hereinafter referred to as the "first device"); for example, the first device can be a vehicle, a robot, a home device, an industrial control 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 scenario of the present solution and improves the implementation flexibility of the present solution. It should be noted that which electronic devices the present application can be specifically applied to can be flexibly determined in combination with the actual application scenario, and it is not limited in the embodiments of the present application.

[0039] When initializing multiple processes in the process set, the process set may include Process 1 and Process 2. If the execution of the initialization process of Process 1 depends on a certain service provided by Process 2, that is, the completion of the initialization process of Process 1 requires the service provided by Process 2 to be in a ready state. In the present application, "the service is in a ready state" can also be understood as "the service is in a state where it can provide services externally". In the related art, in order to meet the foregoing premise, Process 2 will be initialized first, and after the initialization of Process 2 is completed, the initialization process of Process 1 will be started. Since the initialization of Process 1 and the initialization of Process 2 are completely serial, the time consumed by the initialization process of the entire process set is relatively long.

[0040] In order to shorten the duration consumed by the initialization process of the entire process set, the present application provides an initialization method for processes. The following begins to describe the specific implementation process of the method provided by the present application. Specifically, please refer to Figure 1 ,Figure 1 FIG. 1 is a schematic flowchart of an initialization method for a process provided by an embodiment of the present application. The initialization method for a process provided by an embodiment of the present application may include:

[0041] 101. The process management module starts all processes in the process set to trigger all processes in the process set to be initialized. The process set includes at least two processes that need to be initialized.

[0042] 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 initializing; exemplarily, both the process management module and the first module may specifically be represented as processes.

[0043] The process management module may further determine the process set, which includes all processes that the first device needs to initialize at the current moment, and there are at least two processes among all the processes that need to be initialized. After the first module is initialized, the process management module may start all processes in the foregoing process set to trigger all processes in the process set to start initializing.

[0044] 102. The first process executes the first step and sends subscription information to the first module. The subscription information is used to indicate subscribing to a service ready notification of the first service. Among at least two processes in the process set, there are 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.

[0045] In an embodiment of the present application, there is at least one legal first dependency relationship among at least two processes included in the foregoing process set. Any one of the foregoing at least one legal first dependency relationships may be that a first process depends on the first service provided by a second process. Exemplarily, the service provided by a certain first process includes navigation, and the first service is a positioning service. When providing a navigation service, it is necessary to first determine the position of the first device through the first service. Then it can be said that the first process depends on the first service provided by the second process. It should be understood that the example here is only for facilitating the understanding of the present solution and is not used to limit the present solution.

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

[0047] When it is determined in the first process that the first process depends on the first service, the entire initialization process of the first process can be divided into a first step and a second step. Among them, the execution of the foregoing 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 in 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 in the initialization process, the first service provided by the second process needs to be in a ready state.

[0048] Exemplarily, the first step includes a part of the entire initialization process of the first process, and the execution of the part of the process included in the foregoing first step does not depend on the services provided by other processes in the process set; the second step includes the other processes in the entire initialization process of the first process except the first step.

[0049] Optionally, the first step includes at least one of the following steps: loading dynamic link libraries, 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 do not depend on the services provided by other processes in the process set.

[0050] Exemplarily, "loading dynamic link libraries" includes reading the executable file related to the first process. "Applying for resources used by the first process" can also be referred to as "applying for system resources used by the first process". For example, the foregoing system resources may include memory resources, thread resources, or other system resources, etc. "Communicating with the hardware corresponding to the first process" can be used to inform the hardware that the first process has started. For example, if the service provided by the first process includes taking pictures, the hardware corresponding to the first process includes a sensor for image acquisition; another example is that if the service provided by the first process includes playing songs, the hardware corresponding to the first process includes a speaker, etc. For example, if the service provided by the first process is encryption and decryption, the "data corresponding to the function of the first process" includes the key used when performing encryption and / or decryption; another example is that if the service provided by the first process is playing songs, the "data corresponding to the function of the first process" includes information about the played songs, etc. It should be understood that the examples here are only for facilitating the understanding of the present solution and are not used to limit the present solution.

[0051] After the process management module starts all the processes in the process set, all the processes in the process set start to be initialized in parallel. Each of the at least one first process included in the foregoing process set may execute a first step and send subscription information to a first module. Correspondingly, after receiving the subscription information, the first module may, based on the subscription information, determine that the first process has subscribed to the service readiness notification of the first service provided by the second process. Exemplarily, the first process may send the subscription information to the first module while executing the first step; or, the first process may also send the subscription information to the first module after executing the first step; or, the first process may also send the subscription information to the first module first and then execute the first step, etc.

[0052] Exemplarily, after each first process sends the subscription information to the first module, the initialization process of each first process may be switched to a paused state, and the foregoing paused state may also be referred to as a semi-service state, a waiting state, an aborted state, or other terms, etc.

[0053] 103. When the second process completes the initialization of the first service, it sends a first message to the first module, and the first message indicates that the first service is ready.

[0054] In the embodiments of the present application, after the process management module starts all the processes in the process set, all the processes in the process set start to be initialized in parallel. After the second process in the foregoing process set completes the initialization of the first service, it may send a first message to the first module. Correspondingly, the first module may, based on the foregoing first message, determine that the first service provided by the second process is ready.

[0055] 104. The first module sends a second message to the first process according to the subscription information, and the second message indicates that the first service is ready.

[0056] In the embodiments of the present application, when the first module determines that the first service provided by the second process is ready, it may determine which processes have subscribed to the service readiness notification of the first service according to the received subscription information, and then send a second message to each first process that has subscribed to the service readiness notification of the first service. Correspondingly, each first process may, based on the received second message, determine that the first service is ready.

[0057] Exemplarily, in one case, the second message 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 message 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 examples of the second message here are only for facilitating the understanding of the present solution and are not used to limit the present solution.

[0058] 105. The first process triggers the continuation of the execution of the second step in response to the received second information.

[0059] In the embodiments of the present application, each first process can wake up the initialization process in the waiting state and trigger the continuation of the execution of the second step in the initialization process in response to the received second information, so as to complete the initialization process of the first process, and thus the service provided by the first process is also ready.

[0060] For a more intuitive understanding of this solution, please refer to Figure 2 and Figure 3 , Figure 2 which is another schematic diagram of the initialization method of the process provided by the embodiments of the present application, Figure 3 and which is a schematic diagram of the beneficial effects brought by the method provided by the present application. First, refer to Figure 2 , Figure 2 wherein, taking the process set including process A, process B, process C, process D and process E as an example, among them, both process A and process B depend on service 1 provided by process C, process C does not depend on services provided by other processes in the process set, process D depends on service 2 provided by process E, and process E does not depend on services provided by other processes in the process set as an example for illustration; among them, service 1 is provided by process C, services 2 and 3 are provided by process E, and in the initialization process of process E, the initialization of service 2 will be executed first, and then the initialization of service 3 will be executed. It should be noted that in the Figure 2 example, a dependency relationship 1 is formed between process A and process C. In the 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 the 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 the dependency relationship 3, process D is the first process and process E is the second process.

[0061] After the process management module starts all the processes in the process set, it triggers process A, process B, process C, process D and process E to start initializing in parallel.

[0062] 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, while process A is executing the first step of the initialization process, it sends subscription information 1 to the first module. Subscription information 1 is used to inform the first module that process A subscribes to the service ready notification of service 1; while process B is executing the first step of the initialization process, it sends subscription information 2 to the first module. Subscription information 2 is used to inform the first module that process B subscribes to the service ready notification of service 1; while process D is executing the first step of the initialization process, it sends subscription information 3 to the first module. Subscription information 3 is used to inform the first module that process D subscribes to the service ready notification of service 2.

[0063] Since process C and process E do not depend on services provided by other processes in the process set, after process C and process E start initializing, they can directly complete the entire initialization process. Among them, after process C completes the initialization process, that is, after process C completes the initialization of service 1, process C can send the first information 1 to the first module. The 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 the first information 2 to the first module. The first information 2 is used to inform the first module that service 2 is ready, and process E can continue to execute the initialization of service 3 in parallel to complete the entire initialization process of process E.

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

[0065] In response to the received second information 1, process A triggers the continuation of the execution of the second step in 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 execution of the second step in 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 execution of the second step in the initialization process to complete the initialization process of process D. It should be understood that Figure 3 the examples in

[0066] Please continue to refer to Figure 3 , Figure 3 which includes two sub-schematic diagrams (a) and (b), Figure 3 both sub-schematic diagrams (a) and (b) of Figure 3Sub - schematic diagram (a). In the related art, the initialization process of Process 1 is executed first. 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. Referring again to Figure 3 Sub - schematic diagram (b). When the method provided by this application is adopted, since the process management module starts Process 1 and Process 2 in parallel, the initialization processes of Process 1 and Process 2 start to execute in parallel. After Process 1 finishes the first step, it enters a suspended state. After Process 2 completes the initialization process, Process 1 starts to execute the second step, thus completing the initialization process of Process 1. By comparing Figure 3 Sub - schematic diagram (a) and Figure 3 Sub - schematic diagram (b), it can be seen that the method provided by this application can save the time when Process 1 executes the first step, thereby greatly shortening the total duration of the initialization processes of multiple processes. It should be understood that Figure 3 The examples in

[0067] are only for facilitating the understanding of this solution and are not used to limit this solution. In the embodiments of this application, through the above - mentioned solution, 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 processes of the first process and the second process with a dependency relationship are executed in parallel. Compared with the serial method between processes with a dependency relationship, the total duration 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.

[0068] In addition, in the above description, the specific steps of the first step are provided, which reduces the implementation difficulty of this solution; the steps in the initialization process such as "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" do not depend on the services provided by other processes and take a long time. Since in the method provided by this application, when the first process depends on the first service provided by the second process, the execution of the first step by the first process and the execution of the initialization process by the second process are in parallel. Compared with the situation where the first process starts to initialize after the second process completes the initialization, the longer the time consumed in the first step, the more time is saved by using the method provided by this application.

[0069] Optionally, on the basis of the above Figure 1 corresponding embodiment, please refer to Figure 4 , Figure 4 which is another process flow diagram of the process initialization method provided by the embodiments of this application. The process initialization method provided by the embodiments of this application may include:

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

[0071] In the embodiment of this application, for the specific implementation manner of step 401, reference can be made to the description of step 101 above, which will not be elaborated here.

[0072] Since before executing step 401, EM will start the first module to trigger the initialization of the first module. Optionally, in the initialization process of the first module, the first module can load preset configuration information. Wherein, the configuration information indicates the services that each of at least one third process can provide, and the process set includes the aforementioned at least one third process; and / or, the configuration information indicates at least one service that each of at least one fourth process can depend on, and the process set includes the aforementioned at least one fourth process; and / or, the configuration information can also indicate other information, etc., which will not be elaborated here.

[0073] The aforementioned at least one third process includes the second process, and the aforementioned at least one fourth process includes the first process. It should be noted that the "third process" refers to the process that can provide services recorded in the configuration information; for example, in one case, all the processes included in at least one third process can be a subset of the process set, and each of the at least one third processes can provide services to other processes in the process set. In another case, the scope of the "at least one third process" is the same as that of the "process set", 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 "fourth process" refers to the process that needs to depend on the services provided by other processes in the process set recorded in the configuration information. The "first process" and the "second process" refer to a group of processes with a dependency relationship among all the processes that need to be initialized in the initialization process. Then the first process is one of the aforementioned at least one fourth processes, and the service that the first process depends on is provided by the second process in the aforementioned at least one third processes.

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

[0075] Exemplarily, the configuration information may record at least one legal second dependency relationship. Any one of the at least one legal second dependency relationships may be that a fourth process depends on a certain service provided by a third process. The fourth process is the dependent party recorded in the configuration information, and the third process is the dependent party recorded in the configuration information. Each legal dependency relationship recorded in the configuration information includes the identity information of the third process, the information of 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 the following table 1 for reference.

[0076]

[0077] Table 1

[0078] As shown in the first row of Table 1, the fact that Process A depends on Service 1 provided by Process C is a legal dependency relationship. 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 content in the second to sixth rows of Table 1, reference can be made to the above introduction of the first row for understanding, and details will not be repeated here; it should be noted that only six dependency relationships, namely Dependency Relationship A, Dependency Relationship B, Dependency Relationship C, Dependency Relationship D, Dependency Relationship E, and Dependency Relationship F, in Table 1 above are taken as examples to explain the at least one legal dependency relationship recorded in the configuration information, and it is not used to limit this solution.

[0079] Optionally, the configuration information may further include a first correspondence relationship. Each first correspondence relationship includes the identity information of a third process and the information of the services that the third process can provide. For a more intuitive understanding of this solution, please refer to the following Table 2.

[0080]

[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 the services that the third process can provide. For the content in the third and fourth rows of Table 2, reference can be made to the above introduction of the second row for understanding, and details will not be repeated here; it should be noted that the examples in Table 2 are only for facilitating understanding of this solution and are not used to limit this solution.

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

[0084]

[0085] Table 3

[0086] 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 content in the third to sixth rows of Table 3, reference can be made to the aforementioned introduction of the second row for understanding, and details will not be elaborated here; it should be noted that the examples in Table 3 are only for facilitating the understanding of this solution and are not used to limit this solution.

[0087] Optionally, after starting all the processes in the process set, the process management module can obtain the process identifier (process identification, PID) of each process in the process set. 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. Correspondingly, the first module can obtain the PID of each process in the process set. Exemplarily, the process management module can send the first mapping information to the first module, and the first mapping information includes the mapping relationship between the identity information of each process in the process set and the PID of each process in the process set.

[0088] Among them, the "process identifier" can also be called the "process identification number". The PID is randomly assigned by the operating system when the process is running. The PID will not change during the running of the process, but when the process terminates, the PID will be recycled by the operating system and may be reassigned to a newly running process. That is, when the first process is running, the PID of the first process can temporarily and uniquely point to the first process; when the second process is running, the PID of the second process can temporarily and uniquely point to the second process.

[0089] Exemplarily, after the first module completes initialization, it can construct a one-to-one fourth communication pipeline between the first module and the process management module. The fourth communication pipeline 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 this fourth communication pipeline. For example, the process management module can send the first mapping information to the first module through this fourth communication pipeline.

[0090] 402. The first process executes the first step and sends subscription information to the first module. The subscription information is used to indicate subscribing to the service ready notification of the first service. Among them, at least two processes in the process set include the first process and the 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 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.

[0091] In the embodiments of the present application, the specific implementation manner of step 402 may refer to the description of step 102 above, and will not be elaborated here.

[0092] Optionally, after the first module completes initialization, it may create a one-to-one communication pipeline between the first module and each first process; the one-to-one communication pipeline between the first module and each first process includes a first communication pipeline and a second communication pipeline. The first communication pipeline is used to enable the first module to receive messages from the first process, and the second communication pipeline is used to enable the first process to receive messages from the first module.

[0093] Optionally, after the first module completes initialization, it may create a one-to-one communication pipeline between the first module and each fourth process according to the configuration information; since at least one of the fourth processes includes the first process, the one-to-one communication pipeline between the first module and each fourth process includes a first communication pipeline and a second communication pipeline.

[0094] Optionally, the first module may create a one-to-one communication pipeline between the first module and each first process according to the PID of the first process. Then, the second mapping information may be stored in the first module. The second mapping information includes the mapping relationship between the interface of each communication pipeline constructed by the first module and the PID. The second mapping information includes: the mapping relationship between the interface of the first communication pipeline and the PID of the first process, and the mapping relationship between the second communication pipeline and the PID of the first process.

[0095] Since during the operation of each process, the PID of the process can temporarily and uniquely point to the process, and the first module can determine the corresponding PID according to the interface of each communication pipeline, that is, it can determine the corresponding process according to the interface of each communication pipeline. Then the first module can determine the PID corresponding to the interface of the first communication pipeline, that is, it can determine that the information obtained from the interface of the first communication pipeline is sent by the first process according to the interface of the first communication pipeline; the first module can also determine the PID corresponding to the interface of the second communication pipeline, that is, it can determine that the information written to the interface of the second communication pipeline is sent to the first process according to the interface of the second communication pipeline.

[0096] In step 402, the first process executes the first step and sends subscription information to the first module through the first communication pipeline; correspondingly, the first module can receive the subscription information through the first communication pipeline, and determine, according to the subscription information received from the first communication pipeline, that the first process wants to subscribe to the service ready notification of the first service provided by the second process.

[0097] Exemplarily, since the first module receives the subscription information from the first communication pipeline, the first module can determine the PID of the process that sends the subscription information through the first communication pipeline according to the interface of the first communication pipeline and the second mapping information; further, the identity information of the first process can be determined according to the determined PID and the first mapping information.

[0098] Exemplarily, the first process can send the subscription information to the first module through the first communication pipeline while executing the first step; or, the first process can also send the subscription information to the first module through the first communication pipeline after executing the first step; or, the subscription information can be sent to the first module through the first communication pipeline first, and then the first step can be executed, etc.; it can be specifically determined according to the actual situation and is not limited in this application.

[0099] It should be noted that other communication methods can also be adopted between the first module and the first process. For example, the first module and the first process can also communicate through shared memory, etc., which is not limited in the embodiments of this application.

[0100] 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. Then, the first module can determine, according to the identity information of the first service carried in the subscription information, which service (i.e., the first service) the first process wants to subscribe to the service ready notification of; further, it can be determined, according to the preset configuration information, which process (i.e., the second process) provides the first service.

[0101] 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. Then, the first module can determine, according to the identity information of the second process and the identity information of the first service carried in the subscription information, that the first process wants to subscribe to the service ready notification of the first service provided by the second process.

[0102] Optionally, other information can also be carried in the subscription information, such as the identity information of the first process, the PID of the first process, or other information, etc. Which information is carried in the specific subscription information can be determined according to the actual application scenario and is not limited in the embodiments of this application.

[0103] 403. The first module determines at least one service that the first process can depend on according to the preset configuration information, where the configuration information indicates at least one service that each of at least one fourth process can depend 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.

[0104] 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 depend on according to the preset configuration information.

[0105] Exemplarily, in one implementation, since the first module obtains the subscription information through the first communication pipeline, the first module can determine the PID of the process that sends the subscription information according to the interface of the first communication pipeline and the second mapping information, and then determine the identity information of the process that sends the subscription information according to 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 by means of the interface of the first communication pipeline. Since the preset configuration information indicates at least one service that each of at least one fourth process can depend 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 depend on from the preset configuration information according to the identity information of the first process.

[0106] In the embodiment of the present application, the first module creates a first communication pipeline and a second communication pipeline used for communication between the first module and the first process according to the PID of the first process. Then the first module can determine the mapping relationship between the interface of the first communication pipeline and the PID of the first process, and can also determine the mapping relationship between the interface of the second communication pipeline and the PID of the first process. Thus, the first module can determine which process the information transmitted through a certain communication pipeline comes from according to the mapping relationship between the communication pipeline and the PID of the process, thereby avoiding a process impersonating another process to send subscription information to the first module, that is, improving the authenticity and security of the process of "ready notification of the subscription service".

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

[0108] 404. The first module determines whether at least one service that the first process can depend on includes the first service. If the determination result is yes, it is determined that the subscription information is valid; if the determination result is no, it is determined that the subscription information is invalid.

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

[0110] 405. When the second process completes the initialization of the first service, send a first message to the first module, where the first message indicates that the first service is ready.

[0111] In the embodiments of the present application, the implementation manner of step 405 may refer to the description of step 103 above, and will not be elaborated here.

[0112] Optionally, after the first module completes initialization, a third communication pipeline between the first module and the second process may be created. The third communication pipeline is used to transmit the first message, that is, for the first module to receive the first message from the second module.

[0113] Optionally, after the first module completes initialization, one-to-one communication pipelines between the first module and each third process may be created according to the preset configuration information; since at least one third process includes the second process, the one-to-one communication pipelines between the first module and each third process include the third communication pipeline.

[0114] Exemplarily, the first module may create a one-to-one third communication pipeline between the first module and the second process according to the PID of the second process. The second mapping information further includes the mapping relationship between the interface of the third communication pipeline between the first module and the second process and the PID of the second process, so that the first module can determine the PID corresponding to the interface of the third communication pipeline.

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

[0116] Exemplarily, since the first module receives the first message from the third communication pipeline, the first module may determine the PID corresponding to the interface of the third communication pipeline according to the second mapping information; and then based on the PID corresponding to the interface of the third communication pipeline and the first mapping information, determine the identity information of the second process.

[0117] Exemplarily, the first information includes the identity information of the first service, and the identity information of the first service is used to indicate that the first service is ready. Optionally, the first information further includes the identity information of the second process, the PID of the second process, and / or other information, etc. Specifically, which information is carried in the first information can be flexibly set according to the actual application scenario.

[0118] 406. The first module determines at least one service that the second process can provide according to the preset configuration information, where the configuration information indicates the services that each of at least one third process in at least one third process can provide, at least one third process is included in the process set, and the second process is one of the at least one third process.

[0119] In the embodiment of the present application, step 406 is an optional step. Exemplarily, in one implementation manner, since the first module obtains the first information through the third communication pipeline, the first module can determine the PID of the process that sends the first information according to the interface of the third communication pipeline and the second mapping information, and then determine the identity information of the process that sends the first information according to 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 by means of the interface of the third communication pipeline. Since the preset configuration information indicates at least one service that each of at least one fourth process can depend on, and the 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 according to the identity information of the second process.

[0120] In another implementation manner, the first module can also obtain the PID of the second process from the first information, determine the identity information of the second process according to 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 according to the identity information of the second process.

[0121] In the embodiment of the present application, the first module creates a third communication pipeline for communication between the first module and the second process according to the PID of the second process. Then, the first module can determine the mapping relationship between the interface of the third communication pipeline and the PID of the second process. Thus, the first module can determine which process the information transmitted through a certain communication pipeline comes from according to the mapping relationship between the communication pipeline and the PID of the process, thereby avoiding a certain process impersonating another process to send the first information to the first module, and 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" also helps to avoid stalling when the first process executes the second step in the initialization process, and is beneficial to improving the fluency of the first process when executing the initialization process.

[0122] Since the process management module can conveniently obtain the PID of each process in the process set after starting all the processes in the process set, the process management module sends the PID of each process in the process set to the first module. Furthermore, the first module can build a one-to-one communication pipeline between the first module and the process according to the PID of the process, providing a convenient and fast solution for the first module to obtain the PID of the process, 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. It should be noted that the first module can also obtain the PID of the first process and the PID of the second process in other ways. 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. The embodiments of the present application do not list all the ways for the first module to obtain the PID of the process one by one.

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

[0124] In the embodiment of the present application, step 407 is an optional step. After the first module determines at least one service that the second process can provide, it can determine whether at least one service that the second process can provide includes the first service. If the determination result is yes, it proves that 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, it proves that the second process does not provide the first service at all, and it can be determined that the first information is invalid, that is, it is determined that the second service is not ready yet, and then it can continue to wait.

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

[0126] In the embodiments of the present application, the specific implementation manner of step 408 can be understood by referring to the description of step 104 above, and will not be elaborated here. Exemplarily, the first module may send a second message to the first process through the second communication pipeline, and the second message is used to inform the first process that the first service is ready. In the embodiments of the present application, since the first communication pipeline and the second communication pipeline are constructed by the first module 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 pipeline and the PID of the process. After the first module determines that the first service is ready, it can ensure that the process subscribing to the ready notification of the first service can receive the second message, 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 complete the initialization process".

[0127] Among them, steps 403 and 404, and steps 406 and 407 are all optional. If steps 403 and 404, and steps 406 and 407 are all executed, then step 408 may include: when the first module determines that at least one service that the first process can depend 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 a second message to the first process.

[0128] If steps 403 and 404 are executed and steps 406 and 407 are not executed, then after step 405 is executed, 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 depend on includes the first service (that is, the subscription information is valid), sending a second message to the first process.

[0129] If steps 406 and 407 are executed and steps 403 and 404 are not executed, then step 408 may include: when at least one service that the second process can provide includes the first service, sending a second message to the first process.

[0130] For a more intuitive understanding of this solution, please refer to Figure 5 , Figure 5 which is another schematic diagram of the process initialization method provided by the embodiments of the present application. As Figure 5As shown, while Process A is executing the first step of the initialization process, it sends Subscription Information 1 to the first module. This Subscription Information 1 is used to indicate a subscription for the service ready notification of Service 1. After the first module obtains the Subscription Information 1, it can determine that Process A wants to subscribe to Service 1 provided by Process C. Furthermore, it can perform a validity authentication on the Subscription Information 1 according to the preset configuration information (that is, determine whether the Subscription Information 1 is valid). After Process C completes the initialization of Service 1, it 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 the first module obtains the First Information 1, it can perform a validity authentication on the First Information 1 according to the configuration information (that is, determine whether the First Information 1 is valid). When 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, so as to trigger Process A to continue executing the second step. It should be understood that Figure 5 the examples in

[0131] In the embodiments of the present application, preset configuration information is deployed in the first module. This configuration information indicates at least one service that each of the at least one fourth process included in the first device can legally depend on. Furthermore, after receiving the subscription information sent by the first process, it can determine whether at least one service that the first process can depend on includes the first service in the subscription information. That is, it will use this configuration information to judge the validity of the subscription information, thus ensuring that the subscription of the service ready notification can be successfully completed only based on legal dependency relationships, and further improving the security of this solution.

[0132] This configuration information also indicates at least one service that each of the at least one third process can provide. Thus, after the first module receives the first information sent by the second process, it can determine whether at least one service provided by the second process includes the first service in the first information. Only when at least one service provided by the second process includes the first service, it is determined that the first information is valid. That is, it will send the second information to the first process. Then, when other processes impersonate the second process and send the service ready notification of the first service to the first module, the first module can identify it in time, which is beneficial to improving the accuracy of the second information sent by the first module to the first process, thereby further avoiding the first process getting stuck when executing the second step, so as to ensure the smoothness of the initialization process.

[0133] 409. In response to the received second information, the first process triggers the continuation of the execution of the second step.

[0134] In the embodiments of the present application, the specific implementation manner of step 409 can be understood by referring to the description of step 105 above, and will not be elaborated here.

[0135] To more intuitively understand the beneficial effects brought by the method provided in this application, the following will be described in combination with specific experiments. Taking the experiment on the in-vehicle system in a vehicle as an example, the process set includes 13 processes. In the related art, the aforementioned 13 processes are divided into three groups of processes, which may include the first group, the second group, and the third group. The initialization process of the processes in the second group depends on the services provided by the processes in the first group, and the initialization process of the processes in the third group depends on the services provided by the processes in the second group. First, initialize all the processes in the first group in parallel, then initialize all the processes in the second group in parallel, and then initialize all the processes in the third group in parallel.

[0136] In the method provided in this application, first start all the processes among the 13 processes, triggering the 13 processes to start executing the initialization process in parallel. Among them, the processes in the second group and the third group enter the waiting state after completing the first step; the processes in the first group directly complete the initialization process; after the services provided by the processes in the first group are ready, the processes in the second group trigger to continue executing the second step to complete the initialization process; after the services provided by the processes in the second group are ready, the processes in the third group trigger to continue executing the second step to complete the initialization process. The time consumption brought by the operation of "all the 13 processes complete the initialization process" is reduced by 40%.

[0137] In Figures 1 to 5 Based on the corresponding embodiments, in order to better implement the above solutions of the embodiments of this application, the following also provides related devices for implementing the above solutions. Specifically refer to Figure 6 , Figure 6 is a schematic structural diagram of an initialization device for processes provided in an embodiment of this application. The initialization device 600 for processes includes: a process management module 601, configured to start all the processes in the process set to trigger all the processes in the process set to perform initialization. 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 602, configured to execute a first step and send a subscription message to a first module, where the subscription message is used to indicate subscribing to a service ready notification of a first service. Among them, 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; a second process 603, configured to send a first message to the first module when the second process completes the 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 according to the subscription message, where the second message indicates that the first service is ready; the first process 602 is further configured to trigger to continue executing the second step in response to receiving the second message.

[0138] Optionally, the first module 604 is further configured to determine, according to preset configuration information, at least one service that the second process can provide, where the configuration information indicates the services that each of at least one third process in the process set can provide, the process set includes at least one third process, and the second process is one of the at least one third process; specifically, when the first module 604 determines that at least one service that the second process can provide includes a first service, the first module 604 is configured to send second information to the first process.

[0139] Optionally, the first module 604 is further configured to determine, according to preset configuration information, at least one service that the first process can depend on, where the configuration information indicates the at least one service that each of at least one fourth process in the process set can depend on, the process set includes at least one fourth process, and the first process is one of the at least one fourth process; specifically, when the first module 604 determines that at least one service that the first process can depend on includes a first service, the first module 604 is configured to send second information to the first process.

[0140] Optionally, the first module 604 is further configured to create a first communication pipeline and a second communication pipeline between the first module 604 and the first process according to the process identifier PID of the first process, where the first communication pipeline is used to transmit subscription information, and the second communication pipeline is used to transmit second information; and / or, the first module 604 is further configured to create a third communication pipeline between the first module 604 and the second process according to the PID of the second process, where the third communication pipeline is used to transmit first information.

[0141] 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, and the PID of each process in the process set includes the PID of the first process and the PID of the second process.

[0142] 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 the hardware corresponding to the first process, or generating data corresponding to the service of the first process.

[0143] Optionally, the process initialization device 600 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.

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

[0145] Next, a device provided by an embodiment of the present application will be introduced. Please refer to Figure 7 , Figure 7 which is a schematic structural diagram of the device provided by the embodiment of the present application. Specifically, the device 700 includes: a receiver 701, a transmitter 702, a processor 703, and a memory 704 (where the number of processors 703 in the device 700 can be one or more, Figure 7 and one processor is taken as an example here). Among them, 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 through a bus or other means.

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

[0147] The processor 703 controls the operation of the device. In a specific application, the various components of the device are coupled together through a bus system, where the bus system may include a power bus, a control bus, a status signal bus, etc. in addition to a data bus. However, for the sake of clarity, all kinds of buses are referred to as a bus system in the figure.

[0148] The method disclosed in the 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, the steps of the above method can be completed by the integrated logic circuit in hardware or instructions in software form in the processor 703. The above-mentioned 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, 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 the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 704, and the processor 703 reads the information in the memory 704 and combines its hardware to complete the steps of the above method.

[0149] The receiver 701 can be used to receive input digital or character information, and generate signal inputs related to the relevant settings and function controls of the device. The transmitter 702 can be used to output digital or character information through the first interface; the transmitter 702 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 702 can also include a display device such as a display screen.

[0150] In the embodiments of the present application, the processor 703 is used to execute Figures 1 to 5 the methods executed by each module and process in the first device in the corresponding embodiments. It should be noted that the specific manner in which the application processor 7031 in the processor 703 executes the foregoing steps is based on the same concept as the corresponding method embodiments in the present application Figures 1 to 5 and the technical effects brought by it are the same as those of the corresponding method embodiments in the present application Figures 1 to 5 For the specific content, reference can be made to the description in the method embodiments shown above in the present application, and details will not be repeated here.

[0151] In an embodiment of the present application, a computer-readable storage medium is further provided. A program for signal processing is stored in the computer-readable storage medium. When it runs on a computer, the computer is caused to execute the method described in the foregoing Figures 1 to 5 embodiment shown.

[0152] In an embodiment of the present application, a computer program product is further provided. The computer program product includes a program. When the foregoing program runs on a computer, the computer is caused to execute the method described in the foregoing Figures 1 to 5 embodiment shown.

[0153] The execution device and training device provided in the embodiment of the present application may specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit may be, for example, a processor, and the communication unit may be, for example, an input / output interface, a pin, or a circuit. The processing unit may execute computer-executable instructions stored in the storage unit to cause the chip to execute the method described in the foregoing Figures 1 to 5 embodiment shown. Optionally, the storage unit is a storage unit inside the chip, such as a register or a cache. The storage unit may also be a storage unit outside the chip and inside the radio access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.

[0154] Among them, the processor mentioned anywhere above may 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 method in the first aspect above.

[0155] In addition, it should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the device embodiments provided in the present application, the connection relationships between the modules indicate that they have communication connections, which may specifically be implemented as one or more communication buses or signal lines.

[0156] Through the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures for implementing the same function can also be diverse, such as analog circuits, digital circuits, or dedicated circuits, etc. However, for this application, in more cases, software program implementation is a better implementation method. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disc of a computer, etc., and includes several instructions to enable a computer device (which can be a personal computer, training device, or network device, etc.) to execute the methods described in various embodiments of this application.

[0157] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.

[0158] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a dedicated 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, computer, training device, or data center to another website, computer, training device, or data center in a wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. 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 or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive (SSD)), etc.

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; The first process triggers execution of the second step to continue in response to receiving the second information.

2. The method according to claim 1, wherein 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, characterized in that, 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. 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. 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 device 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 device 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 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.

14. The device according to claim 8 or 9, characterized in that, The device 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

Cited By

  • Process initialization method and related device

    WO2025145590A1