CN115421859A - Dynamic loading method and device of configuration file, computer equipment and storage medium - Google Patents

Dynamic loading method and device of configuration file, computer equipment and storage medium Download PDF

Info

Publication number
CN115421859A
CN115421859A CN202211111148.3A CN202211111148A CN115421859A CN 115421859 A CN115421859 A CN 115421859A CN 202211111148 A CN202211111148 A CN 202211111148A CN 115421859 A CN115421859 A CN 115421859A
Authority
CN
China
Prior art keywords
configuration file
virtual machine
identifier
storage area
target storage
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
CN202211111148.3A
Other languages
Chinese (zh)
Other versions
CN115421859B (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.)
Kedong Guangzhou Software Technology Co Ltd
Original Assignee
Kedong Guangzhou Software 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 Kedong Guangzhou Software Technology Co Ltd filed Critical Kedong Guangzhou Software Technology Co Ltd
Priority to CN202211111148.3A priority Critical patent/CN115421859B/en
Publication of CN115421859A publication Critical patent/CN115421859A/en
Application granted granted Critical
Publication of CN115421859B publication Critical patent/CN115421859B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • 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
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a dynamic loading method and device of a configuration file, computer equipment and a storage medium. The method comprises the following steps: after the industrial control operating system is triggered and started, a first virtual machine configuration file stored currently is loaded from a target storage area in an initializing mode, and a file identifier of the first virtual machine configuration file is stored as a reference identifier; in the running process of the virtual machine, when a configuration file updating check condition is detected, acquiring an identification mark of a second virtual machine configuration file currently stored in a target storage area as a comparison mark; and if the comparison identifier is determined to be inconsistent with the reference identifier, dynamically loading a second virtual machine configuration file from the target storage area. By adopting the technical scheme, the dynamic loading of the configuration files of the virtual machine can be realized, and the working efficiency of the virtual machine is effectively improved.

Description

Dynamic loading method and device of configuration file, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for dynamically loading a configuration file, a computer device, and a storage medium.
Background
In a hardware platform that simultaneously runs an industrial control system and a virtual machine, the virtual machine is often loaded in the industrial control system to run.
In the prior art, if configuration information of a virtual machine running in an industrial control operating system needs to be changed, the running of the virtual machine needs to be stopped first, a configuration file needs to be built on another terminal device (typically, a PC) by using an industrial system development tool, and the configuration file needs to be downloaded to a hardware platform. When the virtual machine is restarted, a new configuration file can be reloaded to realize the updating of the configuration file.
The inventor discovers that in the process of implementing the invention: in an actual scene that the configuration information of the virtual machine needs to be frequently modified, the operation of the virtual machine needs to be frequently interrupted in the prior art, and various tasks running in the virtual machine can be frequently interrupted, so that the working efficiency of the virtual machine can be greatly reduced.
Disclosure of Invention
The invention provides a dynamic loading method and device of a configuration file, computer equipment and a storage medium, which can realize dynamic loading of the configuration file of a virtual machine and effectively improve the working efficiency of the virtual machine.
According to an aspect of the present invention, a method for dynamically loading a configuration file is provided, where the method is executed by a virtual machine loaded in an industrial control operating system, and the method includes:
after the industrial control operating system is triggered and started, a first virtual machine configuration file stored currently is loaded from a target storage area in an initializing mode, and a file identifier of the first virtual machine configuration file is stored as a reference identifier;
in the running process of the virtual machine, when a configuration file updating check condition is detected, acquiring an identification mark of a second virtual machine configuration file currently stored in a target storage area as a comparison mark;
and if the comparison identifier is determined to be inconsistent with the reference identifier, dynamically loading a second virtual machine configuration file from the target storage area.
Optionally, after dynamically loading the second virtual machine configuration file from the target storage area, the method further includes:
and updating and storing the identification mark of the second virtual machine configuration file as a new reference mark.
Optionally, storing a file identifier of the first virtual machine configuration file as a reference identifier includes:
calculating a first password hash function value of the first virtual machine configuration file, and storing the first password hash function value as a reference identifier;
acquiring an identification mark of a second virtual machine configuration file currently stored in a target storage area as a comparison mark, wherein the identification mark comprises the following steps:
and calculating a second password hash function value of the second virtual machine configuration file as a comparison identifier.
Optionally, each time the configuration file update check condition is detected, the method includes:
the detected profile update check condition is determined every time a preset check waiting time period is reached.
Optionally, after being triggered and started by the industrial control operating system, the method further includes:
establishing a configuration file updating task, and starting a timer with preset timing duration to start timing;
in the running process of the virtual machine, whenever a configuration file updating check condition is detected, acquiring an identification identifier of a second virtual machine configuration file currently stored in a target storage area as a comparison identifier, which specifically includes:
in the running process of the virtual machine, controlling the timer to count again and triggering and executing a pre-constructed configuration file check function when the timer is detected to count to the timing duration;
acquiring an identification mark of a second virtual machine configuration file currently stored in a target storage area as a comparison mark by executing a configuration file check function;
if the comparison identifier is determined to be inconsistent with the reference identifier, dynamically loading a second virtual machine configuration file from the target storage area, specifically including:
by executing a configuration file check function, if the comparison identifier is determined to be inconsistent with the reference identifier, activating a configuration file updating task;
the second virtual machine configuration file is dynamically loaded from the target storage area by performing a configuration file update task.
Optionally, after the task of creating a configuration file update, the method further includes:
setting a configuration file updating task to be in a dormant state;
after dynamically loading the second virtual machine configuration file from the target storage area by performing the configuration file update task, the method further comprises:
and resetting the configuration file updating task to be in a dormant state.
Optionally, by executing the configuration file checking function, if it is determined that the comparison identifier is inconsistent with the reference identifier, activating a configuration file update task, including:
by executing the configuration file check function, if the comparison identifier is determined to be inconsistent with the reference identifier, triggering and executing a pre-constructed configuration file activation sub-function;
the profile update task is activated by executing the profile activation sub-function.
According to another aspect of the present invention, there is provided an apparatus for dynamically loading a configuration file, including:
the reference identifier acquisition module is used for initializing and loading a currently stored first virtual machine configuration file from a target storage area after the industrial control operating system is triggered and started, and storing a file identifier of the first virtual machine configuration file as a reference identifier;
the comparison identifier acquisition module is used for acquiring an identification identifier of a second virtual machine configuration file currently stored in the target storage area as a comparison identifier when the configuration file updating check condition is detected in the running process of the virtual machine;
and the second virtual machine configuration file loading module is used for dynamically loading the second virtual machine configuration file from the target storage area if the comparison identifier is determined to be inconsistent with the reference identifier.
According to another aspect of the present invention, there is provided a computer apparatus comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform a method of dynamic loading of configuration files according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the method for dynamically loading a configuration file according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, the reference identifier in the currently stored virtual machine configuration file is compared with the comparison identifier in the latest updated virtual machine configuration file at regular time by the virtual machine running in the industrial control operating system, and the updating condition of the configuration file can be timely checked in the working state of the virtual machine in a mode of dynamically loading the currently stored virtual machine configuration file when the two identifiers are inconsistent, and the virtual machine configuration file can be effectively and dynamically loaded when the virtual machine configuration file needs to be updated, so that the continuous work of the virtual machine in the industrial control operating system can be ensured, the working efficiency of the virtual machine is effectively improved, and the real-time requirement of an industrial control scene is met to the greatest extent.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for dynamically loading a configuration file according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for dynamically loading configuration files according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device for dynamically loading configuration files according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device implementing the method for dynamically loading configuration files according to the embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a method for dynamically loading a configuration file according to an embodiment of the present invention, where the embodiment is applicable to a virtual machine in an industrial control operating system, and detects an update condition of the configuration file in real time during a running process, and dynamically loads a condition of an updated virtual machine configuration file, the method may be executed by a dynamic loading device of the configuration file, the dynamic loading device of the configuration file may be implemented in a form of hardware and/or software, and the dynamic loading device of the configuration file may generally be configured in a virtual machine having a data processing function. As shown in fig. 1, the method includes:
s110, after the industrial control operating system is triggered and started, the currently stored first virtual machine configuration file is loaded from the target storage area in an initialization mode, and the file identification of the first virtual machine configuration file is stored as a reference identification.
Optionally, in a hardware platform running the industrial control operating system and the virtual machine at the same time, the virtual machine may be loaded in the industrial control operating system to run, and the industrial control operating system triggers the start or stop of the virtual machine. If the configuration information of the virtual machine needs to be updated, a new virtual machine configuration file can be constructed by using an industrial system development tool through another terminal device (typically, a PC), and the virtual machine configuration file is downloaded to the hardware platform.
In one specific example, if the industrial control operating system is an Intewell operating system, the industrial system development tool may be an Intewell Developer tool. Further, the hardware platform comprises a target storage area used for storing the configuration file of the virtual machine. If the industrial system development tool in the industrial control operating system generates a new configuration file, the industrial system development tool can download the new configuration file to be stored in the target storage area and cover the original configuration file.
The first virtual machine configuration file may refer to a configuration file for configuring the virtual machine when the virtual machine is triggered to start. The file identifier of the first virtual machine configuration file may be a hash function value of a password in the first virtual machine configuration file, or information used for uniquely identifying one virtual machine configuration file, such as update time of the virtual machine configuration file.
It should be further noted that when the password hash function value in the virtual machine configuration file is selected as the reference identifier, the password hash function value cannot be directly obtained from the virtual machine configuration file, and the password hash function value may be obtained only by calculating the relevant parameters in the virtual machine configuration file.
And S120, in the running process of the virtual machine, when the updating and checking condition of the configuration file is detected, acquiring the identification mark of the second virtual machine configuration file currently stored in the target storage area as a comparison mark.
Preferably, a timer with a preset time duration (e.g., timing for 10 minutes, thirty minutes, etc.) may be set in the virtual machine, and the timer may work cyclically in the operating state of the virtual machine, that is, after the time duration reaches the preset time duration, it is determined that the configuration file update check condition is detected, and then a new round of time duration may be started, so as to achieve the technical effect of periodically satisfying the configuration file update check condition.
Correspondingly, each time the configuration file update checking condition is detected, the method may specifically include:
the detected profile update check condition is determined every time a preset check waiting time period is reached.
The update check condition of the configuration file may be understood as a condition for triggering an update check of the configuration file of the virtual machine. Of course, it is understood that, in addition to the periodic profile update check by using the timer, the profile update check condition may be set according to the current operating state of the virtual machine, for example, the profile update check condition is determined to be satisfied every time the number of tasks running in the virtual machine is less than or equal to the preset task number threshold, or the profile update check condition is determined to be satisfied every time the CPU occupancy rate of the virtual machine is less than or equal to the preset occupancy rate threshold, and the like, which is not limited in this embodiment.
Further, the preset duration in the timer and the preset check waiting duration may be the same duration, and the duration when the timer reaches the preset check waiting duration may be used as a configuration file update check condition of the virtual machine.
The obtaining of the identification identifier of the second virtual machine configuration file currently stored in the target storage area as the comparison identifier may specifically include:
and calculating a second password hash function value of the second virtual machine configuration file as a comparison identifier.
The second virtual machine configuration file may refer to a currently stored configuration file obtained from the target storage area when the configuration file update check condition is detected, and if the configuration file is updated, the second virtual machine configuration file is different from the first virtual machine configuration file and is changed into an updated configuration file, and if the configuration file is not updated, the second virtual machine configuration file is the same as the original first virtual machine configuration file; the second password hash function value may refer to a password hash function value obtained by performing calculation using a relevant parameter in the second virtual machine configuration file.
The comparison identifier may be used to compare with the reference identifier, so as to further determine whether the virtual machine needs to dynamically load the second virtual machine configuration file from the storage area, and a specific comparison manner will be described in detail later.
S130, if the comparison identifier is determined to be inconsistent with the reference identifier, dynamically loading a second virtual machine configuration file from the target storage area.
Dynamic loading may be understood as the virtual machine loading a second virtual machine configuration file from the target storage area while the virtual machine remains in an operational state.
If it is determined that the comparison identifier is inconsistent with the reference identifier, dynamically loading the second virtual machine configuration file from the target storage area may specifically include:
by executing a configuration file check function, if the comparison identifier is determined to be inconsistent with the reference identifier, activating a configuration file updating task;
the second virtual machine configuration file is dynamically loaded from the target storage area by performing a configuration file update task.
Preferably, the virtual machine may further include a pre-constructed configuration file check function, after determining the detected configuration file update check condition, the configuration file check function may be triggered, and the configuration file check function may be configured to determine whether the comparison identifier is consistent with the reference identifier, and if so, may determine that the virtual machine configuration file does not need to be updated, and if not, may determine that the virtual machine configuration file needs to be updated.
Optionally, the configuration file update task is a task created in advance in the virtual machine, when the configuration file of the virtual machine does not need to be updated, the configuration file update task may remain in a dormant state and exist in an operating environment of the virtual machine, and when the configuration file of the virtual machine needs to be updated, the configuration file update task may be triggered through a corresponding check result obtained by the configuration file check function. The triggered configuration file update task may be used to dynamically load a new virtual machine configuration file from the target storage area in the operating state of the virtual machine.
In a specific embodiment, after the configuration file checking function determines that the virtual machine configuration file needs to be updated, the configuration file updating task may be activated, and by executing the configuration file updating task, the second virtual machine configuration file may be dynamically loaded from the target storage area, so as to update the virtual machine configuration file.
It can be understood that, in the prior art, the virtual machine cannot detect the change of the configuration file, and only can use each startup as a node for loading the current configuration file from the target storage area, so the present invention proposes a manner of regularly checking the update condition of the virtual machine configuration file and dynamically loading a new configuration file, thereby avoiding the condition of interrupting the running state of the virtual machine due to the need of updating the virtual machine configuration file.
According to the technical scheme of the embodiment of the invention, the reference identifier in the currently stored virtual machine configuration file is compared with the comparison identifier in the latest updated virtual machine configuration file at regular time by the virtual machine running in the industrial control operating system, and the updating condition of the configuration file can be timely checked in the working state of the virtual machine in a mode of dynamically loading the currently stored virtual machine configuration file when the two identifiers are inconsistent, and the virtual machine configuration file can be effectively and dynamically loaded when the virtual machine configuration file needs to be updated, so that the continuous work of the virtual machine in the industrial control operating system can be ensured, the working efficiency of the virtual machine is effectively improved, and the real-time requirement of an industrial control scene is met to the greatest extent.
Example two
Fig. 2 is a flowchart of a dynamic loading method for a configuration file according to a second embodiment of the present invention, and the present embodiment further embodies the dynamic loading method for the configuration file on the basis of the above embodiment. As shown in fig. 2, the method includes:
s210, after the industrial control operating system is triggered and started, a configuration file updating task is created, and a timer with preset timing duration is started to start timing.
Further, after creating the configuration file update task, the method may further include:
and setting the configuration file updating task to be in a dormant state.
The configuration file updating task is only used for executing the task of updating the virtual machine configuration files, and the configuration file updating task is in a dormant state before being triggered or after the task of updating the virtual machine configuration files is successfully executed.
S220, calculating a first password hash function value of the first virtual machine configuration file, and storing the first password hash function value as a reference identifier.
In a specific embodiment, the cryptographic hash function value may be an MD5 (Message Digest Algorithm, fifth version of the Message Digest Algorithm 5) value, and the MD5 value of the calculated first virtual machine configuration file is stored as the reference identifier.
The advantages of such an arrangement are: because the MD5 value of a file changes after any data in the file is changed, the MD5 value can be used as a unique identification value of the file, and the MD5 value is used as a reference identifier of the virtual machine configuration file to accurately identify the change condition of the virtual machine configuration file.
And S230, in the running process of the virtual machine, controlling the timer to count again and triggering and executing a pre-constructed configuration file checking function when the timer is detected to count to the timing duration.
S240, acquiring the identification mark of the second virtual machine configuration file currently stored in the target storage area as a comparison mark by executing the configuration file check function.
And S250, by executing the configuration file check function, if the comparison identifier is determined to be inconsistent with the reference identifier, triggering and executing a pre-constructed configuration file activation sub-function.
The configuration file activating sub-function may be a sub-function in the configuration file checking function, and when the configuration file checking function detects that the comparison identifier is inconsistent with the reference identifier, the configuration file activating sub-function may be triggered to run, and the configuration file activating sub-function may be used to activate a configuration file updating task.
In a specific embodiment, the identification identifier of the second virtual machine configuration file may also be an MD5 value, and by comparing the MD5 value of the second virtual machine configuration file with the MD5 value of the first virtual machine configuration file, it may be simply and intuitively determined whether the comparison identifier is consistent with the reference identifier, and if the comparison identifier is not consistent with the reference identifier, it may be determined that the configuration file of the virtual machine needs to be updated, so as to trigger execution of a pre-constructed configuration file activation subfunction.
And S260, activating a configuration file updating task by executing a configuration file activating sub-function.
And S270, dynamically loading the second virtual machine configuration file from the target storage area by executing the configuration file updating task.
Further, after dynamically loading the second virtual machine configuration file from the target storage area, the method may further include:
and updating and storing the identification mark of the second virtual machine configuration file as a new reference mark.
The purpose of this is to: in the running process of the virtual machine, the configuration file may need to be updated more than once, so that the identification identifier of the second virtual machine configuration file can be stored as a new reference identifier, and the configuration file can be ensured to be updated normally next time.
Further, after dynamically loading the second virtual machine configuration file from the target storage area by performing the configuration file update task, the method may further include:
and resetting the configuration file updating task to be in a dormant state.
According to the technical scheme of the embodiment of the invention, the mode that the configuration file updating task is set to be in the dormant state when the configuration file is not updated, and the identification mark of the second virtual machine configuration file is used as the new reference mark after the second virtual machine configuration file is dynamically loaded from the target storage area is adopted, so that the virtual machine configuration file can be updated for many times in the running process of the virtual machine, the continuous work of the virtual machine is realized, and the working efficiency of the virtual machine is improved.
Application specific scenarios
The specific application scenario is a dynamic loading method of an optional configuration file, in the specific application scenario, an Intewell operating system is selected as an industrial control operating system, and an industrial system development tool is an Intewell Developer tool. The Intewell system and the virtual machine run in a hardware platform at the same time, and the virtual machine can be loaded in the Intewell operating system and run. If the configuration information of the virtual machine needs to be updated, a new virtual machine configuration file can be constructed by using an Intewell Developer tool through another PC, and the virtual machine configuration file is downloaded to the hardware platform.
Further, a task for updating the configuration file can be created in the virtual machine, and the task for updating the configuration file is set to be in a dormant state; a timer with preset time length can be set in the virtual machine, and the timer can reset the timing state and count time circularly after the timer counts time to the preset time length; the method can also create a function for detecting the configuration files in the virtual machine, the function for detecting the configuration files is triggered at intervals through timer control, and a sub-function for triggering a task of updating the configuration files can be further included in the function for detecting the configuration files.
After the Intewell operating system starts the virtual machine, the MD5 value in the current configuration file of the virtual machine may be calculated as a reference identifier, and a timer is started, and when a preset time duration of the timer is reached, a function for starting a detection configuration file may be triggered, and the function may acquire the MD5 value of the configuration file in the current target storage area as a comparison identifier, and compare the reference identifier with the comparison identifier, if the reference identifier is consistent with the comparison identifier, it may be determined that the configuration file of the virtual machine does not need to be updated, and if the reference identifier is inconsistent with the comparison identifier, it may be determined that the configuration file of the virtual machine needs to be updated.
If the configuration file of the virtual machine needs to be updated, a subfunction used for triggering a task of updating the configuration file in the functions of the detection configuration file can be called, and the task of updating the configuration file is triggered, so that the task of updating the configuration file loads a new configuration file, and the updating of the configuration file of the virtual machine is realized.
Further, after the virtual machine configuration file is updated, the MD5 value of the updated configuration file may be used as a new reference identifier, and the task of updating the configuration file may be reset to the sleep state.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a dynamic loading apparatus for configuration files according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes: a reference identifier obtaining module 310, a comparison identifier obtaining module 320, and a second virtual machine configuration file loading module 330.
The reference identifier obtaining module 310 is configured to, after being triggered and started by the industrial control operating system, initially load a currently stored first virtual machine configuration file from the target storage area, and store a file identifier of the first virtual machine configuration file as a reference identifier.
A comparison identifier obtaining module 320, configured to, in the running process of the virtual machine, obtain, whenever it is detected that the configuration file updates the check condition, an identification identifier of the second virtual machine configuration file currently stored in the target storage area as a comparison identifier.
And a second virtual machine configuration file loading module 330, configured to dynamically load the second virtual machine configuration file from the target storage area if it is determined that the comparison identifier is inconsistent with the reference identifier.
According to the technical scheme of the embodiment of the invention, the reference identifier in the currently stored virtual machine configuration file is compared with the comparison identifier in the latest updated virtual machine configuration file at regular time by the virtual machine running in the industrial control operating system, and the updating condition of the configuration file can be timely checked in the working state of the virtual machine in a mode of dynamically loading the currently stored virtual machine configuration file when the two identifiers are inconsistent, and the virtual machine configuration file can be effectively and dynamically loaded when the virtual machine configuration file needs to be updated, so that the continuous work of the virtual machine in the industrial control operating system can be ensured, the working efficiency of the virtual machine is effectively improved, and the real-time requirement of an industrial control scene is met to the greatest extent.
On the basis of the foregoing embodiments, the method may further include, after dynamically loading the second virtual machine configuration file from the target storage area:
and updating and storing the identification mark of the second virtual machine configuration file as a new reference mark.
On the basis of the foregoing embodiments, the reference identifier obtaining module 310 may be specifically configured to:
and calculating a first password hash function value of the first virtual machine configuration file, and storing the first password hash function value as a reference identifier.
On the basis of the foregoing embodiments, the system may further include an update task creating unit, configured to create a configuration file update task after being triggered and started by the industrial control operating system, and start a timer with a preset timing duration to start timing.
On the basis of the foregoing embodiments, the comparison identifier obtaining module 320 may be specifically configured to:
and calculating a second password hash function value of the second virtual machine configuration file as a comparison identifier.
On the basis of the foregoing embodiments, the comparison identifier obtaining module 320 may be further specifically configured to:
the detected profile update check condition is determined every time a preset check waiting time period is reached.
On the basis of the foregoing embodiments, the comparison identifier obtaining module 320 may be further specifically configured to:
in the running process of the virtual machine, controlling the timer to count again and triggering and executing a pre-constructed configuration file checking function when the timer is detected to count to the timing duration;
and acquiring the identification mark of the second virtual machine configuration file currently stored in the target storage area as a comparison mark by executing the configuration file check function.
On the basis of the foregoing embodiments, the second virtual machine configuration file loading module 330 may include:
the updating task activating unit is used for activating the configuration file updating task by executing the configuration file checking function if the comparison identifier is determined to be inconsistent with the reference identifier;
and the updating task execution unit is used for dynamically loading the second virtual machine configuration file from the target storage area by executing the configuration file updating task.
On the basis of the foregoing embodiments, a hibernation-state setting unit may be further included, configured to set the profile updating task to a hibernation state after the profile updating task is created.
On the basis of the foregoing embodiments, a hibernation-state resetting unit may be further included, configured to reset the configuration-file updating task to the hibernation state after the second virtual-machine configuration file is dynamically loaded from the target storage area by executing the configuration-file updating task.
On the basis of the foregoing embodiments, the update task activation unit may be specifically configured to:
by executing the configuration file check function, if the comparison identifier is determined to be inconsistent with the reference identifier, triggering and executing a pre-constructed configuration file activation sub-function;
the profile update task is activated by executing the profile activation sub-function.
The dynamic loading device for the configuration file provided by the embodiment of the invention can execute the dynamic loading method for the configuration file provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 4 shows a schematic block diagram of a computer device 40 that may be used to implement an embodiment of the invention. Computer devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The computer device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the computer device 40 includes at least one processor 41, and a memory communicatively connected to the at least one processor 41, such as a Read Only Memory (ROM) 42, a Random Access Memory (RAM) 43, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 41 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 42 or the computer program loaded from the storage unit 48 into the Random Access Memory (RAM) 43. In the RAM 43, various programs and data necessary for the operation of the computer device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other via a bus 44. An input/output (I/O) interface 45 is also connected to the bus 44.
A number of components in computer device 40 are connected to I/O interface 45, including: an input unit 46 such as a keyboard, a mouse, or the like; an output unit 47 such as various types of displays, speakers, and the like; a storage unit 48 such as a magnetic disk, an optical disk, or the like; and a communication unit 49 such as a network card, modem, wireless communication transceiver, etc. The communication unit 49 allows the computer device 40 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 41 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the method of dynamic loading of configuration files as described in embodiments of the present invention. Namely:
after the industrial control operating system is triggered and started, a first virtual machine configuration file stored currently is loaded from a target storage area in an initializing mode, and a file identifier of the first virtual machine configuration file is stored as a reference identifier;
in the running process of the virtual machine, when a configuration file updating check condition is detected, acquiring an identification mark of a second virtual machine configuration file currently stored in a target storage area as a comparison mark;
and if the comparison identifier is determined to be inconsistent with the reference identifier, dynamically loading a second virtual machine configuration file from the target storage area.
In some embodiments, the method of dynamic loading of configuration files may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and/or installed onto computer device 40 via ROM 42 and/or communications unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the above described method of dynamic loading of configuration files may be performed. Alternatively, in other embodiments, processor 41 may be configured by any other suitable means (e.g., by way of firmware) to perform a dynamic loading method of configuration files.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A dynamic loading method of a configuration file is characterized in that the method is executed by a virtual machine loaded in an industrial control operating system, and the method comprises the following steps:
after the industrial control operating system is triggered and started, a first virtual machine configuration file stored currently is loaded from a target storage area in an initializing mode, and a file identifier of the first virtual machine configuration file is stored as a reference identifier;
in the running process of the virtual machine, when a configuration file updating check condition is detected, acquiring an identification mark of a second virtual machine configuration file currently stored in a target storage area as a comparison mark;
and if the comparison identifier is determined to be inconsistent with the reference identifier, dynamically loading a second virtual machine configuration file from the target storage area.
2. The method of claim 1, further comprising, after dynamically loading the second virtual machine configuration file from the target storage area:
and updating and storing the identification mark of the second virtual machine configuration file as a new reference mark.
3. The method of claim 1, wherein storing a file identifier of the first virtual machine configuration file as a reference identifier comprises:
calculating a first password hash function value of the first virtual machine configuration file, and storing the first password hash function value as a reference identifier;
acquiring an identification mark of a second virtual machine configuration file currently stored in a target storage area as a comparison mark, wherein the identification mark comprises the following steps:
and calculating a second password hash function value of the second virtual machine configuration file as a comparison identifier.
4. The method of claim 1, wherein each time a profile update check condition is detected, comprising:
the detected profile update check condition is determined every time a preset check waiting time period is reached.
5. The method according to any one of claims 1-4, further comprising, after being triggered to start by the industrial control operating system:
establishing a configuration file updating task, and starting a timer with preset timing duration to start timing;
in the running process of the virtual machine, whenever a configuration file updating check condition is detected, acquiring an identification identifier of a second virtual machine configuration file currently stored in a target storage area as a comparison identifier, which specifically includes:
in the running process of the virtual machine, controlling the timer to count again and triggering and executing a pre-constructed configuration file checking function when the timer is detected to count to the timing duration;
acquiring an identification mark of a second virtual machine configuration file currently stored in a target storage area as a comparison mark by executing a configuration file check function;
if the comparison identifier is determined to be inconsistent with the reference identifier, dynamically loading a second virtual machine configuration file from the target storage area, specifically including:
by executing a configuration file check function, if the comparison identifier is determined to be inconsistent with the reference identifier, activating a configuration file updating task;
the second virtual machine configuration file is dynamically loaded from the target storage area by performing a configuration file update task.
6. The method of claim 5, after creating the profile update task, further comprising:
setting a configuration file updating task to be in a dormant state;
after dynamically loading the second virtual machine configuration file from the target storage area by performing the configuration file update task, the method further comprises:
and resetting the configuration file updating task to be in a dormant state.
7. The method of claim 5, wherein the activating a profile update task if the comparison identifier is determined to be inconsistent with the reference identifier by executing a profile check function comprises:
by executing a configuration file check function, if the comparison identifier is determined to be inconsistent with the reference identifier, triggering to execute a pre-constructed configuration file activation sub-function;
the profile update task is activated by executing the profile activation sub-function.
8. An apparatus for dynamic loading of configuration files, comprising:
the reference identifier acquisition module is used for initializing and loading a currently stored first virtual machine configuration file from a target storage area after the industrial control operating system is triggered and started, and storing a file identifier of the first virtual machine configuration file as a reference identifier;
the comparison identifier acquisition module is used for acquiring an identification identifier of a second virtual machine configuration file currently stored in the target storage area as a comparison identifier when the configuration file updating check condition is detected in the running process of the virtual machine;
and the second virtual machine configuration file loading module is used for dynamically loading the second virtual machine configuration file from the target storage area if the comparison identifier is determined to be inconsistent with the reference identifier.
9. A computer device, characterized in that the computer device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method of dynamic loading of a configuration file of any of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform a method for dynamic loading of a configuration file according to any one of claims 1-7 when executed.
CN202211111148.3A 2022-09-13 2022-09-13 Dynamic loading method and device for configuration file, computer equipment and storage medium Active CN115421859B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211111148.3A CN115421859B (en) 2022-09-13 2022-09-13 Dynamic loading method and device for configuration file, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211111148.3A CN115421859B (en) 2022-09-13 2022-09-13 Dynamic loading method and device for configuration file, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115421859A true CN115421859A (en) 2022-12-02
CN115421859B CN115421859B (en) 2024-02-13

Family

ID=84201763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211111148.3A Active CN115421859B (en) 2022-09-13 2022-09-13 Dynamic loading method and device for configuration file, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115421859B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117193886A (en) * 2023-11-06 2023-12-08 成都科江科技有限公司 Dynamic loading method for configuration file of industrial control system

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006092469A (en) * 2004-09-27 2006-04-06 Nec Corp Mode, method and system for program update, and update program
KR20070096316A (en) * 2006-03-23 2007-10-02 한국과학기술원 Extensible virtual machine for reprogramming in wireless sensor networks and reprogramming method using it
CN101174217A (en) * 2007-11-22 2008-05-07 上海交通大学 Method for implementing dynamic update of Java program
JP2010134710A (en) * 2008-12-04 2010-06-17 Ntt Data Corp Method for migrating virtual machine, server, and program
US20110246988A1 (en) * 2010-03-31 2011-10-06 International Business Machines Corporation Hypervisor for starting a virtual machine
US20150178113A1 (en) * 2013-12-24 2015-06-25 Red Hat, Inc. Loading runtime configuration files into virtual machine instances
US9280338B1 (en) * 2013-03-11 2016-03-08 Amazon Technologies, Inc. Dynamic application updates
CN106878363A (en) * 2016-06-01 2017-06-20 阿里巴巴集团控股有限公司 A kind of information processing method, apparatus and system
CN109101381A (en) * 2018-08-02 2018-12-28 Oppo(重庆)智能科技有限公司 Configuration file update method, system, electronic equipment and storage medium
CN109857429A (en) * 2019-01-04 2019-06-07 浪潮商用机器有限公司 A kind of update method, device, equipment and the storage medium of resources of virtual machine configuration
CN110083373A (en) * 2019-03-21 2019-08-02 中国平安财产保险股份有限公司 Method, apparatus, computer equipment and the storage medium of more new data
CN110399145A (en) * 2018-04-24 2019-11-01 宏碁股份有限公司 Computer system, its update method and computer program product
JP2019204413A (en) * 2018-05-25 2019-11-28 株式会社デンソーテン Update device, vehicle control device, and update method
US10534759B1 (en) * 2018-08-23 2020-01-14 Cohesity, Inc. Incremental virtual machine metadata extraction
CN110851167A (en) * 2019-11-15 2020-02-28 腾讯科技(深圳)有限公司 Container environment updating method, device, equipment and storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006092469A (en) * 2004-09-27 2006-04-06 Nec Corp Mode, method and system for program update, and update program
KR20070096316A (en) * 2006-03-23 2007-10-02 한국과학기술원 Extensible virtual machine for reprogramming in wireless sensor networks and reprogramming method using it
CN101174217A (en) * 2007-11-22 2008-05-07 上海交通大学 Method for implementing dynamic update of Java program
JP2010134710A (en) * 2008-12-04 2010-06-17 Ntt Data Corp Method for migrating virtual machine, server, and program
US20110246988A1 (en) * 2010-03-31 2011-10-06 International Business Machines Corporation Hypervisor for starting a virtual machine
US9280338B1 (en) * 2013-03-11 2016-03-08 Amazon Technologies, Inc. Dynamic application updates
US20150178113A1 (en) * 2013-12-24 2015-06-25 Red Hat, Inc. Loading runtime configuration files into virtual machine instances
CN106878363A (en) * 2016-06-01 2017-06-20 阿里巴巴集团控股有限公司 A kind of information processing method, apparatus and system
CN110399145A (en) * 2018-04-24 2019-11-01 宏碁股份有限公司 Computer system, its update method and computer program product
JP2019204413A (en) * 2018-05-25 2019-11-28 株式会社デンソーテン Update device, vehicle control device, and update method
CN109101381A (en) * 2018-08-02 2018-12-28 Oppo(重庆)智能科技有限公司 Configuration file update method, system, electronic equipment and storage medium
US10534759B1 (en) * 2018-08-23 2020-01-14 Cohesity, Inc. Incremental virtual machine metadata extraction
CN109857429A (en) * 2019-01-04 2019-06-07 浪潮商用机器有限公司 A kind of update method, device, equipment and the storage medium of resources of virtual machine configuration
CN110083373A (en) * 2019-03-21 2019-08-02 中国平安财产保险股份有限公司 Method, apparatus, computer equipment and the storage medium of more new data
CN110851167A (en) * 2019-11-15 2020-02-28 腾讯科技(深圳)有限公司 Container environment updating method, device, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
YANG YU 等: "A feather-weight virtual machine for windows applications", 《VEE \'06: PROCEEDINGS OF THE 2ND INTERNATIONAL CONFERENCE ON VIRTUAL EXECUTION ENVIRONMENTS》, pages 24 - 34 *
王瑞雪: "分布式业务集成部署平台的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 3, pages 138 - 2891 *
白钢: "系统远程集中控制更新方法研究", 《信息通信》, no. 4, pages 108 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117193886A (en) * 2023-11-06 2023-12-08 成都科江科技有限公司 Dynamic loading method for configuration file of industrial control system
CN117193886B (en) * 2023-11-06 2024-01-05 成都科江科技有限公司 Dynamic loading method for configuration file of industrial control system

Also Published As

Publication number Publication date
CN115421859B (en) 2024-02-13

Similar Documents

Publication Publication Date Title
CN106155806B (en) Multitask scheduling method and server
CN112653758B (en) Method, device, equipment and medium for updating edge node
CN115421859B (en) Dynamic loading method and device for configuration file, computer equipment and storage medium
CN115904656A (en) State control method, device and equipment applied to chip and storage medium
CN116521573A (en) Automatic test method, device, equipment and storage medium
CN114090270B (en) Thread management method and device, electronic equipment and computer readable storage medium
CN116450176A (en) Version updating method and device, electronic equipment and storage medium
CN113747423B (en) Cloud mobile phone state synchronization method, device, equipment, storage medium and program product
US9372786B1 (en) Constructing state-transition functions for mobile devices
CN114721876A (en) Data backup method, device and medium
CN112667255B (en) Updating method, updating device, electronic equipment and storage medium
CN115146309A (en) Privacy compliance detection method, device, server, terminal and storage medium
CN112131179B (en) Task state detection method, device, computer equipment and storage medium
CN114422638B (en) Cloud mobile phone control method, device, equipment, medium and program product
CN117608925A (en) Application restarting method and device, electronic equipment and storage medium
CN114003367B (en) Risk monitoring method, device, equipment and storage medium
CN114222001B (en) Edge device, edge device method, edge device system, electronic device and storage medium
CN116719552A (en) Game heat updating method and device, electronic equipment and storage medium
CN117785403A (en) Heartbeat task execution device for equipment, electronic equipment and storage medium
CN115470476A (en) Authentication renewal method and device, electronic equipment and storage medium
CN114422638A (en) Cloud mobile phone control method, device, equipment, medium and program product
CN115017043A (en) Method, device and equipment for controlling state of program interface and storage medium
CN117234601A (en) System starting method and device, electronic equipment and storage medium
CN118093211A (en) Distributed lock processing method, device, equipment and medium
CN115766697A (en) File downloading method, device, equipment and storage medium

Legal Events

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