Detailed Description
At present, the method for detecting an application by an LVS is to detect only a network condition of an RS where the application is located, for example, whether a port where the RS is mounted to the LVS is available is detected, but the availability of the port does not mean that the application is certainly available, and the application can normally provide services depending on the network condition, processes and connection numbers of the application on the RS, services of other rooms, and the like. Therefore, the present specification divides all functions on which an application depends into a strong dependency and a weak dependency, prohibits the application from starting if the strong dependency does not detect a pass, and permits the starting if the strong dependency does detect a pass and the weak dependency does not detect a pass, and can appropriately adjust the application.
In order to make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
Fig. 2 is a schematic view of a detection process provided in the present specification, which specifically includes the following steps:
s200: and judging whether the detection of the application is triggered, if so, executing the step S202, otherwise, returning to the step S200.
In this specification, an application is installed on an RS, the same application may be installed on multiple RSs, the RS may be installed on an LVS, the LVS provides services to the outside, when a certain RS is prohibited from being started or shielded by the LVS, the same application installed on other RSs can still provide services through the LVS, one room is provided with one LVS and multiple RSs, if the service provided by the application depends on other services, the room communication needs to be performed through the LVS, when one RS communicates with the RSs of other rooms, the RS can directly access the LVS of other rooms, and does not need to access through the LVS where its own room is located, which is the same as the network architecture shown in fig. 1.
For an application installed on the RS, the main body for detecting the application may be another application installed on the RS, or may be a plug-in or a functional module carried in the application.
In this specification, a method of determining whether to trigger detection of an application may specifically be that, when a start instruction for starting the application is received, the detection of the application is triggered. Of course, the method for triggering detection may also be other methods, for example, when the specified function of the application is triggered, the detection of the application is triggered, or when a preset detection time comes, the detection of the application is triggered, which is not limited in this application.
S202: and detecting the strong dependence items and the weak dependence items according to the strong dependence items and the weak dependence items which are set for the application in advance.
In this specification, all functions on which one application can normally provide a service are classified into strong dependencies and weak dependencies.
The strong dependency term refers to a plurality of detection terms which have a large influence on whether the application can provide the service, and if any one detection term is abnormal, the application cannot provide the service. For example, the plurality of detection items included in the strong dependency item may specifically be: whether the port of the RS where the application is mounted on the LVS is available or not or other network conditions of the RS, whether the process of the application on the RS is normal or not, whether the number of connections which can be provided by the RS is within a specified range or not and the like.
The weak dependency item refers to a plurality of detection items with small influence on whether the application can provide the service, and if any one or more detection items are abnormal, the application can still provide part of the service. For example, the plurality of detection items included in the weak dependency item may specifically be: whether the soft load addresses required to be accessed by the application can be subscribed, whether the RS where the application is located receives heartbeat responses of all other RSs, whether all protocol functions supported by the application are normal and the like. Obviously, the soft payload address that the application needs to access cannot be fully subscribed to, but can be only subscribed to one part, and the application can still provide services to the outside, so that the soft payload address is a weak dependency item. Of course, if all the soft load addresses cannot be subscribed to, it is likely that the communication between the RS and another server for providing the soft load addresses is not normal, and this is a strong dependency, as shown in fig. 3.
When detecting the strong dependency item and the weak dependency item, the strong dependency item can be preferentially detected, if the strong dependency item is not detected, the weak dependency item does not need to be detected, step S208 is directly executed, and if the strong dependency item is detected, the weak dependency item can be continuously detected. When detecting the strong dependence items, if the detection of all detection items contained in the strong dependence items passes, the detection of the strong dependence items can be determined to pass, and if at least one detection item does not pass, the detection of the strong dependence items is determined to not pass. Similarly, when the weak dependency is detected, if the detection of all the detection items included in the weak dependency passes, it is determined that the detection of the weak dependency passes, and if at least one detection item does not pass, it is determined that the detection of the weak dependency does not pass.
S204: and when the strong dependency item and the weak dependency item are detected to be passed, allowing the application to be started so as to mount the RS where the application is located on the LVS.
S206: and when the strong dependency item is detected to be passed and the weak dependency item is detected to be failed, allowing the application to be started so that the real server RS where the application is located is mounted on the Linux virtual server LVS, and adjusting the application according to the weak dependency item which is not detected to be passed.
S208: and when the strong dependence item is not detected, prohibiting the application from starting so as to prohibit the RS from being mounted on the LVS.
It can be known from the definitions of the strong dependency and the weak dependency that the application cannot provide the service when the strong dependency fails to be detected, and the application can still provide part of the service when the strong dependency passes but the weak dependency fails to be detected, so that if both pass, the application can be directly allowed to start, so that the RS where the application is located is mounted on the LVS. If the strong dependency detection passes but the weak dependency detection does not pass, the application is also allowed to be started so that the RS where the application is located is mounted on the LVS, and the application can be adjusted according to the weak dependency that the detection does not pass, specifically, the configuration parameters of the application and/or the RS where the application is located, and the like can be adjusted. E.g., adjusting the priority of the application, adjusting the priority of the RS in which the application resides, etc. If the strong dependency item is not detected, the application is prohibited from starting regardless of whether the weak dependency item is detected, so that the application is prohibited from being installed on the LVS of the RS.
Further, since it may be necessary to start the application (for example, to detect whether the process of the application on the RS is normal or not) and then perform detection when detecting the strong dependency and the weak dependency of the application, when the strong dependency cannot be detected, the method for prohibiting the application from starting may specifically be: the application is forced to close so that the LVS masks the RS where the application is located.
Because some functions that the application depends on may not be started immediately when the application is started to be detected, but may be started later, in order to improve the accuracy of detection, a method of detecting multiple times is adopted in this specification, and specifically, each detection item included in the strongly dependent item is detected; if the detection item passes the detection, other detection items included by the strong dependence item are continuously detected; if the detection item is not detected, judging whether the detection frequency of the detection item reaches a threshold value, if so, determining that the detection item is not detected, if not, detecting the detection item again until the detection item passes the detection or the detection frequency of the detection item reaches the threshold value.
Similarly, for each detection item included in the weak dependence item, the detection item is detected; if the detection item passes the detection, other detection items included by the weak dependence item are continuously detected; if the detection item is not detected, judging whether the detection frequency of the detection item reaches a threshold value, if so, determining that the detection item is not detected, if not, detecting the detection item again until the detection item passes the detection or the detection frequency of the detection item reaches the threshold value.
The threshold value can be set as required, for example, to 30. That is, for any detection item included in the strongly dependent item or the weakly dependent item, if there is one pass within 30 detections, the detection item is considered to pass the detection, and if there is no pass in 30 detections, the detection item is considered to fail the detection.
Considering the principle of preferentially detecting strong dependencies, the specific method for detecting both weak and future dependencies in this specification can be as shown in fig. 4.
Based on the same idea, the detection method provided for one or more embodiments of the present specification further provides a corresponding detection device, as shown in fig. 5.
An application is installed on the device;
a judging module 501, configured to judge whether to trigger detection of an application;
a detection module 502, configured to detect a strong dependency item and a weak dependency item according to the strong dependency item and the weak dependency item preset for the application if the determination module 501 determines to trigger the detection of the application;
a starting module 503, configured to allow the application to be started when the detection module 502 passes the detection on the strong dependency item and fails to pass the detection on the weak dependency item, so that the device is mounted on the Linux virtual server LVS, and adjust the application according to the weak dependency item that is not detected; when the detection module 502 fails to detect the strong dependency, the application is prohibited from starting to prohibit the device from being mounted on an LVS.
The determining module 501 is specifically configured to determine to trigger detection of an application when a start instruction for starting the application is received.
The detecting module 502 is specifically configured to preferentially detect the strong dependency; and if the strong dependence item passes the detection, detecting the weak dependence item.
The strong dependence item comprises a plurality of detection items; the weak dependency term comprises a plurality of detection terms;
the detecting module 502 is specifically configured to determine that the detection on the strong dependency item passes when all detection items included in the strong dependency item pass; when at least one detection item included in the strong dependence item is detected to be failed, determining that the detection to the strong dependence item is failed; and when at least one detection item included in the weak dependency item is detected to be failed, determining that the weak dependency item is detected to be failed.
The detecting module 502 is specifically configured to, for each detection item included in the strongly dependent item, detect the detection item; if the detection item passes the detection, other detection items included by the strong dependence item are continuously detected; if the detection item is not detected, judging whether the detection frequency of the detection item reaches a threshold value, if so, determining that the detection item is not detected, if not, detecting the detection item again until the detection item passes the detection or the detection frequency of the detection item reaches the threshold value.
The detecting module 502 is specifically configured to, for each detection item included in the weak dependency item, detect the detection item; if the detection item passes the detection, other detection items included by the weak dependence item are continuously detected; if the detection item is not detected, judging whether the detection frequency of the detection item reaches a threshold value, if so, determining that the detection item is not detected, if not, detecting the detection item again until the detection item passes the detection or the detection frequency of the detection item reaches the threshold value.
The specification also correspondingly provides a detection device, as shown in fig. 6. The device having an application installed thereon, the device comprising one or more memories and a processor, the memories storing programs and configured to perform the following steps by the one or more processors:
judging whether to trigger the detection of the application;
if the detection of the application is triggered, detecting a strong dependency item and a weak dependency item according to the strong dependency item and the weak dependency item which are preset for the application;
when the strong dependency item is detected to be passed and the weak dependency item is detected to be failed, allowing the application to be started so that the equipment is mounted on a Linux Virtual Server (LVS), and adjusting the application according to the weak dependency item which is not detected to be passed;
and when the strong dependence item is not detected, prohibiting the application from starting so as to prohibit the equipment from being mounted on the LVS.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to one or more embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are 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. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is merely one or more embodiments of the present disclosure and is not intended to limit the present disclosure. Various modifications and alterations to one or more embodiments of the present description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of one or more embodiments of the present specification should be included in the scope of the claims of the present specification.