Mirroring service starting method oriented to operating system and electronic equipment

By decomposing the mirror service into core services and non-core services and prioritizing the loading of core services, the problem of slow startup of the mirror service is solved, and the rapid startup of the mirror service and the efficient operation of the operating system is achieved.

CN119829150AActive Publication Date: 2025-04-15GUANGZHOU KETENG INFORMATION TECH
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202411905993.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-15
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

The existing technology cannot achieve the rapid start of mirror services, which affects the availability and service quality of the operating system.

Method used

By responding to the mirror service startup instruction, the mirror service is broken down into core services and non-core services, the core services are loaded first, and after the core services are loaded, the non-core services are loaded in turn to achieve the rapid start of the mirror service.

Benefits of technology

It realizes the rapid start of mirror services and improves the availability and service quality of the operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829150A_ABST
    Figure CN119829150A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an operating system-oriented mirroring service starting method and electronic equipment. The method comprises the following steps: in response to an operating system-oriented mirroring service starting instruction, decomposing a to-be-started mirroring service into a core service and a plurality of non-core services, and starting the core service by loading the core service; under the condition that loading of the core service is completed, the multiple non-core services are loaded in sequence according to the loading sequence of the multiple non-core services, so that the multiple non-core services are started in sequence. According to the technical scheme provided by the embodiment of the invention, the quick starting of the mirror image service oriented to the operating system can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to an operating system-oriented mirror service startup method and an electronic device. Background Art

[0002] Dianhong IoT Operating System is an industrial IoT operating system launched for the power industry. It aims to meet the needs of interconnection, efficient collaboration and intelligent management of power equipment, and provides a unified and efficient operating platform for power equipment.

[0003] On this basis, the image service for the operating system is the core component of the operating system. The image service is loaded into the memory when the power equipment starts. The power equipment has extremely high requirements for the speed and stability of startup, so the efficiency of the image service startup directly affects the availability and service quality of the operating system.

[0004] In the process of implementing the present invention, the inventors found that the prior art has the following technical problems: currently, it is impossible to quickly start the mirror service, which needs to be solved urgently. Summary of the invention

[0005] The embodiment of the present invention provides an operating system-oriented mirror service startup method and an electronic device, so as to realize the rapid startup of the operating system-oriented mirror service.

[0006] According to one aspect of the present invention, a method for starting an operating system-oriented image service is provided, which may include:

[0007] In response to the mirror service startup instruction for the operating system, decomposing the mirror service to be started into a core service and a plurality of non-core services;

[0008] Start the core service by loading it;

[0009] When the core service is loaded, the multiple non-core services are loaded in sequence according to the loading order of the multiple non-core services, so as to start the multiple non-core services in sequence.

[0010] According to another aspect of the present invention, there is provided an electronic device, which may include:

[0011] at least one processor; and

[0012] a memory communicatively connected to at least one processor; wherein,

[0013] The memory stores a computer program executable by at least one processor, and the computer program is executed by at least one processor so that the at least one processor implements the operating system-oriented mirror service startup method provided by any embodiment of the present invention when executing the computer program.

[0014] The technical solution of the embodiment of the present invention, by responding to the mirror service startup instruction for the operating system, decomposes the mirror service to be started into a core service and multiple non-core services, thereby reducing the volume of the mirror service, thereby realizing the optimization of the mirror structure; on this basis, further, by loading the core service to start the core service, the priority startup of the core service is realized; when the core service is loaded, according to the loading order of multiple non-core services, multiple non-core services are loaded in sequence to start multiple non-core services in sequence, thereby completing the startup process of the mirror service. The above technical solution, by prioritizing the loading of the core service, the non-core service delays the asynchronous loading through the layered mirror mechanism, that is, after waiting for the core service to be loaded, the non-core service is asynchronously loaded in the background, thereby realizing the rapid startup of the mirror service.

[0015] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 is a flow chart of a mirror service startup method for an operating system provided according to an embodiment of the present invention;

[0018] Figure 2 is a flowchart of another operating system-oriented mirror service startup method provided according to an embodiment of the present invention;

[0019] Figure 3 is a flowchart of another operating system-oriented mirror service startup method provided according to an embodiment of the present invention;

[0020] Figure 4 is a flowchart of another operating system-oriented mirror service startup method provided according to an embodiment of the present invention;

[0021] Figure 5 is a flowchart of an optional example of another operating system-oriented mirror service startup method provided according to an embodiment of the present invention;

[0022] Figure 6It is a structural block diagram of a mirror service startup device for an operating system provided according to an embodiment of the present invention;

[0023] Figure 7 The invention is a schematic diagram of the structure of an electronic device for implementing the operating system-oriented mirror service startup method according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. The situations of "target", "original", etc. are similar and will not be repeated here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Before introducing the embodiment of the present invention, the implementation process of the currently used mirror service startup solution and the specific reasons why it cannot realize the rapid startup of the mirror service are first exemplarily described, so as to better understand why the embodiment of the present invention can quickly start the mirror service.

[0027] For example, the current design for image services is usually a monolithic architecture. Built-in services must be loaded synchronously before they can be started. However, the synchronous loading of non-core services will affect the startup speed of core services, resulting in the inability to quickly start image services. Therefore, optimizing the image structure and optimizing the startup sequence of image services become the key to improving the startup speed of image services.

[0028] Figure 1It is a flowchart of a mirror service startup method for an operating system provided in an embodiment of the present invention. This embodiment is applicable to the case of starting a mirror service. The method can be executed by a mirror service startup device for an operating system provided in an embodiment of the present invention, and the device can be implemented by software and / or hardware. The device can be integrated in an electronic device, and the electronic device can be various terminal devices or servers, and in particular, it can be a power device among various terminal devices.

[0029] See also Figure 1 The method of the embodiment of the present invention specifically includes the following steps:

[0030] S110. In response to the mirror service startup instruction for the operating system, decompose the mirror service to be started into a core service and a plurality of non-core services.

[0031] Among them, the mirror service startup instruction can be understood as an instruction to start the mirror service. The mirror service is a mirror service for the operating system. In combination with the application scenarios that may be involved in the embodiments of the present invention, it may include at least one of a system kernel, a basic driver, a file system, a network protocol stack, a log system, a monitoring service, and a device management tool. This is related to the actual situation and is not specifically limited here.

[0032] In response to the mirror service start instruction, the mirror service is decomposed into a core service and a plurality of non-core services. In the embodiment of the present invention, the core service and the non-core service can be optionally set as required.

[0033] Specifically, for core services, optionally, the number of the core services may be one or more, which is related to the actual situation and is not specifically limited here. Optionally, the one or more non-core services may include at least one of the system kernel, basic driver, file system, and network protocol stack, which is related to the actual situation and is not specifically limited here. Among them, the system kernel is the core part of the operating system, responsible for managing hardware resources and providing underlying services. The basic driver can ensure that the hardware can communicate and work normally, such as storage device drivers and network drivers. The file system is used to load the driver of the boot disk file system. The network protocol stack is used to provide basic network communication capabilities.

[0034] For non-core services, the number of the non-core services is multiple. On this basis, optionally, the multiple non-core services may include a log system, a monitoring service, and a device management tool, etc. This is related to the actual situation and is not specifically limited here. Among them, the log system is responsible for recording various information generated by the operating system during operation. The monitoring service is mainly used to monitor the hardware devices connected to the computer, and the hardware devices may include internal components (such as hard disks and graphics cards, etc.) and external devices (such as mice and keyboards, etc.). The device management tool is mainly used to manage and configure the hardware devices connected to the computer.

[0035] In the embodiment of the present invention, optionally, the core service may also be referred to as a core module, and the non-core service may also be referred to as a non-core module, which is not specifically limited herein.

[0036] S120. Start the core service by loading the core service.

[0037] Among them, by loading the core service to start the core service, the more core core service is loaded first. In the embodiment of the present invention, optionally, when there are multiple core services, the multiple core services can be loaded synchronously or sequentially, which can be set as needed and is not specifically limited here.

[0038] S130. When the core service has been loaded, load the multiple non-core services in sequence according to the loading order of the multiple non-core services, so as to start the multiple non-core services in sequence.

[0039] The loading sequence can represent the order in which multiple non-core services are loaded. When the core service has been loaded, multiple non-core services can be loaded in sequence according to the loading sequence to start the multiple non-core services in sequence, thereby completing the startup process of the mirror service.

[0040] The technical solution of the embodiment of the present invention, by responding to the mirror service startup instruction for the operating system, decomposes the mirror service to be started into a core service and multiple non-core services, thereby reducing the volume of the mirror service, thereby realizing the optimization of the mirror structure; on this basis, further, by loading the core service to start the core service, the priority startup of the core service is realized; when the core service is loaded, according to the loading order of multiple non-core services, multiple non-core services are loaded in sequence to start multiple non-core services in sequence, thereby completing the startup process of the mirror service. The above technical solution, by prioritizing the loading of the core service, the non-core service delays the asynchronous loading through the layered mirror mechanism, that is, after waiting for the core service to be loaded, the non-core service is asynchronously loaded in the background, thereby realizing the rapid startup of the mirror service.

[0041] Figure 2It is a flowchart of another operating system-oriented mirror service startup method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, core services and some non-core services among multiple non-core services are preloaded into the memory; starting the core service by loading the core service may include: starting the core service by loading the core service from the memory; wherein the non-core services preloaded into the memory are loaded from the memory. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.

[0042] See also Figure 2 The method of this embodiment may specifically include the following steps:

[0043] S210. In response to the mirror service startup instruction for the operating system, decompose the mirror service to be started into a core service and multiple non-core services, wherein the core service and some of the multiple non-core services are preloaded into the memory.

[0044] S220. Start the core service by loading the core service from the memory.

[0045] Among them, since the core service has been preloaded into the memory, the core service can be loaded from the memory, thereby reducing the disk read delay and further improving the startup speed of the image service.

[0046] S230. When the core service has been loaded, multiple non-core services are loaded in sequence according to the loading order of the multiple non-core services, so as to start the multiple non-core services in sequence, wherein the non-core services preloaded into the memory are loaded from the memory.

[0047] Among them, for non-core services preloaded into the memory, the non-core services can be loaded from the memory, thereby reducing the disk read delay and further improving the startup speed of the mirror service.

[0048] The technical solution of the embodiment of the present invention can reduce disk read latency and further improve the startup speed of the mirror service by preloading core services and some non-core services into the memory and then loading these services from the memory.

[0049] An optional technical solution is to preload non-core services into memory and predetermine them by the following steps:

[0050] After the mirror service is started a first preset number of times, determining a first service among the plurality of non-core services whose usage time after startup is greater than or equal to a preset first time threshold;

[0051] A first operating parameter of the first service is collected, a heat coefficient is generated according to the first operating parameter, and when the heat coefficient is greater than or equal to a preset heat threshold, the first service is used as a non-core service preloaded into the memory.

[0052] Among them, the first service can be understood as a non-core service whose usage time after startup is greater than or equal to a preset first time threshold. Collect the first operating parameters of the first service. In the present technical solution, optionally, the first operating parameters may include at least one of the usage time of the first service after the rth startup, the number of calls, the average memory occupancy, the maximum memory occupancy, the average occupancy of the central processing unit (CPU), and the maximum CPU occupancy. This is related to the actual situation and is not specifically limited here. Generate a heat coefficient based on the first operating parameter, and when the heat coefficient is greater than or equal to the preset heat threshold, use the first service as a non-core service preloaded into the memory, that is, when the mirror service is started next time, the non-core service can be preloaded into the memory.

[0053] In the technical solution, optionally, the first preset number of times can be 4 times, 5 times or 6 times, etc., the first time threshold can be 50 minutes, 60 minutes or 70 minutes, etc., and the preset heat threshold can be 0.5, 0.6 or 0.7, etc. These can be set according to actual needs and are not specifically limited here.

[0054] The above technical solution realizes adaptive adjustment of the volume of core services by calculating the heat coefficient of non-core services.

[0055] On this basis, optionally, the first operating parameter may include the usage time, number of calls, average memory occupancy, maximum memory occupancy, average CPU occupancy, and maximum CPU occupancy of the first service after the rth startup;

[0056] The heat coefficient is generated by the following formula:

[0057]

[0058] Among them, Hot represents the heat coefficient, σ represents the sigmoid activation function, R1 represents the first preset number, Time r Indicates the usage time, Feq r Indicates the number of calls. Indicates the average memory usage. Indicates the maximum memory usage. Indicates the average CPU usage. represents the maximum occupancy rate of the central processing unit, u1 represents the first weight coefficient, u2 represents the second weight coefficient, u3 represents the third weight coefficient, and u4 represents the fourth weight coefficient.

[0059] Among them, 1≤r≤R1; the sum of each weight coefficient can be 1; the sigmoid activation function σ can be used to control the value range of the heat coefficient Hot between 0 and 1.

[0060] The above technical solution realizes the rapid and accurate calculation of the heat coefficient.

[0061] Figure 3 It is a flowchart of another mirror service startup method for an operating system provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, the loading order can be predetermined by the following steps: after the mirror service is started for a second preset number of times, a plurality of second services whose usage time after startup is greater than or equal to a preset second time threshold are determined among a plurality of non-core services; the second operating parameters corresponding to each second service are collected, and a graph network data is constructed based on all the collected second operating parameters; the graph network data is input into a pre-trained loading order prediction model, and the loading order is obtained based on the output results of the loading order prediction model. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.

[0062] See also Figure 3 The method of this embodiment may specifically include the following steps:

[0063] S310. For the mirror service for the operating system, after the mirror service is started a second preset number of times, determine a plurality of second services among a plurality of non-core services whose usage time after startup is greater than or equal to a preset second time threshold, wherein the non-core services are obtained by decomposing the mirror service.

[0064] Among them, the second service can be understood as a non-core service whose usage time after startup is greater than or equal to a preset second time threshold. In an embodiment of the present invention, optionally, the second time threshold and the first time threshold mentioned above can be the same or different thresholds, which can be set as needed and are not specifically limited here.

[0065] A second service is determined from a plurality of non-core services, and the number of the second service is plural.

[0066] S320. Collect the second operating parameters corresponding to each second service, and construct graph network data based on all the collected second operating parameters.

[0067] For each second service, a second operating parameter of the second service may be collected. In the embodiment of the present invention, optionally, the second operating parameter and the first operating parameter mentioned above may be the same or different operating parameters, which may be set as required and is not specifically limited here.

[0068] Further, based on all the collected second operating parameters, graph network data is constructed. In an embodiment of the present invention, optionally, the graph network data may include nodes, features of nodes, and edges between nodes, wherein the nodes correspond to the second service, that is, a mapping relationship is established between the nodes and the second service. The features can be obtained by processing the second operating parameters corresponding to the nodes. On this basis, optionally, for the missing values ​​in the second operating parameters, the missing values ​​can be interpolated and filled by taking the average value of the second operating parameters of the two adjacent starts of the missing values, and then the second operating parameters of each start are normalized by Z-Score standardization to generate features. Optionally, the number of feature dimensions can be increased by extracting features from the second operating parameters, and the second operating parameters of each start can be normalized by the Min-Max normalization method to generate features, and so on.

[0069] S330. Input the graph network data into a pre-trained loading order prediction model, and obtain the loading order of multiple non-core services based on the output results of the loading order prediction model.

[0070] Among them, the graph network data is input into the loading order prediction model, so as to obtain the loading order of multiple second services, and further obtain the loading order of multiple non-core services. When the mirror service is started next time, the car can load multiple non-core services according to the loading order.

[0071] In an embodiment of the present invention, optionally, during the training process of the loading order prediction model, the loading order of non-core services can be manually adjusted, the startup time of the mirror service after each adjustment is recorded, and the loading order corresponding to the shortest startup time is taken as the label for model training.

[0072] S340. In response to the mirror service startup instruction, decompose the mirror service to be started into a core service and a plurality of non-core services.

[0073] S350. Start the core service by loading the core service.

[0074] S360. When the core service has been loaded, multiple non-core services are loaded in sequence according to the loading order, so as to start the multiple non-core services in sequence.

[0075] Among them, in the embodiment of the present invention, optionally, in the case where the loading order is represented by a loading priority value, the non-core services can be loaded in sequence in the order of the loading priority values ​​from small to large.

[0076] The technical solution of the embodiment of the present invention constructs graph network data and combines it with a loading order prediction model to perform spatiotemporal analysis on the graph network data to adjust the loading order of non-core services, so as to minimize the startup time of the mirror service for the operating system.

[0077] Figure 4 It is a flowchart of another operating system-oriented mirror service startup method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, according to all the collected second operating parameters, the graph network data is constructed, which may include: for each second service, a node corresponding to the second service is generated, and the second operating parameters of the second service are processed to obtain the characteristics of the node; for each two nodes in all the generated nodes, when there is a dependency relationship between the second services corresponding to the two nodes, and / or the correlation coefficient between the characteristics corresponding to the two nodes is greater than the preset correlation coefficient threshold, an edge is constructed between the two nodes; according to all the generated nodes, all the obtained characteristics and all the constructed edges, the graph network data is constructed. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.

[0078] See also Figure 4 The method of this embodiment may specifically include the following steps:

[0079] S410. For the mirror service for the operating system, after the mirror service is started a second preset number of times, multiple second services are determined among multiple non-core services whose usage time after startup is greater than or equal to a preset second time threshold, wherein the non-core services are obtained by decomposing the mirror service.

[0080] S420. For each second service, generate a node corresponding to the second service, collect second operating parameters of the second service, and process the second operating parameters to obtain characteristics of the node.

[0081] In an embodiment of the present invention, optionally, the characteristics of the node can be represented by a characteristic sequence, the characteristic sequence may include sequence units whose number is a second preset number, each sequence unit is represented by a characteristic vector, and the characteristic vector is generated by processing the second operating parameter.

[0082] S430. For every two nodes among all generated nodes, if there is a dependency relationship between the second services corresponding to the two nodes, and / or the correlation coefficient between the features corresponding to the two nodes is greater than a preset correlation coefficient threshold, an edge is constructed between the two nodes.

[0083] Among them, in the embodiment of the present invention, optionally, there may be a dependency relationship between the upstream service and the downstream service, because the upstream service must be started first for the downstream service to use. Exemplarily, the upstream service may be a gateway service, a permission verification service, a log service, etc., and the downstream service may be a power system business service, etc., which is related to the actual situation and is not specifically limited here. The correlation coefficient threshold can be set as needed, for example, it can be 0.6, 0.7 or 0.8, etc., which is not specifically limited here.

[0084] S440. Construct graph network data based on all generated nodes, all obtained features, and all constructed edges.

[0085] S450. Input the graph network data into a pre-trained loading order prediction model, and obtain the loading order of multiple non-core services based on the output results of the loading order prediction model.

[0086] S460. In response to the mirror service startup instruction, decompose the mirror service to be started into a core service and a plurality of non-core services.

[0087] S470. Start the core service by loading the core service.

[0088] S480. When the core service has been loaded, load multiple non-core services in sequence according to the loading order, so as to start the multiple non-core services in sequence.

[0089] The technical solution of the embodiment of the present invention realizes the accurate construction of graph network data through the dependency and association relationships between the second services.

[0090] In an optional technical solution, the feature is represented by a feature sequence, the feature sequence includes sequence units whose number is a second preset number, each sequence unit is represented by a feature vector, and the feature vector is generated by processing the second operating parameter;

[0091] The correlation coefficient is expressed by the following formula:

[0092]

[0093] in, represents the correlation coefficient corresponding to the a-th node and the b-th node, 1≤a≤N, 1≤b≤N, a≠b, N represents the number of nodes in the graph network data; R2 represents the second preset number; Sim represents the cosine similarity; represents the i-th sequence unit corresponding to the a-th node; Represents the i-th sequence unit corresponding to the b-th node.

[0094] in, It represents the i-th sequence unit corresponding to the a-th node, that is, it represents the i-th sequence unit of the feature sequence corresponding to the feature of the a-th node. Similarly, I will not go into details here.

[0095] The above technical solution realizes the accurate determination of the correlation coefficient.

[0096] Another optional technical solution is that the graph network data may include N nodes, and the loading order prediction model includes N first hidden layers, 1 second hidden layer, and N classifiers connected in sequence, the N first hidden layers correspond to the N nodes one by one, and the N classifiers correspond to the N nodes one by one; wherein,

[0097] The input of the second hidden layer is the graph network data and the output is the graph update matrix, which includes N update vectors. The N update vectors are respectively input into the corresponding classifiers, and the classification space of the classifier represents the loading priority of the second service corresponding to the classifier.

[0098] Wherein, in this technical solution, optionally, N first hidden layers may share weight parameters and bias parameters, and each first hidden layer includes R2 hidden units. Each hidden unit of the first hidden layer may be constructed based on a gated recurrent unit (GRU) unit.

[0099] The input of the u-th hidden unit of the n-th first hidden layer can be the u-th sequence unit of the feature sequence corresponding to the feature of the n-th node of the graph network data, 1≤n≤N, 1≤u≤R2, and the output can be a hidden vector. The hidden vector output by the R2-th hidden unit of the n-th first hidden layer is used as the feature of the n-th node.

[0100] The input of the second hidden layer is the graph network data and the output is the graph update matrix, which includes N update vectors, which are respectively input into the corresponding classifiers, and the classification space of the classifier represents the loading priority of the second service that establishes a mapping relationship with the node. On this basis, optionally, the loading priority can be represented by a positive integer ranging from 1 to N, and the smaller the value of the loading priority, the earlier the non-core service is loaded.

[0101] On this basis, optionally, the second hidden layer calculates the graph update matrix by the following formula:

[0102]

[0103] Where Matrix represents the graph update matrix; sigmoid represents the sigmoid activation function, represents the update vector of the i-th node, 1≤i≤N; pile N Indicates stacking the update vectors corresponding to N nodes; T indicates transposition operation; H i represents the hidden vector of the i-th node; H j represents the hidden vector of the jth node; Col i Represents the set of nodes that have edges connected to the i-th node; Represents the number of nodes in the set; W1 represents the first weight parameter; W2 represents the second weight parameter; W3 represents the third weight parameter; B1 represents the first bias parameter; B2 represents the second bias parameter.

[0104] Among them, in this technical solution, optionally, the weight parameters and bias parameters of the loading order prediction model are all learnable hyperparameters. For example, if the size of the hidden vector of the node is 1×8, the second weight parameter W2 and the third weight parameter W3 can be designed as a matrix of size 8×16, and the size of the update vector of the node is 1×16, If it is a matrix of size N×16, then multiplying it with the transposed matrix thereof obtains a matrix of size N×N. The first weight parameter W1 may be a matrix of size N×16, then the size of the graph update matrix Matri finally obtained is N×16.

[0105] In order to better understand the above-mentioned technical solutions as a whole, an example of starting a mirror service for the Dianhong IoT operating system is used as an example for illustrative explanation.

[0106] For example, see Figure 5 The specific implementation process is as follows:

[0107] S1, decomposes the image service for Dianhong IoT operating system into core services and non-core services. The core services are preloaded into the memory, and the non-core services are asynchronously loaded later through the layered image mechanism.

[0108] S2, within a first preset number of startup times (i.e., the first preset number of times described above) R1, collect first operating parameters of non-core services whose usage duration after the mirror service is started is greater than or equal to a preset first duration threshold, and generate a heat coefficient according to the first operating parameters.

[0109] S3, when it is determined that the heat coefficient is greater than or equal to the preset heat threshold, the corresponding non-core service is preloaded into the memory when the image service is started next time.

[0110] S4, within the second preset startup times (i.e., the second preset times described above) R2, collect the second operating parameters of the non-core services whose usage time after the mirror service is started is greater than or equal to the preset second time threshold, and construct the graph network data accordingly.

[0111] S5, inputs the graph network data into the loading order prediction model, outputs the loading order, and loads the non-core services according to the loading order list when the image service is started next time.

[0112] In the above example, the mirror service for the Dianhong IoT operating system is decomposed into core services and non-core services to reduce the size of the mirror service; the size of the core service is adaptively adjusted by calculating the heat coefficient of the non-core service, and a graph network data is constructed according to the dependency and association relationships of the non-core services. The loading order of the non-core services is adjusted by performing spatiotemporal analysis on the graph network data through a loading order prediction model, so as to minimize the startup time of the mirror service for the Dianhong IoT operating system.

[0113] Figure 6 The structural block diagram of the mirror service startup device for operating systems provided in an embodiment of the present invention is used to execute the mirror service startup method for operating systems provided in any of the above embodiments. The device and the mirror service startup method for operating systems in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the mirror service startup device for operating systems, please refer to the embodiment of the mirror service startup method for operating systems. Figure 6 The device may specifically include: a mirror service decomposition module 510, a core service loading module 520 and a non-core service loading module 530.

[0114] The mirror service decomposition module 510 is used to decompose the mirror service to be started into a core service and a plurality of non-core services in response to the mirror service startup instruction for the operating system;

[0115] The core service loading module 520 is used to start the core service by loading the core service;

[0116] The non-core service loading module 530 is used to load multiple non-core services in sequence according to the loading order of the multiple non-core services when the core service loading is completed, so as to start the multiple non-core services in sequence.

[0117] Optionally, the core service and some of the non-core services among the multiple non-core services are preloaded into the memory; the core service loading module 520 is specifically used to:

[0118] Start the core service by loading it from memory;

[0119] Among them, non-core services preloaded into the memory are loaded from the memory.

[0120] On this basis, non-core services that are optionally preloaded into memory are pre-determined by the following modules:

[0121] A first service determination module, configured to determine, after the mirror service is started a first preset number of times, a first service among the plurality of non-core services whose usage time after startup is greater than or equal to a preset first time threshold;

[0122] The non-core service acquisition module is used to collect the first operating parameters of the first service, generate a heat coefficient according to the first operating parameters, and when the heat coefficient is greater than or equal to a preset heat threshold, preload the first service into the memory as a non-core service.

[0123] On this basis, optionally, the first operating parameter may include the usage time, number of calls, average memory occupancy, maximum memory occupancy, average CPU occupancy, and maximum CPU occupancy of the first service after the rth startup;

[0124] The heat coefficient is generated by the following formula:

[0125]

[0126] Among them, Hot represents the heat coefficient, σ represents the sigmoid activation function, R1 represents the first preset number, Time r Indicates the usage time, Feq r Indicates the number of calls. Indicates the average memory usage. Indicates the maximum memory usage. Indicates the average CPU usage. represents the maximum occupancy rate of the central processing unit, u1 represents the first weight coefficient, u2 represents the second weight coefficient, u3 represents the third weight coefficient, and u4 represents the fourth weight coefficient.

[0127] Optionally, the loading order is predetermined by the following modules:

[0128] A second service determination module, configured to determine, after the mirror service is started a second preset number of times, a plurality of second services among the plurality of non-core services whose usage time after startup is greater than or equal to a preset second time threshold;

[0129] A graph network data construction module, used to collect the second operation parameters corresponding to each second service, and construct graph network data according to all the collected second operation parameters;

[0130] The loading order obtaining module is used to input the graph network data into the pre-trained loading order prediction model, and obtain the loading order according to the output result of the loading order prediction model.

[0131] On this basis, optional graph network data building modules may include:

[0132] a feature obtaining unit, configured to generate, for each second service, a node corresponding to the second service, and process the second operating parameter of the second service to obtain a feature of the node;

[0133] An edge construction unit, for constructing an edge between two nodes for each of all generated nodes, when there is a dependency relationship between the second services respectively corresponding to the two nodes, and / or when a correlation coefficient between the features respectively corresponding to the two nodes is greater than a preset correlation coefficient threshold;

[0134] The graph network data construction unit is used to construct the graph network data according to all generated nodes, all obtained features and all constructed edges.

[0135] On this basis, optionally, the feature may be represented by a feature sequence, the feature sequence includes sequence units whose number is a second preset number, each sequence unit is represented by a feature vector, and the feature vector is generated by processing the second operating parameter;

[0136] The correlation coefficient is expressed by the following formula:

[0137]

[0138] in, represents the correlation coefficient corresponding to the a-th node and the b-th node, 1≤a≤N, 1≤b≤N, a≠b, N represents the number of nodes in the graph network data; R2 represents the second preset number; Sim represents the cosine similarity; represents the i-th sequence unit corresponding to the a-th node; Represents the i-th sequence unit corresponding to the b-th node.

[0139] Alternatively, the graph network data includes N nodes, the loading order prediction model includes N first hidden layers, 1 second hidden layer and N classifiers connected in sequence, the N first hidden layers correspond one-to-one to the N nodes, and the N classifiers correspond one-to-one to the N nodes; wherein,

[0140] The input of the second hidden layer is the graph network data and the output is the graph update matrix, which includes N update vectors. The N update vectors are respectively input into the corresponding classifiers, and the classification space of the classifier represents the loading priority of the second service corresponding to the classifier.

[0141] On this basis, optionally, the second hidden layer calculates the graph update matrix by the following formula:

[0142]

[0143] Where Matrix represents the graph update matrix; sigmoid represents the sigmoid activation function, represents the update vector of the i-th node, 1≤i≤N; pile N Indicates stacking the update vectors corresponding to N nodes; T indicates transposition operation; H i represents the hidden vector of the i-th node; H j represents the hidden vector of the jth node; Col i Represents the set of nodes that have edges connected to the i-th node; Represents the number of nodes in the set; W1 represents the first weight parameter; W2 represents the second weight parameter; W3 represents the third weight parameter; B1 represents the first bias parameter; B2 represents the second bias parameter.

[0144] The mirror service startup device for operating systems provided in the embodiment of the present invention can respond to the mirror service startup instruction for the operating system through the mirror service decomposition module, decompose the mirror service to be started into a core service and multiple non-core services, reduce the volume of the mirror service, and thus achieve the optimization of the mirror structure; on this basis, further, through the core service loading module, by loading the core service to start the core service, the priority startup of the core service is achieved; through the non-core service loading module, when the core service is loaded, according to the loading order of multiple non-core services, multiple non-core services are loaded in sequence to start multiple non-core services in sequence, thereby completing the startup process of the mirror service. The above device loads the core service first, and the non-core service is asynchronously loaded after delaying the loading through the layered mirror mechanism, that is, after waiting for the core service to be loaded, the non-core service is asynchronously loaded in the background, thereby achieving the rapid startup of the mirror service.

[0145] The operating system-oriented mirror service startup device provided in the embodiment of the present invention can execute the operating system-oriented mirror service startup method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0146] It is worth noting that in the above-mentioned embodiment of the mirror service startup device for the operating system, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0147] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0148] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0149] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0150] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the image service startup method for the operating system.

[0151] In some embodiments, the mirror service startup method for the operating system may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the mirror service startup method for the operating system described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the mirror service startup method for the operating system in any other appropriate manner (e.g., by means of firmware).

[0152] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0153] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0154] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0155] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0156] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0157] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0158] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0159] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A mirror service startup method for an operating system, characterized in that: include: In response to the mirror service startup instruction for the operating system, decomposing the mirror service to be started into a core service and a plurality of non-core services; Starting the core service by loading the core service; When the core service is loaded completely, the multiple non-core services are loaded in sequence according to the loading order of the multiple non-core services, so as to start the multiple non-core services in sequence.

2. The method according to claim 1, characterized in that The core service and some of the non-core services among the plurality of non-core services are preloaded into the memory; The step of starting the core service by loading the core service includes: Starting the core service by loading the core service from the memory; The non-core services preloaded into the memory are loaded from the memory.

3. The method according to claim 2, characterized in that The non-core services preloaded into the memory are predetermined by: After the mirror service is started a first preset number of times, determining a first service among the plurality of non-core services whose usage time after startup is greater than or equal to a preset first time threshold; The first operating parameter of the first service is collected, a heat coefficient is generated according to the first operating parameter, and when the heat coefficient is greater than or equal to a preset heat threshold, the first service is used as the non-core service preloaded into the memory.

4. The method according to claim 3, characterized in that The first operating parameter includes the usage time, call times, average memory occupancy, maximum memory occupancy, average CPU occupancy, and maximum CPU occupancy of the first service after the rth startup; The heat coefficient is generated by the following formula: Wherein, Hot represents the heat coefficient, σ represents the sigmoid activation function, R1 represents the first preset number of times, and Time r Indicates the usage time, Feq r Indicates the number of calls, represents the average memory occupancy rate, Indicates the maximum memory usage, represents the average CPU occupancy rate, represents the maximum occupancy rate of the central processing unit, u1 represents the first weight coefficient, u2 represents the second weight coefficient, u3 represents the third weight coefficient, and u4 represents the fourth weight coefficient.

5. The method according to claim 1, characterized in that The loading order is predetermined by the following steps: After the mirror service is started a second preset number of times, determining a plurality of second services among the plurality of non-core services whose usage time after startup is greater than or equal to a preset second time threshold; Collecting second operating parameters corresponding to each of the second services, and constructing graph network data according to all the collected second operating parameters; The graph network data is input into a pre-trained loading order prediction model, and the loading order is obtained according to an output result of the loading order prediction model.

6. The method according to claim 5, characterized in that The step of constructing the graph network data according to all the collected second operating parameters includes: For each of the second services, generating a node corresponding to the second service, and processing a second operating parameter of the second service to obtain a feature of the node; For every two of the generated nodes, when there is a dependency relationship between the second services respectively corresponding to the two nodes, and / or when a correlation coefficient between the features respectively corresponding to the two nodes is greater than a preset correlation coefficient threshold, an edge is constructed between the two nodes; Graph network data is constructed based on all the generated nodes, all the obtained features, and all the constructed edges.

7. The method according to claim 6, characterized in that The feature is represented by a feature sequence, the feature sequence includes sequence units whose number is the second preset number, each of the sequence units is represented by a feature vector, and the feature vector is generated by processing the second operating parameter; The correlation coefficient is expressed by the following formula: in, represents the association coefficient corresponding to the a-th node and the b-th node, 1≤a≤N, 1≤b≤N, a≠b, N represents the number of nodes in the graph network data; R2 represents the second preset number; Sim represents cosine similarity; represents the i-th sequence unit corresponding to the a-th node; Represents the i-th sequence unit corresponding to the b-th node.

8. The method according to claim 6, characterized in that The graph network data includes N nodes, the loading order prediction model includes N first hidden layers, 1 second hidden layer and N classifiers connected in sequence, the N first hidden layers correspond to the N nodes one by one, and the N classifiers correspond to the N nodes one by one; wherein, The input of the second hidden layer is the graph network data and the output is a graph update matrix, wherein the graph update matrix includes N update vectors, and the N update vectors are respectively input into the corresponding classifiers, and the classification space of the classifier represents the loading priority of the second service corresponding to the classifier.

9. The method according to claim 8, characterized in that The second hidden layer calculates the graph update matrix by the following formula: Wherein, Matrix represents the graph update matrix; sigmoid represents the sigmoid activation function, represents the update vector of the i-th node, 1≤i≤N; pile N represents stacking the update vectors corresponding to the N nodes; T represents transposition operation; H i represents the hidden vector of the i-th node; H j represents the hidden vector of the jth node; Col i represents the set of nodes that are connected to the i-th node by edges; represents the number of nodes in the set; W1 represents the first weight parameter; W2 represents the second weight parameter; W3 represents the third weight parameter; B1 represents the first bias parameter; B2 represents the second bias parameter.

10. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the operating system-oriented mirroring service startup method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Starting method and starting device of embedded type device

    CN105760201A

  • Answer ranking method and apparatus used for intelligent question and answer system

    CN106095872A

  • Information acquisition method and device

    CN112114783A

  • Mirror image file obtaining method and device

    CN112711427A

  • Operating system starting method and device, equipment and medium

    CN112764822A