CN105930190A - Program self-starting method and device based on operating system - Google Patents

Program self-starting method and device based on operating system Download PDF

Info

Publication number
CN105930190A
CN105930190A CN201610270254.4A CN201610270254A CN105930190A CN 105930190 A CN105930190 A CN 105930190A CN 201610270254 A CN201610270254 A CN 201610270254A CN 105930190 A CN105930190 A CN 105930190A
Authority
CN
China
Prior art keywords
operating system
system management
message event
dynamic link
link library
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610270254.4A
Other languages
Chinese (zh)
Other versions
CN105930190B (en
Inventor
方亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201610270254.4A priority Critical patent/CN105930190B/en
Publication of CN105930190A publication Critical patent/CN105930190A/en
Application granted granted Critical
Publication of CN105930190B publication Critical patent/CN105930190B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a program self-starting method and device based on an operating system. The method comprises the following steps: on the basis of the core component of an operating system management tool, monitoring whether a set message event is triggered or not; if the set message event is triggered, judging whether an associated dynamic link library file is in the presence in the set message event or not on the basis of the core component; if the associated dynamic link library file is in the presence, on the basis of the operating system management tool, calling the common interface of the dynamic link library file; and through the common interface, operating an operating system management tool provider contained in the dynamic link library file, and determining whether a set program is subjected to self-starting or not on the basis of a logical statement contained in the operating system management tool provider. The method guarantees that the set program only can be subjected to self-starting when the set program only conforms to a starting condition, effectively shortens the starting time of electronic equipment, and also reduces the occupation of system resources. In addition, the supervision on the set program self-starting by security-class software is avoided.

Description

A kind of program self-start method based on operating system and device
Technical field
The present embodiments relate to Computer Applied Technology field, particularly relate to a kind of journey based on operating system Sequence self-start method and device.
Background technology
Along with progress and the development of science and technology in epoch, operating system application is well known, and operating system is usual It is installed in the electronic equipments such as computer, notebook or mobile terminal, for functions such as the online of people, chats Program provides a basic operation platform.
In prior art, for the electronic equipment being mounted with operating system, in this electronic equipment When program carries out self-starting operation, generally using two ways, a kind of is directly to the registration table of operating system In startup item, write needs the program execution command of self-starting, starts to perform above-mentioned after os starting Perform order, thus start the program of correspondence.Another kind is for needing the program started to system registry one The service processes being associated, and this service processes is set to self-starting, self-starting the most after system start-up Above-mentioned service entry, after then this service processes finds to meet the condition starting associated program, starts program.On Stating the two ways of program self-starting, its start-up characteristic may be summarized to be: after operating system completes to start, The service processes that self-triggered program or self-starting associate with program, to keep program itself or assistance program to start Service be constantly in running status.
The mode of said procedure self-starting, has the disadvantage that 1) self-triggered program the most after system start-up Or service processes, regardless of whether use this program after have impact on the available machine time of equipment, and program self-starting, Program all can cause too much taking of system resource always present in process;2) above-mentioned Starting mode is easy By security classes Software Monitoring, such software is easy to capture the service of the program of self-starting and registration, such Software can revise the self-starting configuration file of program or service processes, and after system is again turned on, in prevention State the Data Restore Handles Technique of self-starting configuration file, so that program or service processes cannot be based on configuration literary compositions Part self-starting.
Summary of the invention
The invention provides a kind of program self-start method based on operating system and device.To optimize operation system Existing program self-starting operation under system, thus reduce resource utilization ratio, when shortening electronic equipment start Between.
The embodiment of the present invention is by the following technical solutions:
First aspect, embodiments provides a kind of program self-start method based on operating system, should Method includes:
Whether core component monitoring and setting message event based on operating system management instrument is triggered;
If described setup message event is triggered, then judge described setup message thing based on described core component Whether part exists the dynamic link library file of association in described operating system management instrument;
If there is the dynamic link library file of association, then call described based on described operating system management instrument The common interface of dynamic link library file;
Run, by described common interface, the operating system management instrument comprised in described dynamic link library file to carry Donor, and determine whether self-starting based on the logical statement comprised in described operating system management instrument supplier The program set.
Second aspect, the embodiment of the present invention additionally provides a kind of program self-starting device based on operating system, This device includes:
Message trigger monitoring modular, for core component monitoring and setting message based on operating system management instrument Whether event is triggered;
Associated with determination module, for when described setup message event is triggered, based on described core group Part judges whether described setup message event exists the dynamic link of association in described operating system management instrument Library file;
, for when there is the dynamic link library file of association, then based on described behaviour in common interface calling module The common interface of described dynamic link library file is called as system management facility;
Program self-starting determines module, for being run in described dynamic link library file by described common interface The operating system management instrument supplier comprised, and comprise based in described operating system management instrument supplier Logical statement determine whether the program that self-starting sets.
A kind of based on operating system the program self-start method of embodiment of the present invention offer and device, the method Realization can be described as: be primarily based on operating system management instrument core component monitoring set by message thing Whether part is triggered, if being triggered, being based on core component and judging whether this message event exists association Dynamic link library file;Subsequently, if there is association dynamic link library file, it is based on this operating system pipe Science and engineering tool calls the common interface of this association dynamic link library file and runs this dynamic chain by this common interface Connect and library file comprises operating system management instrument supplier, be based ultimately upon described operating system management instrument and carry The logical statement comprised in donor determines whether the program that self-starting sets.Utilize the method, it is ensured that program The only just self-starting when meeting entry condition, is effectively shortened the available machine time of electronic equipment, also reduces simultaneously System resource taken;It is registered in operating system management instrument additionally, security classes software cannot be supervised Message event, therefore will not be pacified based on the operating system management instrument supplier associated by this message event Universal class software is forbidden running, and then avoids the supervision to set program self-starting of the security classes software.
Accompanying drawing explanation
The flow process of a kind of based on operating system the program self-start method that Fig. 1 provides for the embodiment of the present invention one Figure;
The flow process of a kind of based on operating system the program self-start method that Fig. 2 a provides for the embodiment of the present invention two Figure;
The flow chart of the registration setup message event that Fig. 2 b provides for the embodiment of the present invention two;
The flow process of a kind of based on operating system the program self-start method that Fig. 3 provides for the embodiment of the present invention three Figure;
A kind of based on operating system the program self-start method that Fig. 4 a provides for the embodiment of the present invention four preferred Embodiment;
The Windows management instrument of the Windows operating system that Fig. 4 b provides for the embodiment of the present invention four Organization Chart;
The structure of a kind of based on operating system the program self-starting device that Fig. 5 provides for the embodiment of the present invention five Block diagram;
The structure of a kind of based on operating system the program self-starting device that Fig. 6 provides for the embodiment of the present invention six Block diagram.
Detailed description of the invention
Further illustrate technical scheme below in conjunction with the accompanying drawings and by detailed description of the invention.Permissible Being understood by, specific embodiment described herein is used only for explaining the present invention, rather than the limit to the present invention Fixed.It also should be noted that, for the ease of describing, accompanying drawing illustrate only portion related to the present invention Divide rather than full content.It should be mentioned that, some show before being discussed in greater detail exemplary embodiment Example embodiment is described as process or the method described as flow chart.Although flow chart by operations (or Step) it is described as process sequentially, but many of which operation can be by concurrently, concomitantly or together Time implement.Additionally, the order of operations can be rearranged.The most described process can To be terminated, it is also possible to have the additional step being not included in accompanying drawing.Described process can correspond to Method, function, code, subroutine, subprogram etc..
Embodiment one
The flow process of a kind of based on operating system the program self-start method that Fig. 1 provides for the embodiment of the present invention one Figure, the method is applicable to management instrument based on operating system and carries out the program installed in the electronic device certainly Starting situation about determining, can be performed by program self-starting device based on operating system, wherein this device can Realized by software and/or hardware, and be typically integrated in electronic equipment.
As it is shown in figure 1, a kind of based on operating system the program self-start method that the embodiment of the present invention one provides, Specifically include and operate as follows:
Whether S110, core component monitoring and setting message event based on operating system management instrument are triggered.
Usually, operating system can be regarded as the fundamental system software running directly on " bare machine ", is to prop up Holding the basic platform of other running softwares, so-called " bare machine " can be regarded as only hardware does not has software support Electronic equipment.Common operating system has Windows system, IOS system, android system and Linux System etc..Described operating system management instrument can be regarded as the service for managing Local or Remote electronic equipment Plug-in unit, exemplary, as acted on the landscape1.5 of linux system, can monitor and manage Linux Server;Instrument (Windows Management is managed as acted on the Windows of Windows system Instrumentation, WMI) can monitor and manage the hardware in the electronic equipment installing Windows system Or software.It should be noted that the technical scheme of the present embodiment preferably considers installing Windows system Application on electronic equipment.
In the present embodiment, the structure of described operating system management instrument can be summarized as 3 parts: 1) operation system The user of science and engineering under the overall leadership tool, 2) infrastructure component of operating system management instrument, and 3) operating system pipe The supplier of science and engineering tool.Concrete, the user of described operating system management instrument can be regarded as management work The use carrier of every technology in tool, can pass through provided technology for application developer and carry out Data query and increasing, delete or the operation such as change;The infrastructure component of described operating system management instrument includes core Assembly and storage assembly, described core component can be used for controlling user and the offer of operating system management instrument Person, and can carry out, as the user of system management facility and supplier, the transmitter that information is mutual, for the two Data communication provide service, additionally, core component self can be additionally used in supervisory messages event, determine message The trigger timing of event;The storage assembly of described operating system management instrument can be used for storing operating system management Required data message;The supplier of described operating system management instrument can be regarded as the supplier of data message, Commonly rely on dynamic link library file and realize the execution of logical data information.
In the present embodiment, the set message event of core component based on operating system management instrument monitoring is No it is triggered.Concrete, described setup message event can be regarded as being provided with the electronic equipment of operating system Hardware or software it may happen that event, exemplary, if the battery of electronic equipment is it may happen that residue Electricity is the event of 20%, and for example the USB (universal serial bus) (Universal Serial Bus, USB) of electronic equipment Socket is it may happen that the access events of USB device, or the online client installed in electronic equipment can The click commands receiving user can be occurred to enter the event of the Internet.Above-mentioned event all can be as setup message Event.In the present embodiment, described setup message event is present in operating system management instrument, described in set Whether the triggering determining message event can monitor based on the core component of operating system management instrument in real time.
If S120 described setup message event is triggered, then judge described setting based on described core component Whether message event exists the dynamic link library file of association in described operating system management instrument.
In the present embodiment, if the message event monitoring setting is triggered (exemplary, as monitored The electric device battery dump energy set reaches trigger value, and described trigger value can be set as total electricity 20%), then can judge that this setup message event in this operation is by core component based on operating system management instrument Whether science and engineering under the overall leadership tool exists the dynamic link library file of association.
In the present embodiment, set message event only plays the triggering to associated dynamic link library file Effect, i.e. can be regarded as after set message event is triggered, dynamic with what described message event associated Chained library file has just obtained a chance being run;Accordingly, if set message event does not has Being triggered, the dynamic link library file associated with described message event would not be run.Concrete, at this In embodiment, what described dynamic link library file can be regarded as comprising operating system management instrument supplier can The logical bearer file that common interface runs is called based on operating system management instrument.
In the present embodiment, described dynamic link library file is regarded as comprising operating system management instrument provides The logical bearer of person, its concrete logic performs statement and is included in the operating system management instrument supplier of correspondence In, described logic performs statement typically can be based on associated setup message event actual set.
S130, if there is association dynamic link library file, then based on described operating system management instrument adjust Common interface with described dynamic link library file.
In the present embodiment, the operating system management instrument core component dynamic link library to whether there is association File carries out after judgement determines, if there is the dynamic link library file of association, can not directly performing to be closed The dynamic link library file of connection, but need to call described dynamic link library text based on operating system management instrument The common interface that part is corresponding, realizes operating system management instrument core component by corresponding common interface And the information between the operating system management instrument supplier that dynamic link library file is comprised is mutual, thus reaches To the purpose performing operating system management instrument supplier.
It should be noted that in operating system management instrument, operating system management instrument infrastructure component is (main Core component in infrastructure component to be referred to) service that externally provided will be by calling common interface Realize.Usually, operating system management instrument needs the service correspondence one for providing public for call Interface, the common interface id that different services generally corresponds to is different.
S140, run in described dynamic link library file the operating system management comprised by described common interface Instrument supplier, and determine whether based on the logical statement comprised in described operating system management instrument supplier The program that self-starting sets.
In the present embodiment, when described setup message event exists the dynamic link library file of association, and pass through After operating system management instrument calls the common interface of described dynamic link library file, called public affairs can be passed through Interface runs the operating system management instrument supplier included in described dynamic link library file altogether.Can manage Solving, the content that in described dynamic link library file, operating system management instrument supplier comprises can be right Message event triggers some logical judgment that result is carried out, mainly by performing described operating system management instrument The logical statement of supplier realizes, the content of its logical statement is general be triggered with described message event after touch Send out result and there is certain contact.Set logical statement is generally the decision statement to described triggering result, And the execution statement corresponding to each result of determination.Such as, it is determined that statement may be set to: judge electronic equipment Battery dump energy the most not higher than 20%, the execution statement corresponding when not higher than 20% can be with self-starting Set program.
In the present embodiment, the program of setting can be that user sets in advance when last time uses operating system Self-triggered program, as user is installing or in use program process, program carried out self-starting setting, setting Program can also be the program of operating system acquiescence self-starting.Exemplary, the program of setting can be such as The program of safe house keeper, security guard and mobile phone assistant etc.
The technical scheme of the present embodiment one, is primarily based on the core component monitoring and setting of operating system management instrument Whether message event is triggered, and is still based on whether its core component judges setup message event in a triggered There is association dynamic link library file;Afterwards, when determining existence association dynamic link library file, based on behaviour The common interface that this association dynamic link library file is corresponding is called as system management facility;Then connect by public The logical statement of the supplier of operating system management instrument included in mouth operation state chained library file;Finally The program that self-starting sets is determined whether by performed logical statement.Utilize the method, with existing journey Sequence self-start method is compared, and will not directly initiate association service process or the base of program after os starting Directly initiate program in registry boot item, be thus greatly saved the available machine time of electronic equipment, subtract simultaneously The size of little shared running memory also reduces the consumption of operating-system resources;Additionally, due to program Self-starting is not based on registry boot item or related service process, would not occur by security classes software design patterns be The situation of No starting, it is ensured that the program self-starting of setting is effectively carried out.
Embodiment two
The flow process of a kind of based on operating system the program self-start method that Fig. 2 a provides for the embodiment of the present invention two Figure.The embodiment of the present invention is optimized based on above-described embodiment, in the present embodiment, " based on behaviour Whether the core component monitoring and setting message event making system management facility is triggered " before, further preferably include : registering described setup message event information to described operating system management instrument, wherein, described setting disappears Breath event information includes described setup message event and the dynamic link library text with described setup message event correlation Part name.
As shown in Figure 2 a, a kind of based on operating system the program self-start method that the embodiment of the present invention two provides, Specifically include and operate as follows:
S210, register described setup message event information to described operating system management instrument.
In the present embodiment, described setup message event information includes described setup message event and sets with described Determine the dynamic link library file name of message event association.
In the present embodiment, the setup message event that the core component of operating system management instrument is monitored is general Needing to be registered to operating system management instrument in advance, thus core component described in guarantee is to setup message thing The real-time monitoring of part.Therefore, setup message event can be realized to operating system management work by performing S210 The registration of tool.
Concrete, the information being registered to operating system management instrument generally comprises the message event self of setting, And there is, with this setup message event, the dynamic link library file name associated, above-mentioned information is referred to as setting and disappears Breath event information, thus core component described in guarantee judges whether setup message event exists the dynamic of association State chained library file.Registration process for setup message event information to described operating system management instrument can The analytical tool that description file based on the specific format built carries based on operating system realizes.
Further, the flow chart of the registration setup message event that Fig. 2 b provides for the embodiment of the present invention two, as Shown in Fig. 2 b, registration setup message event specifically may include that
S2101, construct the description file of described setup message event.
In the present embodiment, described description file specifically can be regarded as comprising described setup message event information For the executable file carrying out registering to operating system management instrument.In described description file, can be based on Specific programming language realizes described setup message event object, example and required array or screening washer Build, be consequently formed the description file of specific format.Exemplary, in Windows system, constructed The form describing file be generally .mof form, describe file exists relevant to setup message event Method function etc..
S2102, specific analytical tool based on operating system resolve described description file, and obtain described description File comprises setup message event information.
In the present embodiment, the description file that S2101 structure is generated, can be by call operation system The specific analytical tool carried is to resolve foregoing description file.Exemplary, in Windows system, should Specific analytical tool is mainly provided by Microsoft, is integrated in Windows system.In the present embodiment, After by calling the specific analytical tool described description file of parsing, specific analytical tool can describe literary composition from described Part obtains the setup message event information of needs.
S2103, according to described specific analytical tool, described setup message event information is registered to described operation system In science and engineering under the overall leadership tool.
In the present embodiment, the setup message event information that is resolved to is given behaviour by described specific analytical tool alternately Make system management facility, be achieved in described setup message event information to described operating system management instrument Registration, concrete, typically described setup message event information is registered to the storage of operating system management instrument In assembly.Exemplary, under Windows system, in the infrastructure component of its management instrument WMI, deposit Store two modules of assembly at WMI core component and WMI, call the specific parsing work that Microsoft provides After tool realizes the parsing to description file, the setup message event information of acquisition is given alternately the base set of WMI Part, and store in WMI storage assembly, it is achieved in the registration to WMI of the setup message event.
Whether S220, core component monitoring and setting message event based on operating system management instrument are triggered.
If S230 described setup message event is triggered, then judge described setting based on described core component Whether message event exists the dynamic link library file of association in described operating system management instrument.
S240, if there is association dynamic link library file, then based on described operating system management instrument adjust Common interface with described dynamic link library file.
S250, run in described dynamic link library file the operating system management comprised by described common interface Instrument supplier, and determine whether based on the logical statement comprised in described operating system management instrument supplier The program that self-starting sets.
In the present embodiment, the process that realizes of S220~S250 specifically describes in above-described embodiment one, here No longer describe in detail.
The technical scheme of the present embodiment two, optimizes on the basis of embodiment one and adds setup message event Registration operation.Setup message event is directly registered with in operating system management instrument by this registration operation, and Whether triggered, then in message thing by the core component of operating system management instrument direct supervisory messages event The dynamic link library file associated for this message event after part triggering provides and once runs chance, is hereby based on moving The logical statement that in state chained library file, supplier comprises determines program whether self-starting.Utilize the method, directly Connect setup message event registration in operating system management instrument, it is achieved that the core of operating system management instrument The monitoring to message event of the heart assembly, owing to the management instrument of operating system can not be supervised by security classes software Pipe so that security classes software cannot supervise setup message event, thereby ensure that transported based on this message event The operating system management instrument supplier of row by security classes software No starting, and then will not ensure that setting Program can carry out self-starting normally, improves Consumer's Experience.
Embodiment three
The flow process of a kind of based on operating system the program self-start method that Fig. 3 provides for the embodiment of the present invention three Figure.The embodiment of the present invention three is optimized based on above-described embodiment two, in the present embodiment, at " note The described setup message event information of volume is to described operating system management instrument " after, also include: create described The dynamic link library file of setup message event correlation, and in described dynamic link library file, build a behaviour Make system management facility supplier, wherein, described operating system management instrument supplier comprises executable Logical statement;Register the fileinfo of described dynamic link library file to operating system registration table, wherein, institute State fileinfo to include: the filename of described dynamic link library file, storage position and described dynamic link The operating system management instrument common interface id of library file association.
Further, also by step " based on the logic language comprised in described operating system management instrument supplier Sentence determines whether the program that self-starting sets " specifically it is optimized for: provide based on described operating system management instrument Person judges whether the triggering result of described setup message event meets the entry condition of the program set;If institute State triggering result and meet described entry condition, the then program set described in self-starting.
As it is shown on figure 3, a kind of based on operating system the program self-start method that the embodiment of the present invention three provides, Specifically include and operate as follows:
S310, register described setup message event information to described operating system management instrument.
In the present embodiment, the process that realizes of S310 specifically describes in above-described embodiment two, the most no longer Describe in detail.Further, when registering described setup message event information to described operating system management instrument, Also by the dynamic link library file name information registering of associated to operating system management instrument.Therefore, it can The dynamic link library file of association is created so that be triggered in setup message event for described setup message event Time, there is a chance processing message event association service.
S320, create the dynamic link library file of described setup message event correlation, and in described dynamic link Library file builds an operating system management instrument supplier.
In the present embodiment, it is to be understood that the service that operating system management instrument externally provides is the most logical Cross common interface to realize.And (performed service is commonly considered as to call common interface execution respective service The logical statement that operating system management instrument supplier comprises) time it is generally required to use dynamic link library file Do logical bearer, accordingly, it would be desirable to be that executable respective service builds the dynamic link library as logical bearer File, and described dynamic link library file need with setup message event correlation.
In the present embodiment, dynamic link library file can be created under particular category, and with this dynamic link library File is that logical bearer builds a supplier as operating system management utility services in this document, its In, this supplier exists and calls executable logical statement during common interface.
S330, register the fileinfo of described dynamic link library file to operating system registration table.
In the present embodiment, the dynamic link library comprising an operating system management instrument supplier is being created After file, need to be registered in the registration table of operating system the fileinfo of this dynamic link library file, by This could realize operating system management instrument to public corresponding to this dynamic link library file based on described fileinfo Calling of common interface, usually, can be based on the COM in operating system management instrument by institute The fileinfo stating dynamic link library file is registered to operating system registration table.
In the present embodiment, described fileinfo specifically can include described dynamic link library file filename, Storage position and the operating system management instrument common interface id of described dynamic link library file association, above-mentioned Information serves the effect of information index in operating system management instrument, exemplary, operating system management The core component of instrument can be determined whether it is the dynamic link library text associated by setup message event based on filename Part, the common interface id being also based on associating realizes operating system management instrument and calls corresponding common interface, May be based on storing position and determine that dynamic link library file is achieved in comprised operating system management instrument and carries The execution of donor.
It should be noted that the fileinfo of dynamic link library file is registered with in the registration table of operating system , when registering, administration authority can be set as it, so that the fileinfo being registered in registration table can not be by Security classes software modification, thereby guarantees that operating system management instrument can be based on the fileinfo success registered Find required information.
Whether S340, core component monitoring and setting message event based on operating system management instrument are triggered.
If S350 described setup message event is triggered, then judge described setting based on described core component Whether message event exists the dynamic link library file of association in described operating system management instrument.
S360, if there is association dynamic link library file, then based on described operating system management instrument adjust Common interface with described dynamic link library file.
In the present embodiment, the process that realizes of S340~S360 specifically describes in above-described embodiment one, here No longer describe in detail.
S370, run in described dynamic link library file the operating system management comprised by described common interface Instrument supplier.
Concrete, described operation operating system management instrument supplier can be regarded as running operating system management work The logical statement comprised in tool supplier, wherein, described logical statement generally comprises decision statement and judgement The execution statement that result is corresponding.
S380, judge based on described operating system management instrument supplier described setup message event triggering knot Whether fruit meets the entry condition of the program set.
The triggering result of described message event is judged based on the decision statement in operating system management instrument supplier Whether meet the entry condition starting the program set.This decision statement typically can have two result of determination, The most eligible and ineligible, when result of determination is eligible, corresponding execution statement is permissible It it is the program of self-starting setting;When result of determination is ineligible, corresponding execution statement can be Do not start the program of setting.
If S390 described triggering result meets described entry condition, the then program set described in self-starting.
The technical scheme of the present embodiment three, optimizes setup message on the basis of above-described embodiment two further The establishment operation of the association dynamic link library file of event;And embody further based on operating system management The logical statement of instrument supplier determines the operating process of program self-starting.Utilize the method so that setting The self-starting of program only relies upon the triggering of setup message event and patrolling of operating system management instrument supplier Volume statement, it is to avoid the program start self-starting situation that sets, is greatly saved the available machine time of electronic equipment; Reduce the size of shared running memory simultaneously and reduce the consumption of operating-system resources;Additionally, due to Carry out the triggering of monitoring and setting message event based on operating system management instrument, and security classes software cannot be supervised and be set Determine message event, thereby ensure that the operating system management instrument supplier run based on this message event is not By security classes software No starting, and then can ensure that the program self-starting of setting is effectively carried out.
Embodiment four
A kind of based on operating system the program self-start method that Fig. 4 a provides for the embodiment of the present invention four preferred Embodiment.The embodiment of the present invention four is with the arbitrary reality in above-described embodiment one, embodiment two and embodiment three Being optimized based on executing example, in the present embodiment, operating system is specifically optimized for Windows operation is System, meanwhile, described operating system management instrument is optimized for WMI, Fig. 4 b provides for the embodiment of the present invention four Windows operating system under the Organization Chart of WMI.
As shown in Figure 4 b, in the Organization Chart of the WMI under Windows operating system, WMI can be divided It is 3 layers, is WMI user (WMI Consumers) 41, WMI infrastructure component (WMI respectively Infrastructure) 42 and WMI suppliers (WMI Providers) 43.It should be noted that WMI Infrastructure component 42 includes that WMI core component (WMI core) 421 and WMI stores assembly (WMI Repository) 422, wherein, WMI core component 421 can be used for controlling WMI user 41 and WMI Supplier 42, and can carry out, as WMI user 41 and WMI supplier 42, the transmitter that information is mutual, Data communication for the two provides service, deposits additionally, described WMI core component 421 also can obtain WMI Data message in storage assembly 422, and acquired information is passed to WMI user 41 or WMI Supplier 42.Owing to WMI technology is the prior art in Windows system, the most no longer describe in detail.
In the present embodiment, by the triggering of WMI core component 421 monitoring and setting message event, and can sentence Break and whether exist and the dynamic link library file of setup message event correlation;Afterwards, by WMI supplier 43 In logical statement determine the self-starting of program of setting.
Carried out additionally, the application scenarios set by the present embodiment four is this program set of opponent's machine aided hands Self-starting.Further, the present embodiment four self-starting by mobile phone assistant and the USB (universal serial bus) of setting USB device access events is associated, concrete, determines whether to open by monitoring USB device access events Start machine aided hands.
As shown in fig. 4 a, a kind of based on operating system the program self-start method that the embodiment of the present invention four provides Preferred embodiment, specifically include following operation:
S410, USB device access events is registered in WMI.
Exemplary, structure comprises the description file that form is .mof of USB device access information, and based on The specific analytical tool that Microsoft provides resolves describing file, can parse required USB and set Standby access events and the dynamic link library file name with this event correlation;And can be based on this analytical tool by upper State USB device access events information registering to store in assembly to the WMI of WMI, to complete USB device Access events is to the registration of WMI.
S420, create described USB device access events association dynamic link library file, and described dynamically Chained library file builds a WMI supplier.
Exemplary, after USB device access events triggers, can be associated dynamic link library file One chance calling execution is provided, therefore, can be that USB device access events creates association based on S420 Dynamic link library file, be only a logical bearer due to dynamic link library file, in addition it is also necessary at this document One WMI supplier of middle structure, could realize the determination operation of program self-starting.Concrete, can be based on spy Attribute speech builds in dynamic link library file and comprises the WMI supplier that can perform logical statement.
S430, register the fileinfo of described dynamic link library file to windows registry.
In the present embodiment, because WMI supplier is in the third layer of WMI framework, and WMI framework In each layer between realize communication time need by call common interface realize, so building active in WMI After state chained library file, WMI core component determines that USB device access events exists the dynamic link of association After library file, can not directly perform the WMI supplier in dynamic link library file, need by calling this In common interface ability operation state chained library file corresponding to dynamic link library file, WMI supplier's patrols Collect statement.
In the present embodiment, can realize moving based on the com technology (microsoft components object model) in WMI The fileinfo of state chained library file is to the registration of Windows system registry, wherein, described fileinfo Mainly include the filename of dynamic link library file, storage position and the common interface id etc. of correspondence.Need It is noted that when carrying out registering operation can be that this log-on message arranges administration authority, to avoid security classes The supervision software amendment to this log-on message.
Whether S440, WMI core component based on WMI monitoring USB device access events is triggered.
Exemplary, after step based on above-mentioned S410~S430 completes pre-operation, can WMI based on WMI Core component is monitored USB device and is added whether incoming event is triggered.
If S450 monitors described USB device access events and is triggered, then based on described WMI core Assembly judges whether described USB device access events exists the dynamic link library text of association in described WMI Part.
Exemplary, WMI core component can be based on being registered in WMI in USB device access events information The dynamic link library text whether the dynamic link library file name comprised associates to determine USB device access events Part.
S460, if there is association dynamic link library file, then call described dynamic chain based on described WMI Connect the common interface of library file.
Exemplary, the determination of described common interface is based primarily upon and is registered in Windows system registry move The common interface id that state chained library file is corresponding realizes.It is achieved in WMI to described dynamic link library file Calling of corresponding common interface.
S470, run in described dynamic link library file the WMI supplier comprised by described common interface.
S480, judge the triggering result of described USB device access events based on described WMI supplier whether Meet the entry condition of mobile phone assistant.
Exemplary, the triggering result of described USB device access events can be access device be USB flash disk, can Being that access device is for portable hard drive part, it is also possible to be access device be the intelligent terminal such as mobile phone, panel computer. Based on S480 it may determine that whether above-mentioned triggering result meets the decision statement set in WMI supplier, I.e. judge whether above-mentioned triggering result meets the entry condition of mobile phone assistant.
In the present embodiment, set when triggering result as access device as the intelligent terminal such as mobile phone, panel computer Time meet the entry condition of mobile phone assistant.
If S490 described triggering result meets described entry condition, then self-starting mobile phone assistant.
Exemplary, when trigger result be access device be the intelligent terminal such as mobile phone, panel computer time, certainly open Start machine aided hands this set program.
The technical scheme of the present embodiment four, the program self-start method based on operating system provided for the present invention Preferred embodiment, it is that self-starting mobile phone helps that the present embodiment four embodies application scenarios based on the inventive method The operating process of hands.Utilize the method so that the self-starting of mobile phone assistant only relies upon the USB device of setting The triggering of access events and the logical statement of WMI supplier, it is to avoid mobile phone assistant starts shooting just self-starting Situation, is greatly saved the available machine time of electronic equipment;Reduce the size of shared running memory also simultaneously Reduce the consumption of operating-system resources;Additionally, due to carry out the triggering of monitoring and setting message event based on WMI, And security classes software cannot supervise setup message event, thereby ensure that run based on this message event WMI supplier by security classes software No starting, and then will not ensure that the program self-starting of setting is effectively entered OK.
Embodiment five
The structure of a kind of based on operating system the program self-starting device that Fig. 5 provides for the embodiment of the present invention five Block diagram.The device of the present embodiment can be realized by software and/or hardware, is applicable to management based on operating system Instrument carries out the situation that self-starting determines to the program in the electronic device of installation, and is typically integrated in electronics and sets In Bei, as it is shown in figure 5, this device includes: message trigger monitoring modular 51, associated with determination module 52, Common interface calling module 53 and program self-starting determine module 54.
Wherein, message trigger monitoring modular 51, monitor for core component based on operating system management instrument Whether setup message event is triggered.
Associated with determination module 52, for when described setup message event is triggered, based on described core Assembly judges whether described setup message event exists the dynamic chain of association in described operating system management instrument Connect library file.
, for when there is the dynamic link library file of association, then based on described in common interface calling module 53 Operating system management instrument calls the common interface of described dynamic link library file.
Program self-starting determines module 54, for running described dynamic link library file by described common interface In the operating system management instrument supplier that comprises, and wrap based in described operating system management instrument supplier The logical statement contained determines whether the program that self-starting sets.
In the present embodiment, this device first passes through message trigger monitoring modular 51 based on operating system management work Whether the core component monitoring and setting message event of tool is triggered;Then worked as by associated with determination module 52 When described setup message event is triggered, judge that described setup message event is described based on described core component Whether operating system management instrument exists the dynamic link library file of association;Called by common interface afterwards Module 53 when there is the dynamic link library file of association, then calls institute based on described operating system management instrument State the common interface of dynamic link library file;Determine that module 54 is based on described public finally by program self-starting Interface runs the operating system management instrument supplier comprised in described dynamic link library file, and based on described The logical statement comprised in operating system management instrument supplier determines whether the program that self-starting sets.
The technical scheme of the present embodiment five, utilizes this device, compared with existing program self-starting device, no The association service process of program can be directly initiated after os starting or directly open based on registry boot item Dynamic program, is thus greatly saved the available machine time of electronic equipment, reduces shared running memory simultaneously Size also reduces the consumption of operating-system resources;Open additionally, due to the self-starting of program is not based on registration table Dynamic item or related service process, would not occur that by security classes software design patterns be the situation of No starting, it is ensured that The program self-starting set effectively is carried out.
Further, described program self-starting determines module 54, specifically for:
Whether the triggering result of described setup message event is judged based on described operating system management instrument supplier Meet the entry condition of the program set;If described triggering result meets described entry condition, then self-starting The program of described setting.
Embodiment six
The structure of a kind of based on operating system the program self-starting device that Fig. 6 provides for the embodiment of the present invention six Block diagram.The present embodiment six is optimized based on above-described embodiment five, and in the present embodiment, this device removes Including message trigger monitoring modular 51, associated with determination module 52, common interface calling module 53 and Program self-starting determines outside module 54, also includes: message event Registering modules 60 and associated with create mould Block 61.
Wherein, message event Registering modules 60, for supervising at core component based on operating system management instrument Before whether survey setup message event is triggered, register described setup message event information to described operating system Management instrument, wherein, described setup message event information include described setup message event and with described setting The dynamic link library file name of message event association.
Described associated with creation module 61, specifically for:
After the described setup message event information of registration to described operating system management instrument, set described in establishment Determine the dynamic link library file of message event association, and in described dynamic link library file, build an operation System management facility supplier, wherein, comprises executable patrolling in described operating system management instrument supplier Collect statement;Register the fileinfo of described dynamic link library file to operating system registration table, wherein, described Fileinfo includes: the filename of described dynamic link library file, storage position and described dynamic link library The operating system management instrument common interface id of file association.
Further, described message event Registering modules 60, specifically for:
Construct the description file of described setup message event;Specific analytical tool based on operating system resolves institute State description file, and obtain in described description file and comprise setup message event information;According to described particular solution Described setup message event information is registered in described operating system management instrument by analysis instrument.
The technical scheme of the present embodiment six, utilizes this device, directly by setup message event registration in operation system In science and engineering under the overall leadership tool, it is achieved that the monitoring to message event of the core component of operating system management instrument, due to The management instrument of operating system can not be supervised by security classes software so that security classes software cannot be supervised and be set Determine message event, thereby ensure that the operating system management instrument supplier run based on this message event is not By security classes software No starting, and then can ensure that the program of setting can carry out self-starting normally, carry Rise Consumer's Experience.
Further, on the basis of above-described embodiment five, operating system optimization can be also by the present embodiment six Windows system, is that Window manages instrument WMI by operating system management instrument.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.Those skilled in the art It will be appreciated that the invention is not restricted to specific embodiment described here, can enter for a person skilled in the art Row various obvious changes, readjust and substitute without departing from protection scope of the present invention.Therefore, though So by above example, the present invention is described in further detail, but the present invention be not limited only to Upper embodiment, without departing from the inventive concept, it is also possible to include other Equivalent embodiments more, And the scope of the present invention is determined by scope of the appended claims.

Claims (12)

1. a program self-start method based on operating system, it is characterised in that including:
Whether core component monitoring and setting message event based on operating system management instrument is triggered;
If described setup message event is triggered, then judge described setup message thing based on described core component Whether part exists the dynamic link library file of association in described operating system management instrument;
If there is the dynamic link library file of association, then call described based on described operating system management instrument The common interface of dynamic link library file;
Run, by described common interface, the operating system management instrument comprised in described dynamic link library file to carry Donor, and determine whether self-starting based on the logical statement comprised in described operating system management instrument supplier The program set.
Method the most according to claim 1, it is characterised in that based on operating system management instrument Before whether core component monitoring and setting message event is triggered, also include:
Registering described setup message event information to described operating system management instrument, wherein, described setting disappears Breath event information includes described setup message event and the dynamic link library text with described setup message event correlation Part name.
Method the most according to claim 2, it is characterised in that described registration described setup message event Information, to described operating system management instrument, specifically includes:
Construct the description file of described setup message event;
Specific analytical tool based on operating system resolves described description file, and obtains in described description file Comprise setup message event information;
According to described specific analytical tool, described setup message event information is registered to described operating system management In instrument.
Method the most according to claim 2, it is characterised in that registering described setup message event letter After breath arrives described operating system management instrument, also include:
Create the dynamic link library file of described setup message event correlation, and at described dynamic link library file One operating system management instrument supplier of middle structure, wherein, in described operating system management instrument supplier Comprise executable logical statement;
Register the fileinfo of described dynamic link library file to operating system registration table, wherein, described file Information includes: the filename of described dynamic link library file, storage position and described dynamic link library file The operating system management instrument common interface id of association.
Method the most according to claim 1, it is characterised in that described based on described operating system management The logical statement comprised in instrument supplier determines whether the program that self-starting sets, and specifically includes:
Whether the triggering result of described setup message event is judged based on described operating system management instrument supplier Meet the entry condition of the program set;
If described triggering result meets described entry condition, the then program set described in self-starting.
6. according to the method described in any one of claim 1-5, it is characterised in that
Operating system is Windows system, and described operating system management instrument is that Window manages instrument WMI。
7. a program self-starting device based on operating system, it is characterised in that including:
Message trigger monitoring modular, for core component monitoring and setting message based on operating system management instrument Whether event is triggered;
Associated with determination module, for when described setup message event is triggered, based on described core group Part judges whether described setup message event exists the dynamic link of association in described operating system management instrument Library file;
, for when there is the dynamic link library file of association, then based on described behaviour in common interface calling module The common interface of described dynamic link library file is called as system management facility;
Program self-starting determines module, for being run in described dynamic link library file by described common interface The operating system management instrument supplier comprised, and comprise based in described operating system management instrument supplier Logical statement determine whether the program that self-starting sets.
Device the most according to claim 7, it is characterised in that also include:
Message event Registering modules, for disappearing in core component monitoring and setting based on operating system management instrument Before whether breath event is triggered, register described setup message event information to described operating system management instrument, Wherein, described setup message event information includes described setup message event and closes with described setup message event The dynamic link library file name of connection.
Device the most according to claim 8, it is characterised in that described message event Registering modules, tool Body is used for:
Construct the description file of described setup message event;
Specific analytical tool based on operating system resolves described description file, and obtains in described description file Comprise setup message event information;
According to described specific analytical tool, described setup message event information is registered to described operating system management In instrument.
Device the most according to claim 8, it is characterised in that also include: associated with creates mould Block,
Accordingly, described associated with creation module, specifically for:
After the described setup message event information of registration to described operating system management instrument, set described in establishment Determine the dynamic link library file of message event association, and in described dynamic link library file, build an operation System management facility supplier, wherein, comprises executable patrolling in described operating system management instrument supplier Collect statement;
Register the fileinfo of described dynamic link library file to operating system registration table, wherein, described file Information includes: the filename of described dynamic link library file, storage position and described dynamic link library file The operating system management instrument common interface id of association.
11. devices according to claim 7, it is characterised in that described program self-starting determines module, Specifically for:
Whether the triggering result of described setup message event is judged based on described operating system management instrument supplier Meet the entry condition of the program set;
If described triggering result meets described entry condition, the then program set described in self-starting.
12. according to the device described in any one of claim 7-11, it is characterised in that
Operating system is Windows system, and described operating system management instrument is that Window manages instrument WMI。
CN201610270254.4A 2016-04-27 2016-04-27 A kind of program self-start method and device based on operating system Active CN105930190B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610270254.4A CN105930190B (en) 2016-04-27 2016-04-27 A kind of program self-start method and device based on operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610270254.4A CN105930190B (en) 2016-04-27 2016-04-27 A kind of program self-start method and device based on operating system

Publications (2)

Publication Number Publication Date
CN105930190A true CN105930190A (en) 2016-09-07
CN105930190B CN105930190B (en) 2019-04-16

Family

ID=56837350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610270254.4A Active CN105930190B (en) 2016-04-27 2016-04-27 A kind of program self-start method and device based on operating system

Country Status (1)

Country Link
CN (1) CN105930190B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273653A (en) * 2017-04-27 2017-10-20 广州慧扬健康科技有限公司 Electronic health record Form Designer based on Wrapper control adapters
CN111459258A (en) * 2020-03-30 2020-07-28 北京奇艺世纪科技有限公司 Power consumption management method and device, electronic equipment and medium
CN112860338A (en) * 2021-01-29 2021-05-28 中国农业银行股份有限公司 Software starting method and device
CN113742002A (en) * 2021-09-10 2021-12-03 上海达梦数据库有限公司 Method, device, equipment and storage medium for acquiring dependency relationship of dynamic library

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030191730A1 (en) * 2002-04-05 2003-10-09 Compaq Information Technologies Group, L.P. Unobtrusive rule-based computer usage enhancement system
CN101211393A (en) * 2006-12-27 2008-07-02 国际商业机器公司 Information processing apparatus and method for controlling resource access by application program
CN102968317A (en) * 2012-11-05 2013-03-13 北京奇虎科技有限公司 System startup program processing method and equipment
CN103369105A (en) * 2012-03-27 2013-10-23 沈新莉 Mobile phone assistant software automatic starting method and mobile phone assistant software automatic starting method system
CN104102500A (en) * 2013-04-03 2014-10-15 腾讯科技(深圳)有限公司 Method for starting process of application and computer system
CN104573494A (en) * 2014-12-30 2015-04-29 北京工业大学 Safety mobile office method based on WMI software whitelist mechanism

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030191730A1 (en) * 2002-04-05 2003-10-09 Compaq Information Technologies Group, L.P. Unobtrusive rule-based computer usage enhancement system
CN101211393A (en) * 2006-12-27 2008-07-02 国际商业机器公司 Information processing apparatus and method for controlling resource access by application program
CN103369105A (en) * 2012-03-27 2013-10-23 沈新莉 Mobile phone assistant software automatic starting method and mobile phone assistant software automatic starting method system
CN102968317A (en) * 2012-11-05 2013-03-13 北京奇虎科技有限公司 System startup program processing method and equipment
CN104102500A (en) * 2013-04-03 2014-10-15 腾讯科技(深圳)有限公司 Method for starting process of application and computer system
CN104573494A (en) * 2014-12-30 2015-04-29 北京工业大学 Safety mobile office method based on WMI software whitelist mechanism

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273653A (en) * 2017-04-27 2017-10-20 广州慧扬健康科技有限公司 Electronic health record Form Designer based on Wrapper control adapters
CN111459258A (en) * 2020-03-30 2020-07-28 北京奇艺世纪科技有限公司 Power consumption management method and device, electronic equipment and medium
CN112860338A (en) * 2021-01-29 2021-05-28 中国农业银行股份有限公司 Software starting method and device
CN112860338B (en) * 2021-01-29 2024-06-11 中国农业银行股份有限公司 Software starting method and device
CN113742002A (en) * 2021-09-10 2021-12-03 上海达梦数据库有限公司 Method, device, equipment and storage medium for acquiring dependency relationship of dynamic library

Also Published As

Publication number Publication date
CN105930190B (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN106156186B (en) Data model management device, server and data processing method
CN105930190A (en) Program self-starting method and device based on operating system
CN103164229A (en) Method and device for clearing progresses of mobile terminal
Ghezzi et al. Programming language support to context-aware adaptation: a case-study with Erlang
CN103618762A (en) System and method for enterprise service bus state pretreatment based on AOP
Thramboulidis IEC 61499 as an Enabler of Distributed and Intelligent Automation: A State‐of‐the‐Art Review—A Different View
CN110413432A (en) A kind of information processing method, electronic equipment and storage medium
US20160179482A1 (en) Improved state space analysis using partial descriptions
Taconet et al. Ca3m: A runtime model and a middleware for dynamic context management
Ciccozzi et al. An automated round-trip support towards deployment assessment in component-based embedded systems
Liu et al. QoS modeling for cyber-physical systems using aspect-oriented approach
CN112100620A (en) Code security detection method, device, equipment and readable storage medium
CN110287657A (en) Equipment supervises method, apparatus, equipment and storage medium
CN113449444B (en) Simulation method, computer device and storage medium for domain engineering
Ramos et al. Extending statecharts to model system interactions
CN112231231B (en) Cloud service debugging method, system and device
CN112596841B (en) Interface language switching method, device, equipment and storage medium
CN115022312A (en) Method and device for realizing multiple intelligent contract engines, electronic equipment and storage medium
Dai et al. Modeling and performance analysis for security aspects
Inui et al. IoT technologies: state of the art and a software development framework
CN113051122A (en) Performance data acquisition method, performance data acquisition device, electronic equipment and medium
Heinze et al. Fault-tolerant complex event processing using customizable state machine-based operators
Oliha Assessing the Performability of a Fault Tolerant Architecture for Web Services Solution Using Software Fault Injection
CN114217926A (en) Multi-process service instance deployment method, device, equipment and readable storage medium
CN115881116A (en) Interface control method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant