Test method and device for production environment, electronic equipment, storage medium and program product
By analyzing production environment snapshots and monitoring data, a local test environment that is consistent with the production environment is built, which solves the problem of difficult to reflect the production environment in the existing technology, improves the efficiency and accuracy of service subscription registration testing, and ensures the stability of the service .
Patent Information
- Application Number
- CN202411728726.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-01-10
AI Technical Summary
The prior art is difficult to reflect the actual situation of the production environment locally, which makes it difficult to guarantee the efficiency and accuracy of service subscription registration testing.
By analyzing production environment snapshots, determining the registration information of the service provider, and obtaining the subscription information of the service caller through monitoring, building a local test environment consistent with the production environment behavior, simulating the service call relationship, and improving the accuracy and efficiency of the test.
It realizes accurate identification and management of service providers and callers, improves the efficiency and accuracy of service subscription registration testing, enhances the efficiency of development and testing processes, and ensures the stability and reliability of services.
Smart Images

Figure CN119292948A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of Internet technology, big data technology and financial technology, and more specifically, to a testing method and device, electronic device, storage medium and program product for a production environment. Background Art
[0002] With the development of Internet technology, distributed systems have emerged. Distributed systems can include service providers and service callers.
[0003] A service provider is an entity that provides a specific service in a distributed system. A service caller is an entity that needs to use a service in a distributed system. During the service subscription registration process, testing in a simulated production environment can help identify and resolve problems that may exist during operation.
[0004] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related technologies: since it is difficult for the related technologies to reflect the actual situation of the production environment locally, it is difficult to effectively guarantee the efficiency and accuracy of the service subscription registration test. Summary of the invention
[0005] In view of this, the present disclosure provides a testing method and apparatus, an electronic device, a storage medium, and a program product for a production environment.
[0006] According to one aspect of the present disclosure, a testing method for a production environment is provided, comprising: determining registration information of each of M service providers based on provider information, wherein the provider information is determined based on a snapshot for the production environment; determining subscription information of each of N service callers based on caller information, wherein the caller information is obtained by monitoring the production environment; and, based on a test environment constructed based on the registration status of each of the M service providers and the subscription information of each of the N service callers, performing local testing on the production environment to obtain test results, wherein the test results characterize the service call relationship in the production environment.
[0007] According to an embodiment of the present disclosure, the above-mentioned provider information includes a first number of services that have been provided; the above-mentioned determination of the registration information of each of the M service providers based on the provider information includes: based on a first compression ratio, dividing the above-mentioned first number of services that have been provided to obtain a second number of first service sets, wherein each of the above-mentioned first service sets includes the above-mentioned third number of services that have been provided, and the above-mentioned third number is determined based on the above-mentioned second number and the above-mentioned first number; and, based on each of the above-mentioned first service sets, determining the registration information of each of the above-mentioned service providers.
[0008] According to an embodiment of the present disclosure, the above-mentioned caller information includes a fourth number of called services; the above-mentioned determination of the respective subscription information of the N service callers based on the caller information includes: based on the second compression ratio, dividing the above-mentioned fourth number of called services to obtain a fifth number of second service sets, wherein each of the above-mentioned second service sets includes the above-mentioned sixth number of called services, and the above-mentioned sixth number is determined based on the above-mentioned fourth number and the above-mentioned third number; and, based on each of the above-mentioned second service sets, determining the respective subscription information of each of the above-mentioned service callers.
[0009] According to an embodiment of the present disclosure, each of the above registration information includes a third number of first service identifiers registered by the above service provider, and each of the above subscription information includes a sixth number of second service identifiers subscribed by the above service caller.
[0010] According to an embodiment of the present disclosure, the above-mentioned method also includes, before obtaining the test result, in the above-mentioned test environment constructed based on the registration status of each of the above-mentioned M service providers and the subscription information of each of the above-mentioned N service callers, locally testing the above-mentioned production environment: for each of the above-mentioned service providers, according to the above-mentioned third number of first service identifiers, constructing a provider environment for the above-mentioned service provider; for each of the above-mentioned service callers, according to the above-mentioned sixth number of second service identifiers, constructing a caller environment for the above-mentioned service caller; and, constructing the above-mentioned test environment based on the provider environment of each of the M service providers and the caller environment of each of the N service providers.
[0011] According to an embodiment of the present disclosure, the above-mentioned production environment is locally tested based on the test environment constructed according to the registration status of each of the above-mentioned M service providers and the subscription information of each of the above-mentioned N service callers, and the test results obtained include: local testing of the provider environment of each of the M service providers and the caller environment of each of the N service providers to obtain the service call relationship in the above-mentioned production environment.
[0012] According to an embodiment of the present disclosure, the above method also includes, in the above test environment constructed based on the registration status of each of the above M service providers and the subscription information of each of the above N service callers, performing local testing on the above production environment, and after obtaining the test results: visualizing the above test results to obtain a test result schematic diagram, wherein the service call relationship in the above production environment is represented by multiple colors in the above test result schematic diagram; and determining abnormal information existing in the above production environment based on the color characteristics of the above test result schematic diagram.
[0013] According to an embodiment of the present disclosure, the method further includes, before determining the registration information of each of the M service providers based on the provider information: in response to receiving the snapshot for the production environment, performing format conversion processing on the snapshot for the production environment to obtain intermediate information in a log format, wherein the snapshot for the production environment is generated based on a distributed application coordination service; based on at least one preset character string, performing character extraction processing on the intermediate information to obtain the provider information; and associating the provider information with the environment identifier for identifying the production environment and storing them in a database.
[0014] According to an embodiment of the present disclosure, the method further includes: using a monitoring tool to monitor the production environment to obtain the caller information; and associating the caller information with the environment identifier and storing it in the database.
[0015] According to another aspect of the present disclosure, a testing device for a production environment is provided, including: a first determination module, used to determine the registration information of each of M service providers based on provider information, wherein the above-mentioned provider information is determined based on a snapshot used for the production environment; a second determination module, used to determine the subscription information of each of N service callers based on caller information, wherein the above-mentioned caller information is obtained by monitoring the above-mentioned production environment; and a testing module, used to perform local testing on the above-mentioned production environment based on a test environment constructed according to the registration status of each of the above-mentioned M service providers and the subscription information of each of the above-mentioned N service callers, to obtain a test result, wherein the above-mentioned test result characterizes the service call relationship in the above-mentioned production environment.
[0016] According to another aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method described in the present disclosure.
[0017] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which executable instructions are stored. When the executable instructions are executed by a processor, the processor implements the method described in the present disclosure.
[0018] According to another aspect of the present disclosure, a computer program product is provided. The computer program product includes computer executable instructions. When the computer executable instructions are executed, they are used to implement the method described in the present disclosure.
[0019] According to the embodiments of the present disclosure, the registration information of each service provider is determined by analyzing the snapshot of the production environment, and the subscription information of each service caller is obtained by monitoring the production environment, so as to achieve accurate identification and management of service providers and callers. On this basis, a local test environment consistent with the behavior of the production environment is constructed according to the registration information of each service provider and the subscription information of each service caller, so that the actual situation of the production environment can be reflected locally, the efficiency and accuracy of the service subscription registration test are improved, the development and testing process is made more efficient, and it helps to improve the overall stability and reliability of the service. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0021] Figure 1 The system architecture of the testing method for a production environment according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 2 A flowchart of a testing method for a production environment according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 3A An exemplary schematic diagram schematically illustrates a process of determining registration information of each of M service providers according to provider information according to an embodiment of the present disclosure;
[0024] Figure 3B An example schematic diagram schematically shows a process of determining respective subscription information of N service callers according to caller information according to an embodiment of the present disclosure;
[0025] Figure 4 An example schematic diagram schematically shows a test result display process according to an embodiment of the present disclosure;
[0026] Figure 5 A block diagram schematically shows a testing device for a production environment according to an embodiment of the present disclosure; and
[0027] Figure 6A block diagram of an electronic device suitable for implementing a testing method for a production environment according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0028] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0029] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0030] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0031] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0032] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0033] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present invention provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0034] In one example, stress testing can be used to simulate the number of providers, callers, and service registrations and subscriptions that are actually equivalent to the production environment.
[0035] However, since the performance of distributed application coordination services may be different from that in the test environment under different environments and network conditions, and the situation observed in the test environment through simple simulation means may not fully reflect the actual situation in the production environment, there are differences between the test results and the behavior in the actual production environment. In other words, some problems will only appear in the production environment, which increases the difficulty of troubleshooting and solving these problems.
[0036] In order to at least partially solve the technical problems existing in the related art, the present disclosure provides a testing method and device, electronic device, storage medium and program product for a production environment, which can be applied to Internet technology, big data technology and financial fields. The testing method for a production environment includes: determining the registration information of each of M service providers according to provider information, wherein the provider information is determined according to a snapshot used for the production environment; determining the subscription information of each of N service callers according to caller information, wherein the caller information is obtained by monitoring the production environment; and, based on a test environment constructed according to the registration status of each of the M service providers and the subscription information of each of the N service callers, performing local testing on the production environment to obtain a test result, wherein the test result characterizes the service call relationship in the production environment.
[0037] It should be noted that the testing method and device for a production environment provided by the embodiments of the present disclosure can be used in the fields of Internet technology and big data technology, for example, in the testing of distributed systems. The testing method and device for a production environment provided by the embodiments of the present disclosure can also be used in any field other than the fields of Internet technology and big data technology, for example, in the field of financial technology. The application field of the testing method and device for a production environment provided by the embodiments of the present disclosure is not limited.
[0038] Figure 1The system architecture of the test method for a production environment according to an embodiment of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0039] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0040] The user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0041] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0042] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0043] It should be noted that the test method for the production environment provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the test device for the production environment provided in the embodiment of the present disclosure can generally be set in the server 105. The test method for the production environment provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Correspondingly, the test device for the production environment provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0044] Alternatively, the test method for a production environment provided in the embodiment of the present disclosure may also be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the test apparatus for a production environment provided in the embodiment of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may be provided in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
[0045] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0046] It should be noted that the sequence numbers of the operations in the following method are only used as representations of the operations for the purpose of description, and should not be regarded as representing the execution order of the operations. Unless explicitly stated, the method does not need to be executed completely in the order shown.
[0047] Figure 2 A flowchart of a testing method for a production environment according to an embodiment of the present disclosure is schematically shown.
[0048] like Figure 2 As shown, the testing method 200 for a production environment includes operations S210 to S230.
[0049] In operation S210, registration information of each of the M service providers is determined based on the provider information, wherein the provider information is determined based on a snapshot for a production environment.
[0050] In operation S220, subscription information of each of N service callers is determined according to the caller information, wherein the caller information is obtained by monitoring the production environment.
[0051] In operation S230, based on the test environment constructed according to the registration status of each of the M service providers and the subscription information of each of the N service callers, the production environment is locally tested to obtain a test result, wherein the test result represents the service call relationship in the production environment.
[0052] According to an embodiment of the present disclosure, a test method for a production environment can be applied to a distributed system. A distributed system may include a service provider (Provider) and a service caller (Consumer). A service provider refers to an entity that provides a specific service in a distributed system. A service caller refers to an entity that needs to use a service in a distributed system.
[0053] According to an embodiment of the present disclosure, a snapshot for a production environment refers to a static record of data, system status, or application process in a production environment at a specific point in time. Snapshots can provide instant backup of data without interfering with the normal operation of the production environment. Snapshots can be used to implement multiple copies of data and provide near-real-time real production data for data mining, report query, and development testing. In addition, snapshots can also be used for environment replication. By creating system disk snapshots and custom images, new instances that are consistent with the source instance can be quickly replicated.
[0054] According to an embodiment of the present disclosure, after obtaining a snapshot for a production environment, provider information can be determined based on the snapshot for the production environment. For example, metadata information of the snapshot can be loaded, and the snapshot file can be located and loaded based on the metadata information. On this basis, the snapshot file is parsed to extract detailed information of the service provider. The provider information may include at least one of the following: service address, port number, service version, configuration information, dependent service information, security credentials, log information, etc.
[0055] According to an embodiment of the present disclosure, after obtaining the provider information, the provider information can be analyzed to determine the registration information of each of the M service providers. The registration information may include but is not limited to the name, address, service capabilities, metadata, dependencies, and health status of the service provider.
[0056] According to an embodiment of the present disclosure, the production environment may be monitored to obtain the caller information. For example, a monitoring tool may be used to monitor the production environment. Alternatively, an event tracking tool may be used to monitor the production environment. The caller information may include at least one of the following: a network address, a port number, service discovery information, call parameters, configuration information, security credentials, and log information.
[0057] According to an embodiment of the present disclosure, after obtaining the caller information, the caller information can be analyzed to determine the subscription information of each of the N service callers. The subscription information may include but is not limited to which services are subscribed, the subscribed service version, the subscribed service instance, etc.
[0058] According to an embodiment of the present disclosure, after obtaining the registration status of each of the M service providers and the subscription information of each of the N service callers, it is also possible to configure the service instances in the test environment according to the registration status of each of the M service providers, and construct the service consumers in the test environment according to the subscription information of each of the N service callers, thereby creating a local test environment isolated from the production environment.
[0059] According to the embodiments of the present disclosure, after obtaining the test environment, a load testing tool can be used to simulate the request traffic in the production environment, and the automated test script can be run to monitor indicators such as service response time, error rate, resource usage, etc. during the test execution. On this basis, the performance data collected during the test can be analyzed to obtain test results that characterize the service call relationship in the production environment.
[0060] According to the embodiments of the present disclosure, the registration information of each service provider is determined by analyzing the snapshot of the production environment, and the subscription information of each service caller is obtained by monitoring the production environment, so as to achieve accurate identification and management of service providers and callers. On this basis, a local test environment consistent with the behavior of the production environment is constructed according to the registration information of each service provider and the subscription information of each service caller, so that the actual situation of the production environment can be reflected locally, the efficiency and accuracy of the service subscription registration test are improved, the development and testing process is made more efficient, and it helps to improve the overall stability and reliability of the service.
[0061] It should be noted that, in the embodiments of the present disclosure, before obtaining the user's information, the user's consent or authorization may be obtained. For example, before operation S210, a request to obtain the user's information may be issued to the user. When the user agrees or authorizes that the user's information may be obtained, operation S210 is performed.
[0062] In the embodiments of the present disclosure, a corresponding operation portal may be provided for the user to choose to agree or reject the automated decision result. That is, before the production environment is tested locally and the test result is obtained, the user may obtain the instruction of agreeing or rejecting the processing input through the corresponding operation portal. If the user agrees to process, the production environment is tested locally based on the test environment constructed according to the registration status of each of the M service providers and the subscription information of each of the N service callers, and the test result is obtained, that is, step S230 is executed. If the user refuses to process, the expert decision process is entered.
[0063] Reference below Figure 3A , Figure 3B and Figure 4 , the testing method 200 for a production environment according to an embodiment of the present invention is further described.
[0064] According to an embodiment of the present disclosure, the testing method for a production environment may further include the following operations.
[0065] In response to receiving a snapshot for a production environment, format conversion is performed on the snapshot for the production environment to obtain intermediate information in a log format. Based on at least one preset character string, character extraction is performed on the intermediate information to obtain provider information. The provider information and an environment identifier for identifying the production environment are associated and stored in a database.
[0066] According to an embodiment of the present disclosure, a snapshot for a production environment can be generated based on a distributed application coordination service. After receiving the snapshot for a production environment, the snapshot for the production environment can be format converted to obtain intermediate information in a log format. The specific format conversion processing method can be configured according to actual business needs and is not limited here. For example, key metadata can be extracted from the snapshot, and a structured log format can be defined according to the log format specification. On this basis, the key metadata can be filled into the log format to obtain intermediate information.
[0067] According to an embodiment of the present disclosure, after obtaining the intermediate information, character extraction processing can be performed on the intermediate information based on at least one preset string to obtain provider information. The specific character extraction processing method can be configured according to actual business needs and is not limited here. For example, at least one preset string may include an IP address, an application name, a group name, and a service name. On this basis, the intermediate information can be matched based on each preset string to obtain information corresponding to the preset string, and then the provider information can be determined based on the information corresponding to each preset string.
[0068] According to an embodiment of the present disclosure, after obtaining the provider information, the provider information and the environment identifier for identifying the production environment can be associated and stored in a database. Thus, the database can store the environment identifier and the provider information in a one-to-one correspondence.
[0069] According to the embodiments of the present disclosure, by performing format conversion processing on snapshots used in production environments, snapshot data can be converted into intermediate information that is easy to analyze, and then by performing character extraction processing on the intermediate information based on at least one preset string, provider information can be accurately extracted from a large amount of data, thereby improving the efficiency and accuracy of data processing. On this basis, by associating the provider information with the environment identifier used to identify the production environment and storing them in a database, a structured and queryable data storage solution is provided for monitoring, managing, and troubleshooting the production environment.
[0070] According to an embodiment of the present disclosure, the testing method 200 for a production environment may further include the following operations.
[0071] Use monitoring tools to monitor the production environment and obtain caller information. Associate the caller information with the environment identifier and store it in the database.
[0072] According to the embodiments of the present disclosure, an appropriate monitoring tool can be selected according to the operating system and architecture of the production environment. By using the monitoring tool to monitor the production environment, caller information can be obtained. The caller information can be used to reflect the calling relationship and dependency relationship between services.
[0073] According to an embodiment of the present disclosure, after obtaining the caller information, the caller information can be associated and stored in the information pair corresponding to the environment identifier in the database according to the environment identifier of the caller information. Thus, the database can store the environment identifier, the provider information and the caller information in a one-to-one correspondence.
[0074] According to the embodiments of the present disclosure, by using monitoring tools to monitor the production environment in real time, detailed data of the service caller is automatically collected, and the caller information can be effectively captured. On this basis, the caller information and the environment identifier are associated and stored in the database, ensuring the organization and retrievability of the data.
[0075] According to an embodiment of the present disclosure, operation S210 may include the following operations.
[0076] Based on the first compression ratio, the first number of provided services are divided to obtain a second number of first service sets. According to each first service set, the registration information of each service provider is determined.
[0077] According to an embodiment of the present disclosure, the provider information may include a first number of services that have been provided. The first compression ratio may refer to a compression rate or a division ratio, which is used to determine the number of services that have been provided in the production environment simulated by each service provider in the test environment. After obtaining the provider information, the first number of services that have been provided may be divided according to the first compression ratio to obtain a second number of first service sets. The first compression ratio may be configured according to actual business needs and is not limited here. For example, the first compression ratio may be determined based on at least one of the number of services provided and the processing capacity of the server included in the provider information.
[0078] According to an embodiment of the present disclosure, the second number can be determined according to the first number and the first compression ratio, and the first number of provided services can be divided based on the second number to obtain a second number of first service sets. Each first service set can include a third number of provided services.
[0079] For example, taking the example that the provider information includes 1000 provided services and the first compression ratio is 1:10, the 1000 provided services can be divided into 10 first service sets, each of which includes 100 provided services.
[0080] According to an embodiment of the present disclosure, after obtaining the second number of first service sets, for each first service set, the registration information of each service provider can be determined respectively. The registration information can include, for example, a service name, a service version, a host name or an IP address, a port number, and other additional attributes.
[0081] For example, if the provider information includes 1000 services provided and the first compression ratio is 1:10, 10 first service sets can be obtained, each of which includes 100 services provided. Therefore, there can be 10 service providers, service provider 1 includes the sub-registration information of the services provided 1 to 100, service provider 2 includes the sub-registration information of the services provided 101 to 200, and so on, service provider 10 includes the sub-registration information of the services provided 901 to 1000. This ensures that each service provider can simulate the registration behavior in the production environment as much as possible in the test environment.
[0082] According to the embodiment of the present disclosure, the provided services are optimized and divided by the first compression ratio to form a second number of first service sets. Since each first service set includes the third number of provided services, it is ensured that each first service set contains an appropriate amount of provided services, thereby balancing the distribution and management complexity of the provided services. On this basis, by analyzing each first service set, the registration information of each service provider can be determined, providing accurate data support for tracking, maintenance and optimization of services.
[0083] Figure 3A The diagram schematically shows an example of a process of determining registration information of each of M service providers according to provider information according to an embodiment of the present disclosure.
[0084] like Figure 3A As shown in 300A, the provider information 301 may include a first number of provided services. For example, the provider information 301 may include provided services 302_1, provided services 302_2, ..., provided services 302_S. S is a first number.
[0085] After obtaining the provider information 301, the S provided services may be divided based on the first compression ratio to obtain a second number of first service sets. For example, the first service set may include a first service set 303_1, a first service set 303_2, ..., a first service set 303_T. T is the second number.
[0086] After obtaining the second number of first service sets, registration information of each service provider may be determined according to each first service set. For example, registration information 304_1 of first service set 303_1, registration information 304_2 of first service set 303_2, ..., registration information 304_T of first service set 303_T may be determined.
[0087] According to an embodiment of the present disclosure, operation S220 may include the following operations.
[0088] Based on the second compression ratio, the fourth number of called services is divided to obtain a fifth number of second service sets, wherein each second service set includes a sixth number of called services, and the sixth number is determined according to the fourth number and the third number. According to each second service set, the respective subscription information of each service caller is determined.
[0089] According to an embodiment of the present disclosure, the caller information may include a third number of called services. The second compression ratio may refer to a compression rate or a division ratio, which is used to determine the number of called services in the production environment simulated by each service caller in the test environment. After obtaining the caller information, the fourth number of provided services may be divided according to the second compression ratio to obtain a fifth number of second service sets. The second compression ratio may be configured according to actual business needs and is not limited here. For example, the second compression ratio may be determined based on at least one of the number of called services included in the caller information and the processing capacity of the server.
[0090] According to an embodiment of the present disclosure, a fifth number may be determined according to the fourth number and the second compression ratio, and the fourth number of called services may be divided based on the fifth number to obtain a fifth number of second service sets. Each second service set may include the first number of called services.
[0091] For example, taking the case where the caller information includes 1,000 provided services and the second compression ratio is 1:5, the 1,000 provided services can be divided into 5 first service sets, each of which includes 200 provided services.
[0092] According to an embodiment of the present disclosure, after obtaining the fifth number of second service sets, for each second service set, the respective subscription information of each service caller can be determined respectively. The subscription information can include, for example, a service name, a service version, a host name or an IP address, a port number, and other additional attributes.
[0093] For example, continuing to take the example that the caller information includes 1000 called services and the second compression ratio is 1:5, 5 second service sets can be obtained, each of which includes 200 called services. Therefore, there can be 5 service callers, service provider 1 includes the sub-subscription information of subscribed services 1 to 200, service provider 2 includes the sub-subscription information of called services 201 to 400, and so on, service provider 5 includes the sub-subscription information of called services 801 to 1000. In this way, it is ensured that each service caller can simulate the subscription behavior in the production environment as much as possible in the test environment, so that the behavior of the service caller in the test environment is as consistent as possible with that in the production environment.
[0094] According to an embodiment of the present disclosure, the fourth number of called services is divided by the second compression ratio to form a fifth number of second service sets. Since each second service set includes the sixth number of called services, it is ensured that each second service set contains an appropriate amount of called services, thereby balancing the distribution and management complexity of the called services. On this basis, by analyzing each second service set, the subscription information of each service caller can be determined, providing accurate data support for service tracking, maintenance and optimization.
[0095] Figure 3B An example schematic diagram of a process of determining respective subscription information of N service callers according to caller information according to an embodiment of the present disclosure is schematically shown.
[0096] like Figure 3B As shown, in 300B, the caller information 305 may include a fourth number of called services. For example, the caller information 305 may include called service 306_1, called service 306_2, ..., called service 306_U. U is the fourth number.
[0097] After obtaining the caller information 305, the fourth number of called services may be divided based on the second compression ratio to obtain a fifth number of second service sets. For example, the second service set may include a second service set 307_1, a second service set 307_2, ..., a second service set 307_V. V is the fifth number.
[0098] After obtaining the fifth number of second service sets, the subscription information of each service caller can be determined according to each second service set. For example, the subscription information 308_1 of the second service set 307_1, the subscription information 308_2 of the second service set 307_2, ..., the subscription information 308_V of the second service set 307_V can be determined.
[0099] According to an embodiment of the present disclosure, the testing method 200 for a production environment may further include the following operations.
[0100] For each service provider, a provider environment for the service provider is constructed according to the third number of first service identifiers. For each service caller, a caller environment for the service caller is constructed according to the sixth number of second service identifiers. A test environment is constructed based on the respective provider environments of the M service providers and the respective caller environments of the N service providers.
[0101] According to an embodiment of the present disclosure, each registration information includes a third number of first service identifiers registered by the service provider. For each service provider, service registration can be performed according to the first service identifier included in its registration information, so as to configure a provider environment for the service provider.
[0102] According to an embodiment of the present disclosure, each subscription information includes the sixth number of second service identifiers subscribed by the service caller. For each service caller, the service subscription can be performed according to the second service identifier included in its subscription information, so as to configure the caller environment for the service caller.
[0103] According to an embodiment of the present disclosure, after completing the construction of each service provider's respective provider environment and each service provider's respective caller environment, a test environment can be obtained by deploying each service provider's respective provider instance and each service caller's respective caller instance, and simulating the service caller's call to the service provider.
[0104] According to the embodiments of the present disclosure, by constructing a provider environment for each service provider based on the third number of first service identifiers and a caller environment for each service caller based on the sixth number of second service identifiers, the accuracy of the environment configuration of each service provider and the caller environment of each service caller can be ensured. On this basis, by constructing a test environment based on the provider environment of each service provider and the caller environment of each service provider, the service interaction scenario in the real production environment can be simulated, so that end-to-end local testing can be performed, which helps to ensure that the test results can accurately reproduce the real production environment.
[0105] According to an embodiment of the present disclosure, operation S230 may include the following operations.
[0106] Local testing is performed on the provider environment of each of the M service providers and the caller environment of each of the N service providers to obtain the service call relationship in the production environment.
[0107] According to an embodiment of the present disclosure, for each service provider, an instance of the service provider is constructed according to the third number of first service identifiers corresponding to the service provider, and for each service caller, an instance of the service caller is constructed according to the sixth number of second service identifiers corresponding to the service caller.
[0108] According to an embodiment of the present disclosure, by starting the calculated number of copies that can cover the full amount of callers and providers, that is, in a test environment built based on each service provider's respective instance and each service caller's respective instance, the service caller's call to the service provider is simulated, and the local reproduction of the production environment service registration and call relationship is completed, so as to obtain the service call relationship in the production environment.
[0109] According to the embodiments of the present disclosure, by conducting comprehensive testing on the provider environment of each of M service providers and the caller environment of each of N service callers, it is possible to simulate the service interaction scenarios in the actual production environment, which helps to ensure that the test results can accurately reproduce the actual production environment, thereby improving the accuracy of the service call relationship in the production environment.
[0110] According to an embodiment of the present disclosure, the testing method 200 for a production environment may further include the following operations.
[0111] Visualize the test results to obtain a test result diagram. According to the color characteristics of the test result diagram, determine the abnormal information in the production environment.
[0112] According to an embodiment of the present disclosure, after obtaining the test results, the test results can be visualized to obtain a test result schematic diagram, in which the service call relationship in the production environment can be represented by multiple colors. The specific process of visualization can be configured according to actual business needs and is not limited here.
[0113] According to the embodiments of the present disclosure, the test results can be cleaned and formatted to obtain preprocessed data for subsequent analysis and visualization. An appropriate chart type is selected according to the characteristics of the preprocessed data, and an initial schematic diagram is rendered based on the image type. For example, a Sankey Diagram is used to represent the call flow between services. Alternatively, a network graph is used to show the dependency relationship between services.
[0114] According to an embodiment of the present disclosure, after obtaining the initial schematic diagram, different colors can be assigned to different service call relationships to obtain a test result schematic diagram. The specific color selection can be configured according to actual business needs and is not limited here. For example, the color selection method may include at least one of the following: the type of service, the success or failure of the call, the response time, etc. In one example, a successful call can be represented by black, and a failed call can be represented by gray.
[0115] According to an embodiment of the present disclosure, after obtaining the test result schematic diagram, the abnormal information existing in the production environment can be determined based on the color characteristics of the test result schematic diagram. For example, the pattern and distribution of the abnormal color can be analyzed, that is, if the abnormal color is concentrated on a specific service or path, it may indicate that the abnormal problem is caused by a specific service or component. After obtaining the abnormal information, the abnormal information can also be displayed to the user in the form of a text prompt.
[0116] According to the embodiments of the present disclosure, by visualizing the test results, a test result schematic diagram is obtained that uses multiple colors to represent the service call relationship in the production environment, and complex service call relationships can be presented in an intuitive test result schematic diagram, thereby improving the understanding and analysis efficiency of service interactions in the production environment. On this basis, by determining the abnormal information in the production environment based on the color characteristics of the test result schematic diagram, the diagnostic efficiency of troubleshooting can be improved, thereby helping to ensure the stability and reliability of the production environment.
[0117] Figure 4 An example schematic diagram of a test result display process according to an embodiment of the present disclosure is schematically shown.
[0118] like Figure 4 As shown in 400 , the front-end interface may include a test result schematic diagram display area 401 and a text prompt area 402 .
[0119] After visualizing the test results and obtaining a test result schematic diagram, the test result schematic diagram can be displayed in the test result schematic diagram display area 401. For example, in the test result schematic diagram, the black solid line indicates that the call is normal, that is, the calling relationships between service caller N_411 calling service provider N_421, service provider N_422, and service provider N_423 are all normal; the calling relationships between service caller N_413 calling service provider N_422 and service provider N_423 are all normal; the calling relationship between service caller N_414 calling service provider N_423 is normal. Alternatively, in the test result schematic diagram, the gray dotted line indicates an abnormal call, that is, the calling relationships between service caller N_412 calling service provider N_421 and service provider N_422 are all abnormal. Therefore, it can be inferred that there may be an abnormality in service caller N_412.
[0120] After determining the abnormal information in the production environment according to the color characteristics of the test result diagram, a text prompt representing the abnormal information, “The service caller N_412 may have an abnormality.”, may be displayed in the text prompt area 402 .
[0121] The above are only exemplary embodiments, but are not limited thereto, and may also include other testing methods for production environments known in the art, as long as they can improve the efficiency and accuracy of service subscription registration testing.
[0122] It should be noted that in the embodiments of the present invention, certain software, components, models and other existing solutions in the industry may be mentioned, which should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present invention, but it does not mean that the present invention has or must use this solution.
[0123] Based on the above-mentioned testing method for production environment, the present invention also provides a testing device for production environment. Figure 5 The device is described in detail.
[0124] Figure 5 A block diagram of a testing device for a production environment according to an embodiment of the present disclosure is schematically shown.
[0125] like Figure 5 As shown, the testing device 500 for a production environment may include a first determining module 510 , a second determining module 520 and a testing module 530 .
[0126] The first determination module 510 is used to determine the registration information of each of the M service providers according to the provider information, wherein the provider information is determined according to the snapshot used for the production environment. In one embodiment, the first determination module 510 can be used to perform the operation S210 described above, which will not be repeated here.
[0127] The second determination module 520 is used to determine the subscription information of each of the N service callers according to the caller information, wherein the caller information is obtained by monitoring the production environment. In one embodiment, the second determination module 520 can be used to perform the operation S220 described above, which will not be repeated here.
[0128] The test module 530 is used to perform local testing on the production environment based on the test environment constructed according to the registration status of each of the M service providers and the subscription information of each of the N service callers, and obtain a test result, wherein the test result represents the service call relationship in the production environment. In one embodiment, the test module 530 can be used to perform the operation S230 described above, which will not be repeated here.
[0129] According to an embodiment of the present disclosure, the provider information includes a first number of provided services.
[0130] According to an embodiment of the present disclosure, the first determining module 510 may include a first dividing unit and a first determining unit.
[0131] The first division unit is used to divide a first number of provided services based on a first compression ratio to obtain a second number of first service sets, wherein each first service set includes a third number of provided services, and the third number is determined based on the second number and the first number.
[0132] The first determining unit is used to determine the registration information of each service provider according to each first service set.
[0133] According to an embodiment of the present disclosure, the caller information includes a fourth number of called services.
[0134] According to an embodiment of the present disclosure, the second determining module 520 may include a second dividing unit and a second determining unit.
[0135] The second division unit is used to divide the fourth number of called services based on the second compression ratio to obtain a fifth number of second service sets, wherein each second service set includes a sixth number of called services, and the sixth number is determined based on the fourth number and the third number.
[0136] The second determining unit is used to determine the respective subscription information of each service caller according to each second service set.
[0137] According to an embodiment of the present disclosure, each registration information includes a third number of first service identifiers registered by the service provider, and each subscription information includes a sixth number of second service identifiers subscribed by the service caller.
[0138] According to an embodiment of the present disclosure, the testing device 500 for a production environment may further include a first building block, a second building block, and a third building block.
[0139] The first building module is used to build a provider environment for each service provider according to a third number of first service identifiers.
[0140] The second building module is used to build a caller environment for each service caller according to a sixth number of second service identifiers.
[0141] The third building module is used to build a test environment based on the respective provider environments of the M service providers and the respective caller environments of the N service providers.
[0142] According to an embodiment of the present disclosure, the test module 530 may include a test unit.
[0143] The test unit is used to perform local testing on the provider environment of each of the M service providers and the caller environment of each of the N service providers to obtain the service call relationship in the production environment.
[0144] According to an embodiment of the present disclosure, the testing device 500 for a production environment may further include a visualization module and a third determination module.
[0145] The visualization module is used to visualize the test results to obtain a test result schematic diagram, wherein the test result schematic diagram uses multiple colors to represent the service call relationship in the production environment.
[0146] The third determination module is used to determine abnormal information existing in the production environment according to the color characteristics of the test result schematic diagram.
[0147] According to an embodiment of the present disclosure, the testing device 500 for a production environment may further include a format conversion processing module, a character extraction processing module and a first association storage module.
[0148] The format conversion processing module is used to, in response to receiving a snapshot for a production environment, perform format conversion processing on the snapshot for the production environment to obtain intermediate information in a log format, wherein the snapshot for the production environment is generated based on a distributed application coordination service.
[0149] The character extraction processing module is used to perform character extraction processing on the intermediate information based on at least one preset character string to obtain provider information.
[0150] The first association storage module is used to associate and store the provider information and the environment identifier for identifying the production environment in a database.
[0151] According to an embodiment of the present disclosure, the testing device 500 for a production environment may further include a monitoring module and a second associated storage module.
[0152] The monitoring module is used to monitor the production environment using monitoring tools and obtain caller information.
[0153] The second association storage module is used to associate the caller information and the environment identifier and store them in a database.
[0154] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0155] For example, any multiple of the first determination module 510, the second determination module 520, and the test module 530 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the first determination module 510, the second determination module 520, and the test module 530 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the first determination module 510 , the second determination module 520 , and the test module 530 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0156] It should be noted that the part of the testing device used in the production environment in the embodiments of the present disclosure corresponds to the part of the testing method used in the production environment in the embodiments of the present disclosure. The description of the part of the testing device used in the production environment specifically refers to the part of the testing method used in the production environment, which will not be repeated here.
[0157] Figure 6A block diagram of an electronic device suitable for implementing a testing method for a production environment according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0158] like Figure 6 As shown, the computer electronic device 600 according to the embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 609 to the random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0159] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other through bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0160] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the input / output (I / O) interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 606 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0161] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0162] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0163] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0164] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or the RAM 603 described above and / or one or more memories other than the ROM 602 and the RAM 603 .
[0165] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the testing method for a production environment provided by the embodiment of the present disclosure.
[0166] When the computer program is executed by the processor 601, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0167] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0168] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0169] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0170] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A testing method for a production environment, comprising: Determine, according to the provider information, registration information of each of the M service providers, wherein the provider information is determined according to the snapshot used for the production environment; Determining respective subscription information of N service callers according to the caller information, wherein the caller information is obtained by monitoring the production environment; and Based on a test environment constructed according to the respective registration status of the M service providers and the respective subscription information of the N service callers, the production environment is locally tested to obtain a test result, wherein the test result represents the service call relationship in the production environment.
2. The method according to claim 1, wherein: The provider information includes a first number of services provided; Determining the registration information of each of the M service providers according to the provider information includes: Based on the first compression ratio, the first number of provided services is divided to obtain a second number of first service sets, wherein each of the first service sets includes the third number of provided services, and the third number is determined according to the second number and the first number; and According to each of the first service sets, respective registration information of each of the service providers is determined.
3. The method according to claim 2, wherein: The caller information includes a fourth number of called services; Determining the subscription information of each of the N service callers according to the caller information includes: Based on the second compression ratio, dividing the fourth number of called services to obtain a fifth number of second service sets, wherein each of the second service sets includes the sixth number of called services, and the sixth number is determined according to the fourth number and the third number; and According to each of the second service sets, respective subscription information of each of the service callers is determined.
4. The method according to claim 3, wherein: Each of the registration information includes a third number of first service identifiers registered by the service provider, and each of the subscription information includes a sixth number of second service identifiers subscribed by the service caller; The method further includes, before the test environment constructed based on the registration status of each of the M service providers and the subscription information of each of the N service callers performs a local test on the production environment to obtain the test result: For each of the service providers, constructing a provider environment for the service provider according to the third number of first service identifiers; For each of the service callers, constructing a caller environment for the service caller according to the sixth number of second service identifiers; and The test environment is constructed based on respective provider environments of the M service providers and respective caller environments of the N service providers.
5. The method according to claim 4, wherein: The test environment constructed based on the registration status of each of the M service providers and the subscription information of each of the N service callers is used to perform local testing on the production environment, and the test results obtained include: Local testing is performed on the provider environments of the M service providers and the caller environments of the N service providers to obtain the service call relationship in the production environment.
6. The method according to any one of claims 1 to 5, further comprising, after obtaining the test result, performing a local test on the production environment based on the test environment constructed according to the respective registration conditions of the M service providers and the respective subscription information of the N service callers: The test results are visualized to obtain a test result schematic diagram, wherein: The test result schematic diagram uses multiple colors to represent the service call relationship in the production environment; as well as Abnormal information existing in the production environment is determined according to color characteristics of the test result schematic diagram.
7. The method according to any one of claims 1 to 5, further comprising, before determining the registration information of each of the M service providers according to the provider information: In response to receiving the snapshot for the production environment, format conversion is performed on the snapshot for the production environment to obtain intermediate information in a log format, wherein: The snapshot for the production environment is generated based on a distributed application coordination service; Based on at least one preset character string, performing character extraction processing on the intermediate information to obtain the provider information; as well as The provider information and the environment identifier for identifying the production environment are associated and stored in a database.
8. The method according to claim 7, further comprising: Using monitoring tools to monitor the production environment and obtain the caller information; as well as The caller information and the environment identifier are associated and stored in the database.
9. A testing device for a production environment, comprising: A first determination module, configured to determine registration information of each of the M service providers according to provider information, wherein the provider information is determined according to a snapshot for a production environment; A second determination module is used to determine the subscription information of each of N service callers according to the caller information, wherein the caller information is obtained by monitoring the production environment; and A testing module is used to perform local testing on the production environment based on a test environment constructed according to the registration status of each of the M service providers and the subscription information of each of the N service callers, to obtain a test result, wherein the test result represents the service call relationship in the production environment.
10. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.