Configuration detection method and device, electronic equipment and computer readable storage medium

文档序号:1965887 发布日期:2021-12-14 浏览:26次 中文

阅读说明:本技术 配置检测方法、装置、电子设备及计算机可读存储介质 (Configuration detection method and device, electronic equipment and computer readable storage medium ) 是由 刘志文 钟鹏超 于 2021-09-16 设计创作,主要内容包括:本申请提供一种配置检测方法、装置、电子设备及计算机可读存储介质,方法包括:业务系统获取配置系统的配置库中与该业务系统对应的所有配置策略以及待检测配置策略,且所有配置策略和待检测配置策略的格式为该业务系统所需求的格式;根据业务系统自身预设的检测规则,检测待检测配置策略与所有配置策略之间是否存在配置冲突;若不存在配置冲突,返回第一信号;若存在配置冲突,则返回第二信号。这样,配置检测并不再由配置系统按照统一设定的冲突内容来进行检测,而是以业务系统为单位,按照各业务系统自身设定的检测规则进行自身的配置策略冲突检测,从而使得检测通过的待检测配置策略必然是符合各业务系统自身规则的,提高了检测可靠性。(The application provides a configuration detection method, a configuration detection device, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: the business system acquires all configuration strategies corresponding to the business system and configuration strategies to be detected in a configuration library of the configuration system, and the formats of all the configuration strategies and the configuration strategies to be detected are the formats required by the business system; detecting whether configuration conflicts exist between the configuration strategy to be detected and all the configuration strategies according to a detection rule preset by a service system; if no configuration conflict exists, returning a first signal; if there is a configuration conflict, a second signal is returned. In this way, the configuration detection is not performed by the configuration system according to the uniformly set conflict content any more, but the configuration policy conflict detection is performed according to the detection rule set by each service system by taking the service system as a unit, so that the configuration policy to be detected which is passed through the detection is necessarily in accordance with the rule of each service system, and the detection reliability is improved.)

1. A configuration detection method is applied to a service system, and comprises the following steps:

acquiring all configuration strategies corresponding to the business system and configuration strategies to be detected in a configuration library of a configuration system; the formats of all the configuration strategies and the configuration strategies to be detected are the formats required by the service system;

detecting whether configuration conflicts exist between the configuration strategy to be detected and all the configuration strategies according to a detection rule preset by the service system;

if the configuration conflict does not exist, returning a first signal representing that the configuration strategy to be detected is allowed to be added into the configuration library;

and if the configuration conflict exists, returning a second signal for representing that the configuration strategy to be detected is not allowed to be added into the configuration library.

2. The configuration detection method according to claim 1, wherein the detecting whether there is a configuration conflict between the configuration policy to be detected and the all configuration policies according to a detection rule preset by the service system itself comprises:

configuring according to the configuration strategy to be detected and the parameter values of the configuration parameters in all the configuration strategies;

carrying out system operation;

if the operation is normal, determining that no configuration conflict exists;

and if the operation is abnormal, determining that configuration conflict exists.

3. A configuration detection method is applied to a configuration system and comprises the following steps:

when a configuration strategy to be detected is obtained, determining a service system corresponding to the configuration strategy to be detected;

acquiring all configuration strategies corresponding to the service system in a configuration library;

judging whether the formats of all the configuration strategies and the configuration strategies to be detected are the target format required by the service system;

if so, sending the all configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to the all configuration strategies and the configuration strategies to be detected;

if not, converting the formats of all the configuration strategies and the configuration strategies to be detected into the target format, and sending the format-converted all the configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to all the configuration strategies and the configuration strategies to be detected;

when a first signal which is returned by the service system and indicates that the configuration strategy to be detected is allowed to be added into the configuration library is received, adding the configuration strategy to be detected into the configuration library;

and rejecting the configuration strategy to be detected when a second signal which is returned by the service system and indicates that the configuration strategy to be detected is not allowed to be added into the configuration library is received.

4. The configuration detection method according to claim 3, wherein the configuration policy to be detected is: newly added configuration policies, or configuration policies obtained by modifying any configuration policy in the configuration library.

5. The configuration detection method according to claim 4, wherein, when the configuration policy to be detected is a modified configuration policy of any configuration policy in the configuration library, the process of acquiring the configuration policy to be detected includes:

acquiring modified content; the modified content comprises a strategy unique identifier and a strategy value;

determining a target configuration strategy to be modified from the configuration library according to the strategy unique identifier;

and modifying the strategy value of the target configuration strategy into the strategy value in the modified content.

6. The configuration detection method according to claim 4, wherein the policy value of the modified content is a replacement value corresponding to all the content in the target configuration policy.

7. The configuration detection method according to any one of claims 4 to 6, wherein when the configuration policy to be detected is a newly added configuration policy, the configuration policy to be detected includes: the policy value of the configuration policy to be detected, and the reference relationship between the configuration policy to be detected and the existing configuration policy in the configuration library.

8. A configuration detection device applied to a service system includes: the device comprises a receiving module and a detecting module;

the receiving module is used for acquiring all configuration strategies corresponding to the business system and the configuration strategies to be detected in a configuration library of the configuration system; the formats of all the configuration strategies and the configuration strategies to be detected are the formats required by the service system;

the detection module is used for detecting whether configuration conflicts exist between the configuration strategy to be detected and all the configuration strategies according to a detection rule preset by the service system; if the configuration conflict does not exist, returning a first signal representing that the configuration strategy to be detected is allowed to be added into the configuration library; and if the configuration conflict exists, returning a second signal for representing that the configuration strategy to be detected is not allowed to be added into the configuration library.

9. A configuration detection device is applied to a configuration system and comprises: the device comprises a determining module, an obtaining module and a processing module;

the determining module is used for determining a service system corresponding to the configuration strategy to be detected when the configuration strategy to be detected is obtained;

the acquisition module is used for acquiring all configuration strategies corresponding to the service system in a configuration library;

the processing module is used for judging whether the formats of all the configuration strategies and the configuration strategies to be detected are the target format required by the service system; if so, sending the all configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to the all configuration strategies and the configuration strategies to be detected; if not, converting the formats of all the configuration strategies and the configuration strategies to be detected into the target format, and sending the format-converted all the configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to all the configuration strategies and the configuration strategies to be detected;

the processing module is further configured to add the configuration policy to be detected to the configuration library when receiving a first signal, which is returned by the service system and indicates that the configuration policy to be detected is allowed to be added to the configuration library; and rejecting the configuration strategy to be detected when a second signal which is returned by the service system and indicates that the configuration strategy to be detected is not allowed to be added into the configuration library is received.

10. An electronic device, comprising: a processor, a memory, and a communication bus;

the communication bus is used for realizing connection communication between the processor and the memory;

the processor is configured to execute one or more programs stored in the memory to implement the configuration detection method of any one of claims 1 to 7.

11. A computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the configuration detection method of any one of claims 1 to 7.

Technical Field

The present application relates to the field of network technologies, and in particular, to a configuration detection method, an apparatus, an electronic device, and a computer-readable storage medium.

Background

The operation of the network device is often performed based on the configuration of the user on the device. When the user configures, the user sends out an instruction through a web page or a command line provided by the equipment, and the network equipment obtains corresponding configuration content by analyzing the instruction of the user.

The configuration of the network device is generally divided into a plurality of configuration policies, the configuration policies are stored in a configuration system in a binary form, and finally the configuration is directly read by a service system or the configuration system converts the configuration into a configuration file which can be understood by the service system and the like to be effective.

In the actual application process, for the same service system, a plurality of corresponding configuration policies often need to exist in the configuration system, so that after all the configuration policies are loaded simultaneously, the configuration can take effect, and the service system can normally operate. However, since the writer of the configuration policy may not be able to fully master the configuration requirement of the service system, there may be a conflict between the configuration policies, which may cause the service system to fail to operate normally.

At present, when performing conflict detection of configuration policies, a configuration system receives a new configuration policy or modifies a certain configuration policy, and then identifies whether conflict content preset by policy configuration personnel exists in the new configuration policy or the modified configuration policy, so as to implement conflict detection. If the new configuration policy or the modified configuration policy has preset conflict content, the new configuration policy or the modified configuration policy is considered to have conflict with the existing configuration policy.

However, different service systems are affected by different internal software and hardware environments, and there may be a case that a service system can normally operate after a combination of certain configuration policies is adopted in some service systems, but cannot normally operate after the combination is adopted in other service systems. Therefore, the collision detection in the existing mode ignores the difference between different service systems, and the detection reliability is not high.

Disclosure of Invention

An object of the embodiments of the present application is to provide a configuration detection method, an apparatus, an electronic device, and a computer-readable storage medium, so as to solve the problem of low detection reliability in the related art.

The embodiment of the application provides a configuration detection method, which is applied to a service system and comprises the following steps: acquiring all configuration strategies corresponding to the business system and configuration strategies to be detected in a configuration library of a configuration system; the formats of all the configuration strategies and the configuration strategies to be detected are the formats required by the service system; detecting whether configuration conflicts exist between the configuration strategy to be detected and all the configuration strategies according to a detection rule preset by the service system; if the configuration conflict does not exist, returning a first signal representing that the configuration strategy to be detected is allowed to be added into the configuration library; and if the configuration conflict exists, returning a second signal for representing that the configuration strategy to be detected is not allowed to be added into the configuration library.

In the implementation process, the service system acquires the configuration policy to be detected in the configuration system and all configuration policies corresponding to the service system in the configuration library in a format required by the service system, and then the service system detects whether a configuration conflict exists between the configuration policy to be detected and all configuration policies determined to have no problem in the configuration library according to a detection rule set by the service system (see the process, if no configuration conflict exists, the configuration policies are added into the configuration library). In this way, the configuration detection is not performed by the configuration system according to the uniformly set conflict content any more, but the configuration policy conflict detection of each service system is performed according to the detection rule set by each service system by taking the service system as a unit, so that the configuration policy to be detected which is passed through the detection is necessarily in accordance with the rule of each service system, and the detection reliability is improved.

Further, the detecting whether there is a configuration conflict between the configuration policy to be detected and the all configuration policies includes: configuring according to the configuration strategy to be detected and the parameter values of the configuration parameters in all the configuration strategies; carrying out system operation; if the operation is normal, determining that no configuration conflict exists; and if the operation is abnormal, determining that configuration conflict exists.

In the implementation process, the configuration is carried out according to the configuration strategy to be detected and the parameter values of the configuration parameters in all the configuration strategies, and then the system is operated, so that the configuration strategy to be detected is rapidly determined based on whether the operation is normal or not. Therefore, through operation, the configuration situation of each configuration strategy and the actual operation environment of the service system can be effectively seen, and whether the configuration strategies conflict or not can be effectively determined.

The embodiment of the present application further provides a configuration detection method, applied to a configuration system, including: when a configuration strategy to be detected is obtained, determining a service system corresponding to the configuration strategy to be detected; acquiring all configuration strategies corresponding to the service system in a configuration library; judging whether the formats of all the configuration strategies and the configuration strategies to be detected are the target format required by the service system; if so, sending the all configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to the all configuration strategies and the configuration strategies to be detected; if not, converting the formats of all the configuration strategies and the configuration strategies to be detected into the target format, and sending the format-converted all the configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to all the configuration strategies and the configuration strategies to be detected; when a first signal which is returned by the service system and indicates that the configuration strategy to be detected is allowed to be added into the configuration library is received, adding the configuration strategy to be detected into the configuration library; and rejecting the configuration strategy to be detected when a second signal which is returned by the service system and indicates that the configuration strategy to be detected is not allowed to be added into the configuration library is received.

In the implementation process, when the configuration system acquires the configuration policy to be detected, all the configuration policies corresponding to the service system and the configuration policy to be detected can be sent to the service system in a format required by the service system, so that the service system can detect the configuration policy to be detected according to the configuration policy to be detected. In this way, it can be ensured that the business system can correctly identify the configuration policies. Meanwhile, the business system is used as a unit, and the business system detects the configuration strategy, so that the configuration strategy to be detected which passes the detection is always in accordance with the rules of each business system, and the detection reliability is improved.

Further, the configuration policy to be detected is: newly added configuration policies, or configuration policies obtained by modifying any configuration policy in the configuration library.

In the implementation process, the configuration policy to be detected can be set as a newly added configuration policy, or a configuration policy obtained by modifying any configuration policy in the configuration library, so that the configuration policy can be added to the configuration library only after being detected by the service system first after the configuration policy is required to be newly added or modified, and the configuration policy is adopted by the service system at a later stage. Therefore, strict control on the newly added configuration strategy and the modified configuration strategy is realized, and the availability of the configuration strategy in the configuration library is ensured.

Further, when the to-be-detected configuration policy is a configuration policy obtained by modifying any one configuration policy in the configuration library, the process of acquiring the to-be-detected configuration policy includes: acquiring modified content; the modified content comprises a strategy unique identifier and a strategy value; determining a target configuration strategy to be modified from the configuration library according to the strategy unique identifier; and modifying the strategy value of the target configuration strategy into the strategy value in the modified content.

In the implementation process, the configuration strategy to be modified in the configuration library can be quickly and accurately determined based on the strategy unique identifier, so that accurate strategy value replacement is realized, and the modification purpose is achieved. The whole modification process is simple and reliable to implement.

Further, the policy value of the modified content is a replacement value corresponding to all the content in the target configuration policy.

In the implementation process, the content of the whole configuration strategy is replaced integrally, and the position of the modified content does not need to be searched specifically, so that the modification efficiency is improved.

Further, when the configuration policy to be detected is a newly added configuration policy, the configuration policy to be detected includes: the policy value of the configuration policy to be detected, and the reference relationship between the configuration policy to be detected and the existing configuration policy in the configuration library.

It should be understood that, in the actual application process, reference and referenced relationships may exist between different configuration policies, and in the newly added configuration policy, by carrying the policy value and the reference relationship, the identification and configuration of the configuration policy by the service system can be effectively ensured.

The embodiment of the present application further provides a configuration detection apparatus, which is applied to a service system, and includes: the device comprises a receiving module and a detecting module; the receiving module is used for acquiring all configuration strategies corresponding to the service system in the configuration library and the configuration strategies to be detected; the detection module is used for detecting whether configuration conflicts exist between the configuration strategy to be detected and all the configuration strategies according to a detection rule preset by the service system; if the configuration conflict does not exist, returning a first signal representing that the configuration strategy to be detected is allowed to be added into the configuration library; and if the configuration conflict exists, returning a second signal for representing that the configuration strategy to be detected is not allowed to be added into the configuration library.

The embodiment of the present application further provides a configuration detection apparatus, which is applied to a configuration system, and includes: the device comprises a determining module, an obtaining module and a processing module; the determining module is used for determining a service system corresponding to the configuration strategy to be detected when the configuration strategy to be detected is obtained; the acquisition module is used for acquiring all configuration strategies corresponding to the service system in a configuration library; the processing module is used for judging whether the formats of all the configuration strategies and the configuration strategies to be detected are the target format required by the service system; if so, sending the all configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to the all configuration strategies and the configuration strategies to be detected; if not, converting the formats of all the configuration strategies and the configuration strategies to be detected into the target format, and sending the format-converted all the configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to all the configuration strategies and the configuration strategies to be detected; the processing module is further configured to add the configuration policy to be detected to the configuration library when receiving a first signal, which is returned by the service system and indicates that the configuration policy to be detected is allowed to be added to the configuration library; and rejecting the configuration strategy to be detected when a second signal which is returned by the service system and indicates that the configuration strategy to be detected is not allowed to be added into the configuration library is received.

The embodiment of the application also provides electronic equipment, which comprises a processor, a memory and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory; the processor is configured to execute one or more programs stored in the memory to implement any of the configuration detection methods described above.

Also provided in embodiments of the present application is a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement any of the above-described configuration detection methods.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.

Fig. 1 is a schematic flowchart of a configuration detection method applied to a business system according to an embodiment of the present application;

fig. 2 is a schematic flowchart of a configuration detection method applied to a configuration system according to an embodiment of the present disclosure;

FIG. 3 is a schematic diagram of a reference relationship provided by an embodiment of the present application;

fig. 4 is a schematic diagram of adding a reference relationship when a configuration policy is newly added according to an embodiment of the present application;

fig. 5 is a schematic flowchart of determining valid processing nodes according to an embodiment of the present application;

FIG. 6 is a schematic diagram illustrating a policy value modification provided in an embodiment of the present application;

fig. 7 is a schematic diagram of a configuration policy addition provided in an embodiment of the present application;

fig. 8 is a schematic structural diagram of a configuration detection apparatus applied to a business system according to an embodiment of the present application;

fig. 9 is a schematic structural diagram of a configuration detection apparatus applied to a configuration system according to an embodiment of the present application;

fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.

The first embodiment is as follows:

in order to implement conflict detection between configuration policies, an embodiment of the present application provides a configuration detection method. It should be noted that in the embodiment of the present application, the configuration detection may involve both the configuration system and the service system. In the embodiment of the present application, a corresponding configuration detection method is described for both sides of a configuration system and a service system.

As shown in fig. 1, fig. 1 is a schematic flowchart of a configuration detection method applied in a service system provided in an embodiment of the present application, and includes:

s101: and acquiring all configuration strategies corresponding to the service system in a configuration library of the configuration system and the configuration strategy to be detected.

It should be noted that, in the embodiment of the present application, the configuration library refers to a database or a storage area in the configuration system for storing and managing configuration policies.

It should be further noted that, in the embodiment of the present application, the configuration system refers to a system for managing configuration policies, and the business system refers to a system for completing a specific business. The service system and the configuration system may be located on the same one or more physical devices, but may also be located on completely different one or more physical devices, or located on a plurality of partial same physical devices, which is not limited in this embodiment of the present application.

The configuration policy is a configuration set in which parameter values of a plurality of configuration parameters of the service system are recorded. For example, assuming that the service system has A, B, C, D four configuration parameters, a configuration policy may be a1 and B1, where a1 is a parameter value of configuration parameter a and B1 is a parameter value of configuration parameter B.

It should be understood that in a possible implementation manner of the embodiment of the present application, the configuration policy to be detected may be: the newly added configuration strategy or the configuration strategy modified by any configuration strategy in the configuration library is detected to determine whether the newly added configuration strategy and the modified configuration strategy have no conflict with other configuration strategies, so that the configuration strategies added into the configuration library are all available.

It should be understood that, in the embodiment of the present application, a configuration page or a command line may be provided in the configuration system, so that a user may add or modify a configuration policy according to the configuration page or the command line. At this time, the added or modified configuration policy is the configuration policy to be detected in the embodiment of the present application.

It should be noted that, in practical applications, the configuration formats defined by the service system and the configuration system (i.e., the configuration formats required by the service system and the configuration system) may be the same or different. In order to ensure that the service system can correctly perform detection after receiving the configuration policy to be detected and all the configuration policies corresponding to the service system in the configuration library, in the embodiment of the present application, the format of all the configuration policies corresponding to the service system in the configuration library and the configuration policy to be detected, which are transmitted from the configuration system, should be the format that can be recognized by the service system (i.e., the format that should be required by the service system).

For this reason, in the embodiment of the present application, one possible implementation manner may be: and the configuration system judges whether the formats of all the configuration strategies corresponding to the service system in the configuration library and the configuration strategies to be detected are the target formats required by the service system. If yes, the format conversion processing is not needed. If not, the configuration system can perform format conversion according to the target format required by the service system, and convert the formats of all the configuration strategies corresponding to the service system and the configuration strategies to be detected into the target format.

In addition, in another possible implementation manner of the embodiment of the present application, after acquiring all configuration policies corresponding to the service system and the configuration policy to be detected, the service system may also determine whether the configuration format required by the service system is the same as the configuration format of the configuration library, so that when the configuration policies are different, all the configuration policies and the configuration policy to be detected are converted into the configuration format required by the service system (i.e., the target format).

It should be noted that the configuration policies of multiple business systems can be managed simultaneously in one configuration system. In the embodiment of the present application, in order to achieve the acquisition of all configuration policies corresponding to the service system and the configuration policy to be detected in the configuration library of the configuration system by the service system, a feasible implementation manner is: the service system can obtain all the configuration strategies which correspond to the service system and meet the format required by the service system from the configuration library by sending corresponding configuration strategy obtaining requests to the configuration system.

For example, in the above feasible implementation, after the configuration system receives a newly added configuration policy or receives a modification instruction for an existing configuration policy, it may determine whether format conversion is required according to the newly added configuration policy or a service system corresponding to a configuration policy that needs to be modified. If necessary, the newly added configuration policy or the modified configuration policy and all the configuration policies corresponding to the service system in the configuration library are converted into the target format required by the service system, then the newly added configuration policy after format conversion or the modified content corresponding to the modification instruction is temporarily stored outside the configuration library, and all the configuration policies after format conversion are stored in the configuration library and the corresponding service system is notified. If the format conversion is not needed, the newly added configuration strategy or the modification content corresponding to the modification instruction is temporarily stored outside the configuration library directly, and the corresponding service system is notified. After receiving the notification, the service system may send a corresponding configuration policy acquisition request to the configuration system, thereby acquiring, from the configuration library, all configuration policies corresponding to the service system and satisfying the format required by the service system, and acquiring the newly added configuration policy or the modification content corresponding to the modification instruction.

In yet another possible implementation of the embodiments of the present application: when the configuration system monitors the detection trigger condition of a certain service system, all configuration strategies corresponding to the service system and meeting the format required by the service system can be actively sent to the service system.

For example, in the above feasible implementation, after the configuration system receives a newly added configuration policy or receives a modification instruction for an existing configuration policy, it may be considered that the detection trigger condition of the service system corresponding to the newly added configuration policy or the configuration policy to be modified is triggered, so that it may actively determine whether format conversion is required according to the service system corresponding to the newly added configuration policy or the configuration policy to be modified. If necessary, the configuration system converts the newly added configuration policy or the modified configuration policy and all configuration policies corresponding to the service system in the configuration library into a target format required by the service system, then sends all configuration policies corresponding to the service system after format conversion to the service system, and sends the newly added configuration policy after format conversion or modified contents corresponding to the modification instruction to the service system, so that the service system performs conflict detection. If the format conversion is needed, the configuration system directly sends all the configuration strategies corresponding to the service system, and sends the newly added configuration strategies or the modification contents corresponding to the modification instructions to the service system, so that the service system can perform conflict detection.

It should be noted that, in the actual application process, there may exist reference and referenced relationships between different configuration policies, for example, as shown in fig. 3, in the figure, the configuration policy vs1 refers to three different configuration policies http ((HyperText Transfer Protocol) 1, url (Uniform Resource Locator) 1, and tcp (Transmission Control Protocol) 1.

In this embodiment of the present application, when the configuration policy to be detected is a newly added configuration policy, the newly added configuration policy may include a policy value of the configuration policy and a reference relationship between the configuration policy and an existing configuration policy in the configuration library.

For example, referring to fig. 4, the newly added configuration policy is vs2, which needs to refer to three configuration policies http2, url2 and tcp2, and therefore, the newly added configuration policy needs to include the reference relationship, which needs to refer to http2, url2 and tcp 2.

It should be noted that, in the embodiment of the present application, when the configuration policy to be detected is a configuration policy obtained by modifying any configuration policy in the configuration library, the configuration system may modify the configuration policy to be modified in the configuration library according to the obtained modification content and the configuration policy to be modified in the configuration library, so as to obtain the configuration policy to be detected.

It should be understood that, in the embodiment of the present application, the service system may also obtain the content to be modified and the configuration policy to be modified, and then modify the content to be modified and the configuration policy to be modified by the service system to obtain the modified configuration policy to be detected, which is not limited in the embodiment of the present application.

In the embodiment of the present application, in order to ensure that the configuration policy can be correctly modified, the modified content may include a policy unique identifier (for example, information with unique identifier capability, such as a unique identifier of the configuration policy) of the configuration policy to be modified and a policy value to be replaced, and further, according to the policy unique identifier in the modified content, a target configuration policy to be modified may be determined from the configuration policies in the configuration library, and the policy value of the target configuration policy is modified into the policy value in the modified content.

It should be understood that, in the embodiment of the present application, the policy value of the modified content may be a replacement value corresponding to all the content in the target configuration policy, so that only policy value replacement needs to be performed directly. In addition, in this embodiment of the application, the policy value of the modified content may also be a replacement value corresponding to a part of the content in the target configuration policy, and at this time, the modified content also needs to include a replacement position corresponding to each policy value, so as to perform replacement.

It should be understood that the reference relationships are not typically modified when modifications are made to the configuration policy, and thus may not be included in the modified content. However, if the reference relationship needs to be modified, the reference relationship to be replaced can be added into the modified content, so that the original reference relationship is replaced, and the purpose of modification is achieved.

It should be noted that in the embodiment of the present application, the value of the reference relationship may be null, thereby indicating that there is no reference relationship.

It should be noted that, when the configuration system modifies the configuration policy, the modified configuration policy to be detected does not cover the original target configuration policy in the configuration library before passing the service system detection.

It is also noted that, after modifying the target configuration policy in the configuration library, the configuration system may temporarily mark the target configuration policy as an invalid configuration, so as not to send the invalid configuration to the corresponding service system.

S102: and detecting whether configuration conflicts exist between the configuration strategy to be detected and all the configuration strategies according to a detection rule preset by the service system. If no configuration conflict exists, go to step S103; if there is a configuration conflict, go to step S104.

In the embodiment of the application, the detection rule of the service system can be preset according to the actual situation of the service system.

It should be understood that, in the embodiment of the present application, the set detection rules of different service systems may be the same or different, as long as the set detection rules can accurately detect whether there is a configuration conflict between the acquired configuration policy to be detected and the configuration policy in the configuration library.

In an optional implementation manner of the embodiment of the present application, the set detection rule may be: and comparing the configuration strategies to be detected with the configuration strategies in the configuration library respectively so as to determine whether conflicts exist.

For example, each configuration parameter in the configuration policy to be detected may be compared with each configuration parameter in each configuration policy in the configuration library, to determine whether the same configuration parameter exists, and further, when the same configuration parameter exists, determine whether the parameter value of the configuration parameter in the two configuration policies is the same, and if the same configuration parameter exists, determine that the configuration policy to be detected conflicts with the existing configuration policy.

As another example, the set detection rule may further include: detecting whether the configuration policy to be referred or the configuration policy to be referred exists in the reference relationship of the configuration policy to be detected, and determining that the configuration policy to be detected conflicts with the existing configuration policy when the configuration policy to be detected does not exist.

In another optional implementation manner of the embodiment of the present application, the set detection rule may include: the service system can be configured according to the configuration strategy to be detected and the parameter values of the configuration parameters in all the acquired configuration strategies in the configuration library, and then the system is operated; if the operation is normal, the configuration conflict does not exist; and if the operation is abnormal, determining that the configuration conflict exists.

It should be noted that, when the configuration policy to be detected is a configuration policy obtained by modifying the target configuration policy in the configuration library, the service system does not need to configure the configuration parameters according to the configuration policy before modification.

It should be understood that the above two alternative implementations are only two alternative implementations provided in the embodiment of the present application, and do not represent that each service system in the embodiment of the present application can only adopt the detection rules set in the above two implementations.

S103: a first signal is returned characterizing that the configuration policy to be detected is allowed to join the configuration library.

S104: a second signal is returned characterizing that the configuration policy to be detected is not allowed to join the configuration library.

In this embodiment of the application, after receiving the first signal, the configuration system may add the configuration policy to be detected to the configuration library. It should be noted that, when the configuration policy to be detected is a configuration policy obtained by modifying the target configuration policy in the configuration library, the configuration system may modify the target configuration policy in the configuration library according to the modification content after receiving the first signal.

In the embodiment of the present application, after receiving the second signal, the configuration system may discard the received newly added configuration policy or modify the content at this time. In addition, the provider of the newly added configuration policy or the modified content can be fed back with the information that the conflict exists, so that the provider can adjust the conflict.

It should be noted that, in the embodiment of the present application, when the business system normally works, the configuration policy corresponding to the business system is obtained from the configuration library to perform configuration. Thus, a configuration policy may only be used by the business system to work after it is added to the configuration repository by detection. Therefore, the configuration detection realizes the effective detection of the configuration strategy added into the configuration library, and ensures the reliability of the configuration strategy in the configuration library.

Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a configuration detection method applied in a configuration system according to an embodiment of the present application, including:

s201: and when the configuration strategy to be detected is obtained, determining the service system corresponding to the configuration strategy to be detected.

In the application embodiment, the configuration system may provide a configuration page or a command line for a user to add or modify the configuration policy, thereby implementing acquisition of the configuration policy to be detected.

S202: and acquiring all configuration strategies corresponding to the service system in the configuration library.

S203: and judging whether all the configuration strategies to be detected and all the configuration strategies and formats corresponding to the service system in the configuration library are the target formats required by the service system. If yes, go to step S205; otherwise, go to step S204.

S204: and converting the formats of the configuration strategy to be detected and all the configuration strategies corresponding to the service system in the configuration library into target formats.

S205: and sending the configuration strategy to be detected and all the configuration strategies corresponding to the service system in the configuration library to the service system.

In this embodiment of the present application, after receiving the configuration policy to be detected and all configuration policies corresponding to the service system in the configuration library, the service system may perform configuration detection according to the configuration detection method applied to the service system described above, and return a corresponding result signal (i.e., the first signal or the second signal).

S206: and adding the configuration strategy to be detected into the configuration library when a first signal which is returned by the service system and indicates that the configuration strategy to be detected is allowed to be added into the configuration library is received.

S207: and rejecting the configuration strategy to be detected when a second signal which is returned by the service system and indicates that the configuration strategy to be detected is not allowed to be added into the configuration library is received.

It should be understood that, in the configuration detection method applied to the configuration system, details of specific features and obtaining manners related to each step may be referred to in the foregoing description, and are not described herein again.

In the configuration detection method provided in the embodiment of the present application, the service system obtains the configuration policy to be detected in the configuration system and all configuration policies corresponding to the service system in the configuration library in a format required by the service system, and then the service system detects whether a configuration conflict exists between the configuration policy to be detected and all configuration policies determined to have no problem in the configuration library according to a detection rule set by the service system (see the above process, it is clear that the configuration policies are added to the configuration library only when no configuration conflict exists). In this way, the configuration detection is not performed by the configuration system according to the uniformly set conflict content any more, but the configuration policy conflict detection of each service system is performed according to the detection rule set by each service system by taking the service system as a unit, so that the configuration policy to be detected which is passed through the detection is necessarily in accordance with the rule of each service system, and the detection reliability is improved.

Example two:

on the basis of the first embodiment, the present embodiment takes a more specific example process as an example to further illustrate the present application.

Example one:

referring to FIG. 3, assume that the configuration policy vs1 in the configuration library references three configuration policies http1, url1 and tcp1, and assume that the policy value of http1 is http 1-1.

When the configuration system receives the modification indication, the policy value of http1 is modified from http1-1 to http1-2, and then the configuration detection process is triggered:

it is assumed that the configuration policies vs1, http1, url1 and tcp1 are all configuration policies of the service system 1.

Referring to fig. 5, the configuration system replaces the policy value of http1 with http1-1 by http1-2 according to the unique identifier in the modification indication, and the reference relationship is kept unchanged, that is, the configuration policy vs1 continues to reference three configuration policies http1, url1 and tcp1, wherein the policy value of the configuration policy http1 is modified to http 1-2.

Assuming that the configuration forms specified by the service system 1 and the configuration system are different, the configuration system performs configuration conversion, such as text conversion, on the configuration policies vs1, http1, url1 and tcp 1.

The configuration system sends the converted configuration strategies vs1, http1, url1 and tcp1 to the service system 1.

The service system 1 compares the strategy value http1-2 of the http1 with the strategy values of vs1, url1 and tcp1 in sequence, and determines whether the modified http1 conflicts with other configuration strategies.

And when the conflict is determined to exist, a second signal is returned to the configuration system, the configuration system refuses to modify, and the strategy value of http1 is continuously kept to be http1-1 in the configuration library.

And when determining that no conflict exists, returning a first signal to the configuration system, allowing the configuration system to agree to modify, and covering the original configuration strategy http1 in the configuration library with a configuration strategy http1 with strategy values replaced from http1-1 to http 1-2.

Example two:

referring to fig. 6, it is assumed that the configuration policy vs1 in the configuration library refers to three configuration policies http1, url1 and tcp1, and further, three policies http2, url2 and tcp 2.

Assuming that the configuration system receives an indication of adding the configuration policy vs2, the configuration policy vs2 references three policies http2, url2 and tcp2, and then triggers a configuration detection process:

it is assumed that the configuration policies vs1, http1, url1, tcp1, http2, url2 and tcp2 are all configuration policies of the service system 1.

Assuming that the configuration forms specified by the service system 1 and the configuration system are different, the configuration system configuration policy vs1, http1, url1, tcp1, http2, url2, tcp2 and the added configuration policy vs2 perform configuration conversion, for example, conversion into a text form, and then the configuration system sends the configuration policies vs1, http1, url1, tcp1, http2, url2, tcp2 and vs2 after format conversion to the service system 1.

After receiving the configuration policy sent by the configuration system, as shown in fig. 7, the service system 1 constructs that vs2 refers to http2, url2, and tcp2 according to the reference relationship in the added configuration policy vs 2. And comparing the strategy value of the vs2 with strategy values of vs1, http1, url1, tcp1, http2, url2 and tcp2 in sequence to determine whether the modified vs2 conflicts with other configuration strategies.

Upon determining that a conflict exists, a second signal is returned to the configuration system, which denies the addition of vs 2.

When determining that no conflict exists, a first signal is returned to the configuration system, the configuration system agrees to add, and the vs2 is added in the configuration library, so that the configuration policy relationship shown in fig. 7 is obtained.

According to the scheme, the conflict detection between different configuration strategies is realized by previewing the configuration conversion process when the configuration takes effect and detecting the generated configuration. The configuration library which is not added by wrong and conflicting configurations is ensured, and the work of the service system is not damaged.

Example three:

based on the same inventive concept, two configuration detection devices 800 and 900 are also provided in the embodiment of the present application. Referring to fig. 8 and 9, fig. 8 illustrates a configuration detecting apparatus using the method shown in fig. 1, and fig. 9 illustrates a configuration detecting apparatus using the method shown in fig. 2. It should be understood that the specific functions of the devices 800 and 900 can be referred to the description above, and the detailed description is omitted here as appropriate to avoid redundancy. The devices 800 and 900 include at least one software functional module that can be stored in memory in the form of software or firmware or solidified in the operating system of the devices 800 and 900. Specifically, the method comprises the following steps:

referring to fig. 8, the apparatus 800 is applied to a service system, and includes: a receiving module 801 and a detecting module 802. Wherein:

the receiving module 801 is configured to obtain all configuration policies corresponding to the service system and configuration policies to be detected in a configuration library of a configuration system; the formats of all the configuration strategies and the configuration strategies to be detected are the formats required by the service system;

the detection module 802 is configured to detect whether a configuration conflict exists between the configuration policy to be detected and all the configuration policies according to a detection rule preset by the service system; if the configuration conflict does not exist, returning a first signal representing that the configuration strategy to be detected is allowed to be added into the configuration library; and if the configuration conflict exists, returning a second signal for representing that the configuration strategy to be detected is not allowed to be added into the configuration library.

In this embodiment of the present application, the detecting module 802 is specifically configured to:

configuring according to the configuration strategy to be detected and the parameter values of the configuration parameters in all the configuration strategies;

carrying out system operation;

if the operation is normal, determining that no configuration conflict exists;

and if the operation is abnormal, determining that configuration conflict exists.

Referring to fig. 9, the apparatus 900 is applied to a configuration system, and includes: a determining module 901, an obtaining module 902 and a processing module 903. Wherein:

the determining module 901 is configured to determine, when the configuration policy to be detected is obtained, a service system corresponding to the configuration policy to be detected;

the obtaining module 902 is configured to obtain all configuration policies corresponding to the service system in a configuration library;

the processing module 903 is configured to determine whether the formats of all the configuration policies and the configuration policy to be detected are target formats required by the service system; if so, sending the all configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to the all configuration strategies and the configuration strategies to be detected; if not, converting the formats of all the configuration strategies and the configuration strategies to be detected into the target format, and sending the format-converted all the configuration strategies and the configuration strategies to be detected to the service system so that the service system performs configuration detection according to all the configuration strategies and the configuration strategies to be detected;

the processing module 903 is further configured to add the configuration policy to be detected to the configuration library when receiving a first signal, which is returned by the service system and indicates that the configuration policy to be detected is allowed to be added to the configuration library; and rejecting the configuration strategy to be detected when a second signal which is returned by the service system and indicates that the configuration strategy to be detected is not allowed to be added into the configuration library is received.

In a feasible implementation manner of the embodiment of the present application, the configuration policy to be detected is: newly added configuration policies, or configuration policies obtained by modifying any configuration policy in the configuration library.

In the feasible implementation manner, when the configuration policy to be detected is a modified configuration policy of any configuration policy in the configuration library, the obtaining module 902 is further configured to:

and acquiring modified content, determining a target configuration strategy to be modified from the configuration library according to the strategy unique identifier, and modifying the strategy value of the target configuration strategy into the strategy value in the modified content. Wherein the modified content comprises a policy unique identifier and a policy value.

In the above feasible implementation manner, the policy value of the modified content is a replacement value corresponding to all the content in the target configuration policy.

In the feasible implementation manner, when the configuration policy to be detected is a newly added configuration policy, the configuration policy to be detected includes: the policy value of the configuration policy to be detected, and the reference relationship between the configuration policy to be detected and the existing configuration policy in the configuration library.

It should be understood that, for the sake of brevity, the contents described in some embodiments are not repeated in this embodiment.

Example four:

the present embodiment provides an electronic device, which is shown in fig. 10 and includes a processor 1001, a memory 1002, and a communication bus 1003. Wherein:

the communication bus 1003 is used for realizing connection communication between the processor 1001 and the memory 1002.

The processor 1001 is configured to execute one or more programs stored in the memory 1002 to implement the configuration detection method in the first embodiment and/or the second embodiment.

It will be appreciated that the configuration shown in fig. 10 is merely illustrative and that the electronic device may include more or fewer components than shown in fig. 10 or have a different configuration than shown in fig. 10.

It is further understood that the electronic device shown in fig. 10 is configured with a business system and/or a configuration system, and the implementation form thereof may be a host, a server, a notebook computer, a smart phone, and the like.

The present embodiment further provides a computer-readable storage medium, such as a floppy disk, an optical disk, a hard disk, a flash Memory, a usb (Secure Digital Memory Card), an MMC (Multimedia Card), etc., where one or more programs implementing the foregoing steps are stored in the computer-readable storage medium, and the one or more programs may be executed by one or more processors to implement the steps of the configuration detection method executed by the service distribution device in the first embodiment and/or the second embodiment, or to implement the steps of the configuration detection method executed by the processing node in the first embodiment and/or the second embodiment. And will not be described in detail herein.

In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.

In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

In this document, relational terms such as first and second, and the like may be 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.

In this context, a plurality means two or more.

The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种用于搜索传输电路路由的方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!