CN113868059B - Service system start detection method and device, electronic equipment and storage medium - Google Patents

Service system start detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113868059B
CN113868059B CN202111148509.7A CN202111148509A CN113868059B CN 113868059 B CN113868059 B CN 113868059B CN 202111148509 A CN202111148509 A CN 202111148509A CN 113868059 B CN113868059 B CN 113868059B
Authority
CN
China
Prior art keywords
target
file
hash value
service system
service
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.)
Active
Application number
CN202111148509.7A
Other languages
Chinese (zh)
Other versions
CN113868059A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111148509.7A priority Critical patent/CN113868059B/en
Publication of CN113868059A publication Critical patent/CN113868059A/en
Application granted granted Critical
Publication of CN113868059B publication Critical patent/CN113868059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2289Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by configuration test
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a service system start detection method, a device, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: if the service system is detected to be started, determining a plurality of target catalogs; generating hash values of a plurality of target files in each target directory respectively, and generating hash value files corresponding to each target directory by utilizing the hash values; matching and matching the hash value file with a preset check file; if the target directory is matched with the service cluster, the target directory is mounted in a read-only mode, and the service cluster is added; the method performs fault detection in advance when the service system of the node is started, ensures that the service cluster is added after no fault exists, and simultaneously mounts the target directory in a read-only mode, ensures that the fault does not occur when the service system operates, and avoids influencing the whole service.

Description

Service system start detection method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a service system start detection method, a service system start detection device, an electronic device, and a computer readable storage medium.
Background
Business systems, such as storage business systems, typically include two parts, an operating system and business software, which runs on an operating system (e.g., a linux operating system). The service system is deployed on the nodes of the cluster, and if the service system of a certain node is abnormal, the whole service is interfered. The related technology can determine that faults exist only after abnormal operation of a service system and interference to operation of the whole service occur, and has great influence on the whole service.
Disclosure of Invention
In view of this, an object of the present application is to provide a service system start-up detection method, a service system start-up detection device, an electronic device, and a computer readable storage medium, which ensure that a service system will not fail during operation, and avoid affecting an overall service.
In order to solve the above technical problems, the present application provides a service system start detection method, including:
if the service system is detected to be started, determining a plurality of target catalogs;
generating hash values of a plurality of target files in each target directory respectively, and generating hash value files corresponding to each target directory by utilizing the hash values;
matching and matching the hash value file with a preset check file;
and if so, mounting the target directory into a read-only mode, and adding the target directory into a service cluster.
Optionally, the method further comprises:
acquiring an installation data packet, and installing a linux system and service software by using the installation data packet;
if the linux system and the service software are installed, scanning the target directory to generate a verification hash value corresponding to the target file;
sorting the verification hash values corresponding to the same target catalog according to a preset sorting rule to obtain a hash value sequence;
and determining the hash value sequence as the preset check file.
Optionally, the installation data packet includes target static file information and a target service configuration item, where the target static file information records a mounting mode corresponding to the target directory, and the mounting mode is a read-only mode;
the target service configuration item is used for designating a target script, the target script is used for initiating a plurality of parallel target processes in the starting process of the service system, and the target processes are used for scanning the target catalogue and generating a hash value file corresponding to the target catalogue; the target processes are in one-to-one correspondence with the target directories.
Optionally, the generating, by using the hash value, a hash value file corresponding to each target directory includes:
and sequencing the hash values according to the preset sequencing rule to obtain the hash value file.
Optionally, matching the hash value file with a preset check file includes:
comparing the hash value file with data corresponding to the position in the preset check file;
if the data of all the positions are the same, determining matching;
and if the data of any position are not the same, determining that the data are not matched.
Optionally, matching the hash value file with a preset check file includes:
comparing the hash value file with the data with the same identification information in the preset check file;
if all the data with the same identification information are the same, determining matching;
if any group of the data with the same identification information is not the same, determining that the data are not matched.
Optionally, if the hash value file does not match the preset check file, the method includes:
reporting the alarm, generating an alarm log, and refusing to join the cluster.
The application also provides a service system start detection device, which comprises:
the determining module is used for determining a plurality of target catalogs if the service system is detected to be started;
the hash generation module is used for respectively generating hash values of a plurality of target files in each target directory and generating hash value files corresponding to each target directory by utilizing the hash values;
the comparison module is used for matching and matching the hash value file with a preset check file;
and the cluster joining module is used for mounting the target directory into a read-only mode if the target directory is matched with the target directory, and joining the target directory into a service cluster.
The application also provides an electronic device comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the service system start detection method described above.
The application also provides a computer readable storage medium for storing a computer program, wherein the computer program realizes the service system start detection method when being executed by a processor.
According to the service system starting detection method, if the service system starting is detected, a plurality of target catalogues are determined; generating hash values of a plurality of target files in each target directory respectively, and generating hash value files corresponding to each target directory by utilizing the hash values; matching and matching the hash value file with a preset check file; and if the target directory is matched, mounting the target directory into a read-only mode, and adding the target directory into a service cluster.
Therefore, when the service system on the node is started, the method detects each target directory, and the target directory contains target files on which the service normally operates. By generating hash values for each target file in each target directory and composing it into a hash value file, the hash value file can be used to characterize the state of each target directory at present. Matching and matching the hash value file with a preset check file, wherein the preset check file represents the legal state of each target directory, and if the hash value file and the preset check file are matched, the target file in the target directory is not damaged or tampered, so that the normal operation of a service system can be supported. Therefore, the target directory is mounted so as to start the service system, and the target file can be prevented from being modified or damaged when the service system runs by being mounted in a read-only mode, and meanwhile, the target file is added into the service cluster so as to provide service. The method can perform fault detection in advance when the service system of the node is started, the service cluster can be added after no fault is ensured, meanwhile, the target directory is mounted in a read-only mode, the fault can not occur when the service system is operated, and the influence on the whole service is avoided.
In addition, the application also provides a service system start detection device, electronic equipment and a computer readable storage medium, and the service system start detection device and the electronic equipment have the same beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present application, and other drawings may be obtained according to the provided drawings without inventive effort to those of ordinary skill in the art.
Fig. 1 is a flowchart of a service system start detection method provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a service system start detection device provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1, fig. 1 is a flowchart of a service system start detection method provided in an embodiment of the present application. The method comprises the following steps:
s101: if the service system is detected to be started, a plurality of target catalogs are determined.
The service system is a system composed of service software and an operating system, and the specific types of the service system are different according to different services operated by the service software. By way of example, a storage service system may be provided. The service system operates on all nodes, all nodes form a service cluster together, and the service cluster is used for supporting the operation of the whole service. It will be appreciated that if a problem occurs with the service system on a single node, the overall service operation may be affected.
The target directory refers to a directory in which files on which the service system normally operates are located, and the number of the target directories is not limited. The files on which the service system is normally operated can be different according to different service system types, and the directories in which the files are located can be different. Therefore, after the service system is detected to be started, the type of the service system can be detected, and the corresponding target directory is determined according to the type of the service system. For example, a correspondence between the service system type and the target directory may be preset, and the target directory may be determined by searching the correspondence.
S102: and respectively generating hash values of a plurality of target files in each target directory, and generating hash value files corresponding to each target directory by utilizing the hash values.
Target files refer to files on which a business system depends when operating normally, and the target files should include basic files operated by an operating system, such as a linux system basic file; in addition, the target file should also include business software files; furthermore, the target file should also include files that the business software depends on when running. After the target directory is determined, carrying out hash value calculation on the target files in the target directory according to a preset hash generation algorithm to obtain corresponding hash values. The type of hash generation algorithm is not limited, and may be, for example, a sha512 hash algorithm. sha refers to Secure Hash Algorithm, secure hash algorithm.
Since each target file can be normally called only in the designated target directory, in order to accurately characterize the state of the service system, each hash value is utilized, and the hash value file corresponding to each target directory is generated by taking the directory as a unit. Specifically, the hash value of the target file corresponding to a target directory is processed to obtain the hash value file of the target directory. The specific generation manner of the hash value file is not limited, and the hash value file can be obtained by taking the hash value and the identification information of the target directory corresponding to the hash value as a group of hash value information and combining the hash value information corresponding to the target directory.
S103: matching and matching the hash value file with a preset check file.
The preset check file refers to a check file generated by using the above manner under the condition that the service system is determined to be normal, and may be generated immediately after the service system is installed, for example. Which is preset in the node as reference data for judging whether the service system is normal. After the hash value file is obtained, matching the hash value file with a preset check file, and specifically judging whether the content of the hash value file and the content of the preset check file are identical in a matching mode. If the target catalogues are not matched, the target catalogues related to the service system on the current node are not in a normal state, and therefore the fact that the service system cannot normally operate can be determined. The present embodiment is not limited to the processing manner in this case, and in a possible implementation manner, an alarm log may be generated, and the alarm may be reported at the same time, and the joining into the cluster is refused, so as to avoid affecting the overall service.
Note that, the embodiment is not limited to a specific manner of matching pairs. For example, in one embodiment, matching the hash value file with the preset check file may include:
step 11: and comparing the hash value file with the data with the same identification information in the preset check file.
Step 12: and if all the data with the same identification information are the same, determining matching.
Step 13: if any group of data with the same identification information is not the same, the mismatch is determined.
In this embodiment, each hash value file is recorded with a hash value and identification information of the target file, and a preset verification file is recorded with a verification hash value and corresponding identification information. When matching and comparing, the data with the same identification information, namely the hash value and the verification hash value, are compared, and if the data and the verification hash value are the same, the target file corresponding to the hash value is indicated to be in a normal state currently, so that the normal operation of the service system can be supported. If all the data with the same identification information are the same, the hash value file can be determined to be matched with the preset hash value file. If any group of data with the same identification information is different, the service system is not in a normal state, and the two are not matched.
S104: and if the target directory is matched, mounting the target directory into a read-only mode, and adding the target directory into a service cluster.
If the target directory and the target directory are matched, the target directory can support the normal operation of the service system, and in this case, in order to avoid the target directory and the target files therein from being tampered or destroyed in the operation process of the service system, the target directory is mounted in a read-only mode. And adding the service cluster after the mounting is finished, so that the service system can execute the corresponding service.
It may be appreciated that before the service system is started on the node, the service system needs to be installed on the node, and a preset check file is deployed, so that the method may further include:
step 21: and acquiring an installation data packet, and installing the linux system and the business software by using the installation data packet.
Step 22: and if the linux system and the business software are installed, scanning the target directory to generate a verification hash value corresponding to the target file.
Step 23: and ordering the verification hash values corresponding to the same target directory according to a preset ordering rule to obtain a hash value sequence.
Step 24: and determining the hash value sequence as a preset check file.
When the service system is installed by using the installation data packet, the installation data packet needs to be responsible for installing the operating system and the service software, and in this embodiment, the operating system is specifically a linux system. After the linux system and the service software are installed, determining a target directory corresponding to the service system, and generating a verification hash value corresponding to the target file by scanning the target file in the target directory. Since the linux system and the service software are just installed, the possibility of being tampered or damaged does not exist, and the generated verification hash value can accurately represent the state of a normal service system. After the verification hash value is obtained, in order to improve the efficiency of subsequent matching pairing, the verification hash values can be ordered according to a preset order rule to obtain a corresponding hash value sequence. The content of the preset sequence rule is not limited, and is rational, and the rule can be from small to large. After the hash value sequence is obtained, the hash value sequence can be directly determined as a preset check file, because the hash value sequence indicates the normal state of each target file in the target directory.
Specifically, the installation data packet in the application includes target static file information and a target service configuration item, where the target static file information records a mounting mode corresponding to a target directory, and the mounting mode is specifically a read-only mode, so that the target directory is mounted as the read-only mode according to an instruction of the target static file information when the installation data packet is started later. The target service configuration item is used for designating a target script, the target script is used for initiating a plurality of parallel target processes in the starting process of the service system, and the target processes are used for scanning a target directory and generating a hash value file corresponding to the target directory. The target processes are in one-to-one correspondence with the target directories, and the generation efficiency of the hash value file can be improved by launching the parallel target processes, so that the starting detection speed is improved.
If the verification hash values corresponding to the same target directory are ordered according to a preset ordering rule to obtain a hash value sequence to generate a preset verification file, when the hash value file is generated, the hash values can be ordered according to the preset ordering rule to obtain the hash value file. In this case, in order to increase the matching speed, the matching of the hash value file with the preset check file may include:
step 31: comparing the hash value file with data corresponding to the position in a preset check file;
step 32: if the data of all the positions are the same, determining matching;
step 33: if the data of any position is different, the mismatch is determined.
In this embodiment, since the hash value file and the preset check file are ordered when they are generated, if the states of the target directories corresponding to the hash value file and the preset check file are the same, the hash values corresponding to the target files are also communicated, so that the results obtained after the hash value file and the preset check file are ordered in the same ordering manner are the same. Therefore, when matching comparison is performed, the checking hash value is not required to be searched by using the identification information, and the comparison can be directly performed according to the position of the hash value in the sequence. If the hash value and the verification hash value corresponding to all the signal positions are the same, two files can be determined to be matched. If the hash value corresponding to any one position is different from the verification hash value, it can be determined that the target directory is not in a normal state, and damage, deletion, tampering and the like of some or some of the target files may occur, so that it can be determined that the two files are not matched.
By applying the service system starting detection method provided by the embodiment of the application, when the service system on the node is started, each target directory is detected, and the target directory contains target files on which the service normally operates. By generating hash values for each target file in each target directory and composing it into a hash value file, the hash value file can be used to characterize the state of each target directory at present. Matching and matching the hash value file with a preset check file, wherein the preset check file represents the legal state of each target directory, and if the hash value file and the preset check file are matched, the target file in the target directory is not damaged or tampered, so that the normal operation of a service system can be supported. Therefore, the target directory is mounted so as to start the service system, and the target file can be prevented from being modified or damaged when the service system runs by being mounted in a read-only mode, and meanwhile, the target file is added into the service cluster so as to provide service. The method can perform fault detection in advance when the service system of the node is started, the service cluster can be added after no fault is ensured, meanwhile, the target directory is mounted in a read-only mode, the fault can not occur when the service system is operated, and the influence on the whole service is avoided.
Based on the above embodiments, in a specific implementation, the service system is specifically a storage service system. After the storage service system is installed, 8 catalogs of the storage service system are determined to be target catalogs, all files in the target catalogs are scanned, and corresponding hash value files are generated to serve as preset check files, namely the scanning result is used as a reference. After the subsequent storage system is restarted, all files of the above 8 catalogues are re-scanned, the hash value of each file is regenerated, and the hash value is compared with the scanning result generated for the first time after the system is installed. Meanwhile, static information files/etc/fstab of the file system are configured when the service system is installed, and the target directory is configured into a read-only mode, so that the files in the target directory are prevented from being deleted, edited and other operations in the running process of the storage service system.
The specific operation mode is as follows:
(1) After the system is installed, 8 shell processes are initiated in parallel, and each process is responsible for scanning one of 8 catalogs, namely, each catalog is scanned in parallel, so that the scanning time is saved, and the starting time of the system is further reduced.
(2) After each process initiated in the step (1) scans all files in the current directory, calculating a sha512 hash value of the current file for each file through a sha512sum command. The sha512 hash value ensures that different files calculate different hash values, and the operation speed is high.
(3) And (3) saving the sha512 hash value obtained by calculation in each folder in the step (2) together with the file name in the named file of the folder, and further saving the file in a/data catalog (/ file under the data catalog as a target catalog). For example, after scanning all files of the/etc directory is completed, a check file named etc. The first column of the verification files is the sha512 value of each file, and the second column is the file name of each file. Illustratively, the content of the file may be:
4d0d1a209046903c1d8d74585c42431fed8f91f325818031259065a5cbfced7f50ec6489c2fc259251983e4a6fe82b27fc1ae277b49927bce e78460decd2e2 (first column)/etc/init/ttyS 0.Conf (second column)
d537003a77f089b8c36b40d538238f9cae68fb8ddbe27d78e66cbda4171725cbe c690241832b00b9bce59691e4ad7b2461e11aad80879337b40dc670efc976b (first column)/etc/libuser. Conf (second column)
(4) And (3) sorting file contents such as etc. generated in the step (3) according to the first column sha512 value.
(5) After all the 8 processes initiated in parallel in the step (1) are waited to be executed, a bin, a sbin, a lib64, a boot, an etc, an opt, a store, and a store total of 8 checkup files (i.e., 8 preset checkup files) are obtained in the/data directory.
When the service system is started, the configuration is required according to the following steps: the storage system automatically scans all files of 8 catalogues after each restart, namely, sbin,/lib 64,/opt,/boot,/etc,/stor and generates a hash value file.
To achieve the above objective, a checksum.service file may be created based on system d, and then the checksum.service is placed under the/etc/system/system directory. A checksum.sh script, such as execstart=/etc/init/checksum.sh, is specified in a checksum.service service configuration item (i.e., a target service configuration item). After the configuration, the system md module automatically executes the checksum.sh script after the linux system is started, and then generates a hash value file corresponding to each target directory when the service system is started.
The checksum-sh script scans 8 directories according to steps 1-5,/bin,/sbin,/lib 64,/opt,/boot,/etc,/stor, and saves the obtained scan result (i.e., hash value file) under the tmp directory.
Comparing/data catalog and/tmp catalog, if the content of two files with the same name of the checksum suffix is identical, it means that all files under the catalog are consistent before and after restarting, and file tampering does not occur. If the comparison results are different, the comparison results are output to a system log file, so that the later-stage tracing is facilitated.
The service system start detection device provided in the embodiment of the present application is described below, and the service system start detection device described below and the service system start detection method described above may be referred to correspondingly.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a service system start detection device provided in an embodiment of the present application, including:
a determining module 110, configured to determine a plurality of target directories if a service system start is detected;
the hash generation module 120 is configured to generate hash values of a plurality of target files in each target directory, and generate hash value files corresponding to each target directory by using the hash values;
a comparison module 130, configured to match the hash value file with a preset check file;
and the cluster joining module 140 is configured to mount the target directory in a read-only mode and join the service cluster if the target directory matches.
Optionally, the method further comprises:
the installation module is used for acquiring an installation data packet and installing a linux system and service software by utilizing the installation data packet;
the scanning module is used for scanning the target directory and generating a verification hash value corresponding to the target file if the linux system and the service software are installed;
the verification ordering module is used for ordering the verification hash values corresponding to the same target catalog according to a preset ordering rule to obtain a hash value sequence;
and the verification file generation module is used for determining the hash value sequence as a preset verification file.
Optionally, the installation data packet includes target static file information and target service configuration items, the target static file information records a mounting mode corresponding to the target directory, and the mounting mode is a read-only mode;
the target service configuration item is used for designating a target script, the target script is used for initiating a plurality of parallel target processes in the starting process of the service system, and the target processes are used for scanning a target catalog and generating a hash value file corresponding to the target catalog; the target processes are in one-to-one correspondence with the target directories.
Optionally, the hash generation module 120 includes:
and the ordering generation unit is used for ordering the hash values according to a preset ordering rule to obtain a hash value file.
Optionally, the comparison module 130 includes:
the position comparison unit is used for comparing the hash value file with data corresponding to the position in the preset check file;
the first determining unit is used for determining matching if the data of all the positions are the same;
and the second determining unit is used for determining mismatch if the data of any position are different.
Optionally, the comparison module 130 includes:
the identification matching unit is used for comparing the hash value file with the data with the same identification information in the preset check file;
a third determining unit, configured to determine matching if all the data having the same identification information are the same;
and a fourth determining unit for determining a mismatch if any one of the groups of data having the same identification information is not identical.
Optionally, the method comprises:
and the refusing joining module is used for reporting an alarm if the hash value file is not matched with the preset check file, generating an alarm log and refusing to join the cluster.
The electronic device provided in the embodiments of the present application is described below, and the electronic device described below and the service system start detection method described above may be referred to correspondingly.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Wherein the electronic device 100 may include a processor 101 and a memory 102, and may further include one or more of a multimedia component 103, an information input/information output (I/O) interface 104, and a communication component 105.
The processor 101 is configured to control overall operation of the electronic device 100 to complete all or part of the steps in the service system start detection method described above; the memory 102 is used to store various types of data to support operation at the electronic device 100, which may include, for example, instructions for any application or method operating on the electronic device 100, as well as application-related data. The Memory 102 may be implemented by any type or combination of volatile or non-volatile Memory devices, such as one or more of static random access Memory (Static Random Access Memory, SRAM), electrically erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
The multimedia component 103 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen, the audio component being for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 102 or transmitted through the communication component 105. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 104 provides an interface between the processor 101 and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 105 is used for wired or wireless communication between the electronic device 100 and other devices. Wireless communication, such as Wi-Fi, bluetooth, near field communication (Near Field Communication, NFC for short), 2G, 3G or 4G, or a combination of one or more thereof, the respective communication component 105 may thus comprise: wi-Fi part, bluetooth part, NFC part.
The electronic device 100 may be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), digital signal processors (Digital Signal Processor, abbreviated as DSP), digital signal processing devices (Digital Signal Processing Device, abbreviated as DSPD), programmable logic devices (Programmable Logic Device, abbreviated as PLD), field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGA), controllers, microcontrollers, microprocessors, or other electronic components for performing the service system initiation detection methods as set forth in the above embodiments.
The following describes a computer readable storage medium provided in an embodiment of the present application, where the computer readable storage medium described below and the service system start detection method described above may be referred to correspondingly.
The present application further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the service system start detection method described above.
The computer readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application, but such implementation should not be considered to be beyond the scope of this application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms include, comprise, or any other variation is intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The principles and embodiments of the present application are described herein with specific examples, the above examples being provided only to assist in understanding the methods of the present application and their core ideas; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (8)

1. A method for detecting the start of a service system, comprising:
if the service system is detected to be started, determining a plurality of target catalogs;
generating hash values of a plurality of target files in each target directory respectively, and generating hash value files corresponding to each target directory by utilizing the hash values;
matching and matching the hash value file with a preset check file;
if so, mounting the target directory into a read-only mode, and adding into a service cluster;
acquiring an installation data packet, and installing a linux system and service software by using the installation data packet;
if the linux system and the service software are installed, scanning the target directory to generate a verification hash value corresponding to the target file;
sorting the verification hash values corresponding to the same target catalog according to a preset sorting rule to obtain a hash value sequence;
determining the hash value sequence as the preset check file;
the installation data packet comprises target static file information and target service configuration items, the target static file information records a mounting mode corresponding to the target directory, and the mounting mode is a read-only mode;
the target service configuration item is used for designating a target script, the target script is used for initiating a plurality of parallel target processes in the starting process of the service system, and the target processes are used for scanning the target catalogue and generating a hash value file corresponding to the target catalogue; the target processes are in one-to-one correspondence with the target directories.
2. The service system start-up detection method according to claim 1, wherein said generating a hash value file corresponding to each of the target directories using the hash values includes:
and sequencing the hash values according to the preset sequencing rule to obtain the hash value file.
3. The service system start-up detection method according to claim 2, wherein matching the hash value file with a preset check file includes:
comparing the hash value file with data corresponding to the position in the preset check file;
if the data of all the positions are the same, determining matching;
and if the data of any position are not the same, determining that the data are not matched.
4. The service system start-up detection method according to claim 1, wherein matching the hash value file with a preset check file includes:
comparing the hash value file with the data with the same identification information in the preset check file;
if all the data with the same identification information are the same, determining matching;
if any group of the data with the same identification information is not the same, determining that the data are not matched.
5. The service system start-up detection method according to claim 1, wherein if the hash value file does not match the preset check file, comprising:
reporting the alarm, generating an alarm log, and refusing to join the cluster.
6. A service system start-up detection apparatus, comprising:
the determining module is used for determining a plurality of target catalogs if the service system is detected to be started;
the hash generation module is used for respectively generating hash values of a plurality of target files in each target directory and generating hash value files corresponding to each target directory by utilizing the hash values;
the comparison module is used for matching and matching the hash value file with a preset check file;
the cluster joining module is used for mounting the target catalogue into a read-only mode if the target catalogue is matched with the target catalogue, and joining the target catalogue into a service cluster;
the installation module is used for acquiring an installation data packet and installing a linux system and service software by utilizing the installation data packet;
the scanning module is used for scanning the target directory and generating a verification hash value corresponding to the target file if the linux system and the service software are installed;
the verification ordering module is used for ordering the verification hash values corresponding to the same target catalog according to a preset ordering rule to obtain a hash value sequence;
the verification file generation module is used for determining the hash value sequence as the preset verification file;
the installation data packet comprises target static file information and target service configuration items, the target static file information records a mounting mode corresponding to the target directory, and the mounting mode is a read-only mode;
the target service configuration item is used for designating a target script, the target script is used for initiating a plurality of parallel target processes in the starting process of the service system, and the target processes are used for scanning the target catalogue and generating a hash value file corresponding to the target catalogue; the target processes are in one-to-one correspondence with the target directories.
7. An electronic device comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the service system start-up detection method according to any one of claims 1 to 5.
8. A computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the service system initiation detection method of any one of claims 1 to 5.
CN202111148509.7A 2021-09-27 2021-09-27 Service system start detection method and device, electronic equipment and storage medium Active CN113868059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111148509.7A CN113868059B (en) 2021-09-27 2021-09-27 Service system start detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111148509.7A CN113868059B (en) 2021-09-27 2021-09-27 Service system start detection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113868059A CN113868059A (en) 2021-12-31
CN113868059B true CN113868059B (en) 2023-06-20

Family

ID=78992277

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111148509.7A Active CN113868059B (en) 2021-09-27 2021-09-27 Service system start detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113868059B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542844A (en) * 2018-12-03 2019-03-29 郑州云海信息技术有限公司 A kind of event log collection method, system and electronic equipment and storage medium
CN109710317A (en) * 2018-11-16 2019-05-03 华为技术有限公司 System start method, device, electronic equipment and storage medium
CN111031110A (en) * 2019-11-29 2020-04-17 山东英信计算机技术有限公司 File uploading method and device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710317A (en) * 2018-11-16 2019-05-03 华为技术有限公司 System start method, device, electronic equipment and storage medium
CN109542844A (en) * 2018-12-03 2019-03-29 郑州云海信息技术有限公司 A kind of event log collection method, system and electronic equipment and storage medium
CN111031110A (en) * 2019-11-29 2020-04-17 山东英信计算机技术有限公司 File uploading method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113868059A (en) 2021-12-31

Similar Documents

Publication Publication Date Title
US11221838B2 (en) Hot update method, operating system, terminal device, system, and computer-readable storage medium for a system process
CN113760311A (en) Micro-service deployment method, device and medium
CN111240892B (en) Data backup method and device
CN107632901A (en) A kind of self-repair method and device of application program operation exception
CN112379940B (en) Executable file processing method and device, electronic equipment and storage medium
CN102929732B (en) Method and device for calling file by application program and client-side equipment
CN112363907A (en) Test method and device for Dubbo interface, electronic device and storage medium
CN102929733B (en) Method and device for processing error files and client-side equipment
CN113868059B (en) Service system start detection method and device, electronic equipment and storage medium
CN111258681B (en) BeeGFS service starting method and device
CN108959915B (en) Rootkit detection method, rootkit detection device and server
CN109446008B (en) Fault reason detection method, fault reason detection device and terminal equipment
CN111966630A (en) File type detection method, device, equipment and medium
CN114879985B (en) Method, device, equipment and storage medium for installing certificate file
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
CN113282347B (en) Plug-in operation method, device, equipment and storage medium
CN104317645A (en) Method and device of monitoring port by virtue of application program embodiment
WO2016180174A1 (en) Method and apparatus for synchronizing voice files
CN114489999A (en) Method and device for processing pipeline task, processor and electronic equipment
CN111400243B (en) Development management system based on pipeline service and file storage method and device
CN114448788A (en) Installation method, system, equipment and medium of switch system
CN109408123B (en) Method and device for reloading configuration file
CN111857744A (en) Installation method, system, equipment and medium of super-fusion system
CN112052125A (en) Dump processing method and device for operating system kernel and electronic equipment
CN110389868B (en) Method and system for optimizing complete machine diagnosis process of server manufacturing factory

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