Unit verification method and device and electronic equipment
An automated verification method addresses the inefficiencies of manual unit configuration verification by comparing full configuration information, reducing errors and enhancing software quality and user experience.
Patent Information
- Application Number
- CN202410046357.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-11
- Publication Date
- 2025-07-15
AI Technical Summary
Traditional manual verification unit configuration methods are time-consuming and error-prone, resulting in poor software quality and user experience.
Use the automation tool to obtain the configuration information of the new deployment unit and the benchmark unit, and perform automated comparisons to determine configuration problems.
Improves software quality and user experience, reduces unit configuration problems, and reduces the incidence of business function problems.
Smart Images

Figure CN120315769A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of software testing, and particularly to a method, apparatus, and electronic device for validating units. Background Art
[0002] During the software development and deployment process, it is crucial to validate the configurations of various functional units.
[0003] However, traditional methods mainly rely on manual validation of unit configurations, which is time-consuming and error-prone. It often fails to effectively detect and resolve all unit configuration issues, resulting in a relatively high proportion of business function problems, thus affecting software quality and user experience. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus, and electronic device for validating units, which reduces unit configuration issues of newly deployed units by implementing automated comparison of unit configurations, thereby improving software quality and user experience.
[0005] According to the first aspect of this application, a method for validating a unit is provided, including:
[0006] Obtain first configuration information and second configuration information, where the first configuration information is the full amount of information obtained by the first configuration service of the newly deployed unit from the configuration center, and the second configuration information is the full amount of information obtained by the second configuration service of the reference unit from the configuration center;
[0007] If the first configuration information and the second configuration information are inconsistent, it is determined that there is a unit configuration problem with the newly deployed unit.
[0008] According to the second aspect of this application, a device for validating a unit is provided, including:
[0009] An obtaining module, configured to obtain first configuration information and second configuration information, where the first configuration information is the full amount of information obtained by the first configuration service of the newly deployed unit from the configuration center, and the second configuration information is the full amount of information obtained by the second configuration service of the reference unit from the configuration center;
[0010] A determining module, configured to determine that there is a unit configuration problem with the newly deployed unit if the first configuration information and the second configuration information are inconsistent.
[0011] According to the third aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method for validating a unit described in the first aspect is implemented.
[0012] According to the fourth aspect of the present application, there is provided an electronic device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor. When the processor executes the computer program, the verification method of the unit described in the first aspect is implemented.
[0013] By means of the above technical solution, a unit verification method, device, and electronic device provided by the present application can obtain first configuration information and second configuration information. The first configuration information is the full amount of information obtained by the first configuration service of the newly deployed unit from the configuration center, and the second configuration information is the full amount of information obtained by the second configuration service of the reference unit from the configuration center. If the first configuration information and the second configuration information are inconsistent, it is determined that there is a unit configuration problem with the newly deployed unit. For the embodiments of the present disclosure, the newly deployed unit can be verified through an automated inspection tool. First, the first configuration information of the first configuration service of the newly deployed unit and the second configuration information of the second configuration service of the reference unit are obtained, and through automated comparison of unit configurations, the unit configuration problems of the newly deployed unit can be reduced, thereby reducing the proportion of business function problems and improving the quality of the software and user experience.
[0014] The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the present application more obvious and understandable, the specific embodiments of the present application are hereinafter specifically described. Brief Description of the Drawings
[0015] The drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0017] Figure 1 It is a schematic flowchart of a unit verification method provided by an embodiment of the present disclosure;
[0018] Figure 2 It is a schematic flowchart of a unit verification method provided by an embodiment of the present disclosure;
[0019] Figure 3 It is a schematic diagram of an automated comparison report of unit configurations provided by an embodiment of the present disclosure;
[0020] Figure 4A schematic diagram of the automated comparison result of unit configuration provided by an embodiment of the present disclosure;
[0021] Figure 5 A logic flow chart of the automated comparison of unit service configuration provided by an embodiment of the present disclosure;
[0022] Figure 6 A schematic structural diagram of a verification device for a unit provided by an embodiment of the present disclosure. Detailed implementation manners
[0023] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details included in the embodiments of the present disclosure are helpful for understanding and should be regarded as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description below omits the description of well-known functions and structures. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.
[0024] The following describes a verification method, device, and electronic device for a unit according to an embodiment of the present disclosure with reference to the accompanying drawings.
[0025] In order to reduce the unit configuration problems of newly deployed units, thereby improving the quality of software and the user experience. This embodiment provides a verification method for a unit, as Figure 1 shown, the method includes:
[0026] Step 101, obtain first configuration information and second configuration information.
[0027] Among them, the first configuration information may be the full amount of information obtained by the first configuration service of the newly deployed unit from the configuration center, and the second configuration information may be the full amount of information obtained by the second configuration service of the reference unit from the configuration center.
[0028] Units can usually be divided according to business functions or business domains. Each unit may include multiple related configuration services. In the scenario of unitized multi-active, a unit can be the split of a certain business at the architecture and deployment levels. Each unit may include relatively complete services and can provide relatively complete functions for a part of users.
[0029] The reference unit may be a software unit that has been running stably and is used as a reference in the production environment. The second configuration information of the reference unit can be used as a reference or benchmark for the newly deployed unit to ensure that the newly deployed unit can be compatible with the existing system and be correctly integrated.
[0030] The configuration center can be a system or service for uniformly managing all configuration information in a project, used to ensure the unified management and access of configuration information so as to automatically obtain the configuration information required by each deployment unit; the configuration center can include, but is not limited to, the Apollo configuration center.
[0031] Apollo is a relatively large software framework, and its configuration includes multiple aspects, involving hardware, software, and environment, etc.
[0032] For the embodiments of the present disclosure, the execution subject can be a unit verification device or equipment. Taking the automated inspection tool as an example of the unit verification device or equipment, the technical solutions in the present disclosure will be described, but it does not constitute a specific limitation on the technical solutions in the present disclosure.
[0033] Through the automated inspection tool, errors or inconsistencies in newly deployed units can be quickly scanned and detected to ensure that there are no errors in the unit configuration, so that the number of system failures or online problems caused by unit configuration problems is zero, improving the stability and reliability of the system and the online environment.
[0034] In a continuous integration environment, the automated tool can immediately discover configuration problems and notify developers in a timely manner, reducing the repeated rework situations caused by configuration errors during the testing process, improving development efficiency, and thus shortening the smoke testing and integration testing time.
[0035] Among them, smoke testing, also known as basic function testing, verification testing, or build verification testing, is a preliminary test in software testing. Smoke testing is used to quickly verify whether the basic functions of the software are working properly to confirm whether the software build is stable and worthy of further testing. Through the automated tool, this testing process can be accelerated. For example, the testing time originally required for 3 days can be shortened to 1 day.
[0036] Integration testing is a testing method in software development, aiming to verify the collaborative work and interoperability of multiple independent modules or components after integration. Through the automated tool, the integration testing efficiency can be improved. For example, the integration testing time can be shortened from 5 days to 4 days.
[0037] Step 102: If the first configuration information and the second configuration information are inconsistent, it is determined that there is a unit configuration problem in the newly deployed unit.
[0038] For the embodiments of the present disclosure, the automation tool may first collect the first configuration information of the newly deployed unit and the second configuration information of the benchmark unit from a configuration center (such as the Apollo configuration center); secondly, the automation tool performs a detailed comparison and analysis on the collected first configuration information and second configuration information. During the comparison process, the automation tool may mark the different parts (i.e., the comparison results) in the first configuration information and the second configuration information due to configuration errors, omissions, or improper modifications, and summarize the different parts to generate a comparison report. The comparison report is used to list all discovered unit configuration problems and possible solutions or suggestions. According to the comparison report, engineers can specifically repair the unit configuration problems to ensure that the unit operates as expected.
[0039] For example, if a certain parameter setting in the first configuration information is different from that in the second configuration information, and the change of this parameter may lead to a decrease in system performance or security vulnerabilities, then it can be considered that there is a configuration problem with the newly deployed unit.
[0040] Through automated comparison, it can be ensured that the newly deployed unit is consistent with the benchmark unit in configuration, thereby avoiding potential business problems caused by configuration differences.
[0041] In summary, according to a method for verifying a unit of the present disclosure, the first configuration information and the second configuration information can be obtained. The first configuration information is the full amount of information obtained by the first configuration service of the newly deployed unit from the configuration center, and the second configuration information is the full amount of information obtained by the second configuration service of the benchmark unit from the configuration center; if the first configuration information and the second configuration information are inconsistent, it is determined that there is a unit configuration problem with the newly deployed unit. For the embodiments of the present disclosure, the newly deployed unit can be verified through an automated inspection tool. First, the first configuration information of the first configuration service of the newly deployed unit and the second configuration information of the second configuration service of the benchmark unit are obtained, and through automated comparison of unit configurations, the unit configuration problems of the newly deployed unit can be reduced, thereby reducing the proportion of business function problems and improving the quality of the software and user experience.
[0042] Furthermore, as a refinement and extension of the above embodiments, in order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides a specific method as shown in Figure 2 The specific method includes the following steps:
[0043] Step 201, check whether the first configuration service and the second configuration service are unit services; if both the first configuration service and the second configuration service are unit services, then obtain the first configuration information and the second configuration information.
[0044] Among them, the unit service may be a service corresponding to a business that has been unitized. The unit can be deployed at different geographical locations according to business requirements. Each unit provides the same number of services and has the same business architecture.
[0045] In unitary deployment, each unit should be consistent. By checking whether the first configuration service and the second configuration service are unit services, it is possible to verify whether errors occur during the deployment process, such as deploying different versions of services or omitting necessary configurations.
[0046] If both the first configuration service and the second configuration service are unit services, automated tools can be used to obtain and compare the first configuration information and the second configuration information, thereby improving efficiency and reducing human errors.
[0047] For the embodiments of the present disclosure, obtaining the first configuration information and the second configuration information may specifically include:
[0048] In response to the configuration structure of the first configuration service in the configuration center, determine the first configuration information of the first configuration service in the configuration center, where the configuration structure may include different namespace structures, and different namespace structures are configured with different key:value structures;
[0049] In response to the configuration structure of the second configuration service in the configuration center, determine the second configuration information of the second configuration service in the configuration center.
[0050] Among them, the configuration structure may be the way and organizational structure for storing configuration information in the configuration center. In the configuration center, the configuration structure may include different namespace (namespace) structures. The namespace structure may be a way of organizing configuration items, allowing configuration information to be logically grouped for easy management and access.
[0051] Different namespace structures may contain different key and value pairs.
[0052] The configuration information may include namespace data, key data, and value data;
[0053] The namespace data may be data related to the namespace structure, and may include the name, description, location, etc. of the namespace;
[0054] The key data may be data related to the key structure, and may be a key defined in a specific namespace, such as "database_url" or "api_token";
[0055] The value data may be data related to the value structure, and may be the value corresponding to the key.
[0056] Step 202: In the case where the first configuration service is the same as the second configuration service, if the first configuration information is inconsistent with the second configuration information, it is determined that there is a unit configuration problem with the new deployment unit.
[0057] Among them, the first configuration information may include first namespace data, the second configuration information may include second namespace data, the first namespace data may be the namespace data of the new deployment unit, and the second namespace data may be the namespace data of the benchmark unit.
[0058] For the embodiments of the present disclosure, by making the configuration services in the new deployment unit and the benchmark unit the same, the configuration information in the new deployment unit and the benchmark unit can be ensured to be consistent. In a distributed system, data consistency is the basis for ensuring the correct operation of the system.
[0059] For the embodiments of the present disclosure, if the first configuration information is inconsistent with the second configuration information, it is determined that there is a unit configuration problem with the new deployment unit, which may specifically include:
[0060] If the first namespace data is inconsistent with the second namespace data, it is determined that there is a unit configuration problem with the new deployment unit. For example, some necessary configuration items are missing, or the configured parameters are incorrect.
[0061] If the first namespace data is consistent with the second namespace data, it is determined that the new deployment unit can correctly replicate or match the functions and configurations of the benchmark unit.
[0062] For the embodiments of the present disclosure, the first configuration information may include first key data, the first key data may include a first key quantity and a first key value, the second configuration information may include second key data, and the second key data may include a second key quantity and a second key value;
[0063] If the first configuration information is inconsistent with the second configuration information, it is determined that there is a unit configuration problem with the new deployment unit, which may specifically include:
[0064] If the first key quantity is inconsistent with the second key quantity, it is determined that there is a unit configuration problem with the new deployment unit; and / or,
[0065] If the first key value is inconsistent with the second key value, it is determined that there is a unit configuration problem with the new deployment unit.
[0066] Exemplarily, when comparing the first key quantity and the second key quantity, some necessary configuration items may be omitted during the configuration process of the new deployment unit or new configuration items may be added, resulting in a decrease or increase in the key quantity. Or the deployment environment of the new deployment unit may be different from that of the benchmark unit, such as different hardware, network, or storage configurations, resulting in inconsistent key quantities, thereby determining that the new deployment unit has a unit configuration problem.
[0067] Exemplarily, when comparing the first key value and the second key value, some necessary configuration items may be omitted during the configuration process of the new deployment unit, resulting in the absence of the key value. Or the new deployment unit may contain updated configuration items that do not exist in the benchmark unit, resulting in an increase or modification of the key value. Or the deployment environment of the new deployment unit may be different from that of the benchmark unit, such as different hardware, network, or storage configurations, resulting in inconsistent key values, thereby determining that the new deployment unit has a unit configuration problem.
[0068] For the embodiments of the present disclosure, the first configuration information includes a first value value, the second configuration information includes a second value value and a third value value, wherein the first value value is the actual value value of the new deployment unit, the second value value is the actual value value of the benchmark unit, and the third value value is the expected value value of the benchmark unit.
[0069] If the first configuration information and the second configuration information are inconsistent, it is determined that the new deployment unit has a unit configuration problem, which may specifically include:
[0070] Based on the configuration relationship between the second value value and the third value value, a fourth value value is determined, and the fourth value value is the expected value value of the new deployment unit.
[0071] If the second value value is consistent with the third value value, and the first value value is inconsistent with the fourth value value, it is determined that the new deployment unit has a unit configuration problem; and / or,
[0072] If the second value value is inconsistent with the third value value, and the first value value is consistent with the fourth value value, it is determined that the new deployment unit has a unit configuration problem.
[0073] In a specific application scenario, the expected value value of the new deployment unit under the same configuration item can be determined according to the configuration result of the benchmark unit. If the actual value value of a certain configuration item of the new deployment unit is inconsistent with the expected value value, but the actual value value of a certain configuration item of the referenced benchmark unit is consistent with the expected value value, it is presumably determined that the new deployment unit has a unit configuration problem.
[0074] If the actual value of a configuration item in the newly deployed unit is the same as the expected value, but the actual value of a configuration item in the referenced baseline unit is different from the expected value, it is suspected that there is a unit configuration problem in the newly deployed unit.
[0075] After determining that there is a unit configuration problem in the newly deployed unit, the comparison results of the first configuration information and the second configuration information can be summarized to obtain a comparison report, as Figure 3 shown, and the report result of the comparison report is generated, and the report result is pushed to the project communication group. Among them, the report result is used to remind that there is a unit configuration problem in the newly deployed unit, as Figure 4 shown.
[0076] For the embodiments of the present disclosure, as Figure 5 shown, the configuration information of the newly deployed unit and the baseline unit (existing unit) is compared. The comparison scope can be the services in the Apollo configuration check service list. Specifically, the traversal method can be used to compare the same services in the check service list of the newly deployed unit and the baseline unit (the same service can be the same unit service). If the key data of the newly deployed unit is inconsistent with the key data of the baseline unit, it indicates that there is a suspected unit configuration problem to be investigated; referring to the baseline unit, if the actual value of the baseline unit is the same as the expected value, and the actual value application of the newly deployed unit is inconsistent with the key data of the baseline unit, it indicates that there is a suspected unit configuration problem to be investigated; if the actual value of the baseline unit is inconsistent with the expected value, and the actual value application of the newly deployed unit is consistent with the key data of the baseline unit, it indicates that there is a suspected unit configuration problem to be investigated.
[0077] In summary, according to a unit verification method of the present disclosure, the first configuration information and the second configuration information can be obtained. The first configuration information is the full amount of information obtained by the first configuration service of the newly deployed unit from the configuration center, and the second configuration information is the full amount of information obtained by the second configuration service of the baseline unit from the configuration center; if the first configuration information and the second configuration information are inconsistent, it is determined that there is a unit configuration problem in the newly deployed unit. For the embodiments of the present disclosure, the newly deployed unit can be verified by an automated inspection tool. First, the first configuration information of the first configuration service of the newly deployed unit and the second configuration information of the second configuration service of the baseline unit are obtained, and through the automated comparison of the unit configuration, the unit configuration problems of the newly deployed unit can be reduced, thereby reducing the proportion of business function problems and improving the quality and user experience of the software.
[0078] Based on the above Figure 1 、 Figure 2For the specific implementation of the method described above, this embodiment provides a verification device for a unit, as Figure 6 shown. The device includes: an acquisition module 31 and a determination module 32;
[0079] The acquisition module 31 is configured to acquire first configuration information and second configuration information. The first configuration information is the full amount of information obtained by the first configuration service of the newly deployed unit from the configuration center, and the second configuration information is the full amount of information obtained by the second configuration service of the reference unit from the configuration center;
[0080] The determination module 32 is configured to determine that there is a unit configuration problem with the newly deployed unit if the first configuration information and the second configuration information are inconsistent.
[0081] In a specific application scenario, the device further includes: an inspection module 33;
[0082] The inspection module 33 is configured to check whether the first configuration service and the second configuration service are unit services.
[0083] In a specific application scenario, the acquisition module 31 may be configured to acquire the first configuration information and the second configuration information if both the first configuration service and the second configuration service are the unit services.
[0084] In a specific application scenario, the acquisition module 31 may be configured to determine the first configuration information of the first configuration service in the configuration center in response to the configuration structure of the first configuration service in the configuration center, where the configuration structure includes different namespace structures, and different namespace structures are configured with different key:value structures;
[0085] Determine the second configuration information of the second configuration service in the configuration center in response to the configuration structure of the second configuration service in the configuration center.
[0086] In a specific application scenario, the determination module 32 may be configured to compare the first configuration information and the second configuration information when the first configuration service and the second configuration service are the same.
[0087] In a specific application scenario, the first configuration information includes first key data, and the first key data includes a first key quantity and a first key value. The second configuration information includes second key data, and the second key data includes a second key quantity and a second key value. The determination module 32 is configured to determine that there is a unit configuration problem with the newly deployed unit if the first key quantity is inconsistent with the second key quantity; and / or, determine that there is a unit configuration problem with the newly deployed unit if the first key value is inconsistent with the second key value.
[0088] In a specific application scenario, the first configuration information includes a first value. The second configuration information includes a second value and a third value. Among them, the first value is the actual value of the newly deployed unit, the second value is the actual value of the reference unit, and the third value is the expected value of the reference unit. The determination module 32 is configured to determine a fourth value based on the configuration relationship between the second value and the third value, and the fourth value is the expected value of the newly deployed unit;
[0089] If the second value is consistent with the third value, and the first value is inconsistent with the fourth value, it is determined that there is a unit configuration problem with the newly deployed unit; and / or, if the second value is inconsistent with the third value, and the first value is consistent with the fourth value, it is determined that there is a unit configuration problem with the newly deployed unit.
[0090] In a specific application scenario, the device further includes: a summarization module 34 and a generation module 35;
[0091] The summarization module 34 is configured to summarize the comparison results of the first configuration information and the second configuration information to obtain a comparison report;
[0092] The generation module 35 is configured to generate a report result of the comparison report and push the report result, and the report result is used to remind that there is a unit configuration problem with the newly deployed unit.
[0093] It should be noted that for other corresponding descriptions of each functional unit involved in the unit verification device provided in this embodiment, reference can be made to Figure 1 and Figure 2 the corresponding descriptions of the methods in, which will not be elaborated here.
[0094] Based on the above as Figure 1 and Figure 2Accordingly, the present disclosure also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method as described above is implemented as Figure 1 and Figure 2 shown.
[0095] Based on such understanding, the technical solution of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of the present disclosure.
[0096] Based on the methods as described above such as Figure 1 and shown, and Figure 6 the virtual device embodiments shown, in order to achieve the above object, the embodiments of the present disclosure also provide an electronic device, which can be configured on the vehicle (such as an electric vehicle) side. The device includes a storage medium and a processor; the storage medium is used for storing a computer program; the processor is used for executing the computer program to implement the methods as described above such as Figure 1 and Figure 2 shown.
[0097] Optionally, the above-mentioned physical device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, sensors, an audio circuit, a WI-FI module, etc. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), etc. Optionally, the user interface may further include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0098] Those skilled in the art can understand that the above-mentioned physical device structure provided by the present disclosure does not constitute a limitation on the physical device, and may include more or fewer components, or combine some components, or have different component arrangements.
[0099] The storage medium may further include an operating system and a network communication module. The operating system is a program for managing the hardware and software resources of the above-mentioned physical device, and supports the operation of an information processing program and other software and / or programs. The network communication module is used to implement communication between the components inside the storage medium, and communication between other hardware and software in the information processing physical device.
[0100] Through the description of the above embodiments, those skilled in the art can clearly understand that the present disclosure can be implemented by means of software plus a necessary general hardware platform, or can also be implemented by hardware. The verification method, device and electronic device of the unit provided by the present disclosure, compared with the prior art, the present disclosure obtains the first configuration information and the second configuration information, where the first configuration information is the full amount of information obtained by the first configuration service of the newly deployed unit from the configuration center, and the second configuration information is the full amount of information obtained by the second configuration service of the reference unit from the configuration center; if the first configuration information and the second configuration information are inconsistent, it is determined that there is a unit configuration problem with the newly deployed unit. For the embodiments of the present disclosure, the newly deployed unit can be verified by an automated inspection tool. First, obtain the first configuration information of the first configuration service of the newly deployed unit and the second configuration information of the second configuration service of the reference unit, and through automated comparison of unit configurations, the unit configuration problems of the newly deployed unit can be reduced, thereby reducing the proportion of business function problems and improving the quality of the software and user experience.
[0101] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0102] The above are only specific embodiments of the present application, enabling those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments herein, but will conform to the broadest scope consistent with the principles and novel features claimed herein.
Claims
1. A verification method for a unit, characterized in that, Including: Obtain first configuration information and second configuration information, where the first configuration information is the full amount of information obtained by the first configuration service of the newly deployed unit from the configuration center, and the second configuration information is the full amount of information obtained by the second configuration service of the reference unit from the configuration center; If the first configuration information and the second configuration information are inconsistent, it is determined that there is a unit configuration problem with the newly deployed unit.
2. The method according to claim 1, wherein Before obtaining the first configuration information and the second configuration information, the method further includes: Check whether the first configuration service and the second configuration service are unit services; Obtaining the first configuration information and the second configuration information includes: If both the first configuration service and the second configuration service are the unit services, obtain the first configuration information and the second configuration information.
3. The method according to claim 1, wherein The obtaining the first configuration information and the second configuration information includes: In response to the configuration structure of the first configuration service in the configuration center, determine the first configuration information of the first configuration service in the configuration center, where the configuration structure includes different namespace structures, and different namespace structures are configured with different key:value structures; In response to the configuration structure of the second configuration service in the configuration center, determine the second configuration information of the second configuration service in the configuration center.
4. The method according to claim 1, characterized in that The method further includes: When the first configuration service and the second configuration service are the same, compare the first configuration information and the second configuration information.
5. The method according to claim 1, wherein The first configuration information includes first key data, and the first key data includes a first key quantity and a first key value. The second configuration information includes second key data, and the second key data includes a second key quantity and a second key value; The if the first configuration information and the second configuration information are inconsistent, it is determined that there is a unit configuration problem with the newly deployed unit, includes: If the first key quantity and the second key quantity are inconsistent, it is determined that there is a unit configuration problem with the newly deployed unit; And / or If the first key value and the second key value are inconsistent, it is determined that there is a unit configuration problem with the newly deployed unit.
6. The method according to claim 1, wherein The first configuration information includes a first value, the second configuration information includes a second value and a third value, where the first value is the actual value of the newly deployed unit, the second value is the actual value of the reference unit, and the third value is the expected value of the reference unit; The if the first configuration information and the second configuration information are inconsistent, it is determined that there is a unit configuration problem with the newly deployed unit, includes: Based on the configuration relationship between the second value and the third value, determine a fourth value, and the fourth value is the expected value of the newly deployed unit; If the second value is consistent with the third value and the first value is inconsistent with the fourth value, it is determined that there is a unit configuration problem with the new deployment unit; and / or, If the second value is inconsistent with the third value and the first value is consistent with the fourth value, it is determined that there is a unit configuration problem with the new deployment unit.
7. The method according to claim 1, wherein The method further includes: Summarize the comparison results of the first configuration information and the second configuration information to obtain a comparison report; Generate a report result of the comparison report and push the report result, where the report result is used to remind that there is a unit configuration problem with the new deployment unit.
8. A verification device for a unit, characterized in that, including: An acquisition module, configured to acquire first configuration information and second configuration information, where the first configuration information is the full amount of information acquired by the first configuration service of the new deployment unit in the configuration center, and the second configuration information is the full amount of information acquired by the second configuration service of the reference unit in the configuration center; A determination module, configured to determine that there is a unit configuration problem with the new deployment unit if the first configuration information is inconsistent with the second configuration information.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.