Microservice verification method, device, equipment, storage medium and program product
By performing a consistency comparison of variable information when the microservice client starts, the problem of non-standard microservice parameter configuration is solved, ensuring the normal use of microservices and system stability.
Patent Information
- Application Number
- CN202410422697.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-04-09
AI Technical Summary
In a microservice architecture, issues such as unclear meaning of parameter configuration concepts, non-standard usage, and incorrect formatting can prevent microservices from being used correctly and affect system stability.
By obtaining actual variable information and comparing it with standard variable information when the microservice client starts, the verification results are determined, including the verification of variable names and values, and variable modification information and warning levels are provided to ensure the stability of the overall microservice architecture.
It implements validation of all interfaces in the microservice architecture, ensuring the normal use of microservices and improving the stability and reliability of the system.
Smart Images

Figure CN118283099B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and in particular to a micro-service verification method and device, a computer device, a storage medium and a program product. BACKGROUND
[0002] With the development of information technology, information technology is widely used in various industries. Many industries use open source-based distributed technology to implement application micro-service architecture, aiming to achieve rapid business innovation iteration and flexible system service expansion on demand. The scale of distributed micro-services in the financial field is also expanding, and the use of intermediate framework abstraction layer interfaces shields complex underlying communication and infrastructure, allowing micro-services to focus on their single business function implementation, further reducing the development threshold and redundant technical learning costs of micro-services.
[0003] However, because micro-services only focus on the implementation of single business functions, parameter configuration concepts are often unclear, not standardized, and incorrect when using intermediate framework layer interfaces, which often leads to incorrect use of micro-services. SUMMARY
[0004] Therefore, it is necessary to provide a micro-service verification method, device, computer device, storage medium and program product to ensure the normal use of micro-services.
[0005] In a first aspect, the present application provides a micro-service verification method, comprising:
[0006] In the case where it is detected that the micro-service client is started, actual variable information involved by the micro-service client is obtained from the local micro-service client, wherein the actual variable information includes variable name information and variable value information;
[0007] The actual variable information is verified according to the standard variable information of the micro-service client;
[0008] The verification result of the micro-service client is determined according to the verification result of the actual variable information.
[0009] In one embodiment, the actual variable information involved by the micro-service client is obtained from the local micro-service client, comprising:
[0010] The scanning tool is dispatched to scan the logical code in the local micro-service client to obtain the actual variable information involved by the micro-service client.
[0011] In one embodiment, the actual variable information is verified according to the standard variable information of the micro-service client, comprising:
[0012] According to the session identifier of the microservice client, standard variable information of the microservice client is obtained;
[0013] The standard variable information is compared with actual variable information for consistency;
[0014] According to the consistency comparison result, a verification result of the actual variable information is determined.
[0015] In one embodiment, according to the session identifier of the microservice client, the standard variable information of the microservice client is obtained, including:
[0016] A parameter request carrying the session identifier of the microservice client is sent to a server; wherein the parameter request is used to request the server to obtain the standard variable information of the microservice client based on the session identifier of the microservice client;
[0017] The standard variable information of the microservice client fed back by the server is received.
[0018] In one embodiment, the number of the actual variable information and the number of the standard variable information are both at least two;
[0019] Accordingly, according to the consistency comparison result, the verification result of the actual variable information is determined, including:
[0020] If the consistency comparison result is that each actual variable information is consistent with the corresponding standard variable information, it is determined that the verification result of the actual variable information is verification passed;
[0021] If the consistency comparison result is that there is actual variable information inconsistent with the standard variable information, it is determined that the verification result of the actual variable information is verification failed.
[0022] In one embodiment, according to the verification result of the actual variable information, the verification result of the microservice client is determined, including:
[0023] In the case that the verification result of the actual variable information is verification failed, variable modification information is determined according to the standard variable information and the actual variable information;
[0024] According to the variable modification information, a warning level is determined;
[0025] The warning level and the variable modification information are taken as the verification result of the microservice client.
[0026] In a second aspect, the application further provides a microservice verification device, including:
[0027] The acquisition module is configured to acquire actual variable information related to the micro-service client from the micro-service client locally when it is detected that the micro-service client is started, wherein the actual variable information comprises variable name information and variable value information.
[0028] The verification module is configured to verify the actual variable information according to the standard variable information of the micro-service client.
[0029] The determination module is configured to determine a verification result of the micro-service client according to a verification result of the actual variable information.
[0030] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0031] The acquisition module is configured to acquire actual variable information related to the micro-service client from the micro-service client locally when it is detected that the micro-service client is started, wherein the actual variable information comprises variable name information and variable value information.
[0032] The verification module is configured to verify the actual variable information according to the standard variable information of the micro-service client.
[0033] The determination module is configured to determine a verification result of the micro-service client according to a verification result of the actual variable information.
[0034] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0035] The acquisition module is configured to acquire actual variable information related to the micro-service client from the micro-service client locally when it is detected that the micro-service client is started, wherein the actual variable information comprises variable name information and variable value information.
[0036] The verification module is configured to verify the actual variable information according to the standard variable information of the micro-service client.
[0037] The determination module is configured to determine a verification result of the micro-service client according to a verification result of the actual variable information.
[0038] In a fifth aspect, the present application further provides a computer program product comprising a computer program, and the computer program is executed by a processor to implement the following steps:
[0039] The acquisition module is configured to acquire actual variable information related to the micro-service client from the micro-service client locally when it is detected that the micro-service client is started, wherein the actual variable information comprises variable name information and variable value information.
[0040] According to the standard variable information of the microservice client, the actual variable information is checked;
[0041] According to the checking result of the actual variable information, the checking result of the microservice client is determined.
[0042] The microservice checking method, device, computer device, storage medium and program product provided in the embodiments of the present application can check the actual variable information related to the microservice client based on the standard variable information of the microservice client when the microservice client is started, so as to check the microservice client. Since the actual variable information related to the microservice client includes variable information related to all interfaces in the microservice architecture, the checking process of the actual variable information related to the microservice client can check all interfaces in the microservice architecture, and can also check the functions related to the microservice, that is, the microservice architecture is checked, so that the microservice can be normally used after being put into use, and the stability of the microservice architecture is improved. BRIEF DESCRIPTION OF DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0044] Figure 1 An application environment diagram of a microservice checking method provided in an embodiment of the present application;
[0045] Figure 2 A flowchart of a microservice checking method provided in an embodiment of the present application;
[0046] Figure 3 A flowchart of checking actual variable information provided in an embodiment of the present application;
[0047] Figure 4 A flowchart of determining the checking result of a microservice client provided in an embodiment of the present application;
[0048] Figure 5 A flowchart of another microservice checking method provided in an embodiment of the present application;
[0049] Figure 6 A structure block diagram of a microservice checking device provided in an embodiment of the present application;
[0050] Figure 7Another structural block diagram of a microservice verification device provided in an embodiment of the present application is shown in the figure;
[0051] Figure 8 An internal structural diagram of a computer device provided in an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the figures and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0053] The microservice verification method provided in the embodiments of the present application can be applied in an application environment as shown in the figure. Figure 1 The terminal 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The terminal 102 obtains actual variable information related to the microservice client from the local microservice client when detecting that the microservice client is started. Further, the terminal 102 obtains standard variable information of the microservice client from the server 104, and verifies the actual variable information based on the standard variable information of the microservice client. Finally, the verification result of the microservice client is determined according to the verification result of the actual variable information. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, etc. The microservice client is configured in the terminal 102. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0054] In an exemplary embodiment, as shown in the figure, Figure 2 A microservice verification method is provided. Taking the terminal 102 in the figure Figure 1 as an example, the method can specifically include the following steps:
[0055] S201, when detecting that the microservice client is started, obtaining actual variable information related to the microservice client from the local microservice client.
[0056] It should be noted that the microservice is a software development architecture that splits an application into multiple independent processes, each of which can run as a service. Among them, each service communicates through a well-defined interface. Since each service is run independently, updates, deployments and expansions can be made for individual services, reducing the coupling between services.
[0057] In the embodiment of the present application, the microservice client, also known as the user end, is a program that provides local services for users. Optionally, the microservice client can provide one or more services.
[0058] The actual variable information is related information of the actual variables involved in the microservice client, including but not limited to variable name information and variable value information. Among them, the variable name information includes but is not limited to variable naming rules and variable name length requirements; the variable value information includes but is not limited to variable value form, variable value type (such as integer, character, etc.) and variable value precision, etc.
[0059] In the embodiment of the present application, the actual variables involved in the microservice client can include all the actual variables involved in all the services in the microservice client; or the actual variables involved in the microservice client can only include the actual variables involved in a service to be provided. Further, the number of actual variables is one or more; correspondingly, the number of actual variable information is one or more.
[0060] For example, before the microservice is officially put into service (i.e. used) to provide services, the microservice client can be verified based on the actual variable information involved in the microservice client. Based on this, the actual variable information involved in the microservice client needs to be obtained first.
[0061] In an implementable manner, the actual variable information involved in the microservice client can be obtained from the microservice client locally when it is detected that the microservice client is started.
[0062] Optionally, there are many ways to detect that the microservice client is started, which are not limited in the embodiment. For example, one way can be to receive a service request initiated by the microservice client. Another way can be to identify that the state of the microservice client is a starting state.
[0063] Further, the actual variable information involved in the microservice client can be obtained from a database pre-stored locally in the microservice client (the actual variable information in the database locally in the microservice client can be updated every interval, for example, the interval is 24 hours). Or, the actual variable information involved in the microservice client can also be obtained by real-time scanning of the code of the microservice client.
[0064] S202, according to the standard variable information of the microservice client, the actual variable information is checked.
[0065] The standard variable information is a variable information template related to the microservice client, which can be pre-stored in a server or a cloud server and the like. In the embodiment of the application, the standard variable information can be a variable information template related to all services in the microservice client; or the standard variable information can be a variable information template related to a service to be provided by the microservice client.
[0066] In an optional embodiment, each actual variable information corresponds to a standard variable information; that is, the number of actual variable information is the same as the number of standard variable information.
[0067] For example, the validity of the variable name can be confirmed first; if yes, the variable format and the variable value and the like are further confirmed; if the variable name is invalid, it is directly determined that the actual variable information is abnormal.
[0068] S203, according to the checking result of the actual variable information, the checking result of the microservice client is determined.
[0069] For example, if the checking result of the actual variable information is that the checking is passed, it can be directly determined that the checking result of the microservice client is normal, and at this time the microservice client can be online; if the checking result of the actual variable information is that the checking is not passed, it can be determined that the checking result of the microservice client is abnormal, and at this time the microservice client can be suspended online, and the logic code of the microservice client is further modified and adjusted.
[0070] The above microservice checking method, by checking the actual variable information related to the microservice client based on the standard variable information of the microservice client when the microservice client is started, the checking of the microservice client is realized. Since the actual variable information related to the microservice client includes variable information related to all interfaces in the entire architecture of the microservice, by introducing the checking process of the actual variable information related to the microservice client, the checking of all interfaces in the entire architecture of the microservice can be realized, and the checking of the functions related to the microservice can also be realized, that is, the checking of the entire architecture of the microservice is realized, and finally the normal use of the microservice after online is ensured, and the stability of the overall architecture of the microservice is strengthened.
[0071] On the basis of the above-mentioned embodiments, the embodiment of the application explains the above-mentioned embodiment S201 in detail. Optionally, a realizable manner for acquiring the actual variable information involved by the microservice client from the microservice client locally is to dispatch a scanning tool to scan the logic code locally of the microservice client to obtain the actual variable information involved by the microservice client.
[0072] Illustratively, the dependency relationship between all services in the microservice client can be acquired in advance, so that the logic code (code block or code unit, etc.) corresponding to the above-mentioned dependency relationship can be prepared in advance. Further, a scanning tool, such as a tool based on spring annotation, is directly called to scan the logic code prepared in advance, so as to obtain the actual variable information involved by the microservice client.
[0073] In the embodiment of the application, the scanning tool is called to acquire the actual variable information involved by the microservice client in real time, which lays a data foundation for realizing accurate verification of the microservice.
[0074] On the basis of the above-mentioned embodiments, the embodiment of the application explains the above-mentioned embodiment S202 in detail. Optionally, the process of verifying the actual variable information according to the standard variable information of the microservice client in the embodiment of the application can include the following steps:
[0075] S301, acquiring the standard variable information of the microservice client according to the session identifier of the microservice client.
[0076] The session identifier is created according to the service involved by the microservice client, and can be an account, a business code, a user code, etc. Optionally, the session identifier can be mapped to the specific service to be provided by the microservice client. It should be noted that one microservice client can create one or more session identifiers. The session identifier can be used to realize high-concurrency security control and realize multiple accesses of a single service.
[0077] A realizable manner is that the microservice client locally stores the standard variable information of the microservice client, and then the standard variable information of the microservice client can be directly acquired from the microservice client locally while the microservice client establishes a session and generates a session identifier according to the service to be provided.
[0078] Another realizable manner is to send a parameter request carrying the session identifier of the microservice client to the server; wherein the parameter request is used to request the server to acquire the standard variable information of the microservice client based on the session identifier of the microservice client; and receive the standard variable information of the microservice client fed back by the server.
[0079] Exemplarily, the server in the embodiments of the present application can include a variable library, and the variable library is used to store a large number of standard variable information related to micro-service clients. Further, the variable library can be associated with the storage of the session identifier and the standard variable information corresponding to each micro-service client.
[0080] Further, in the case of having the standard variable information acquisition requirement, a parameter request carrying the session identifier of the micro-service client can be sent to the server, so that the server indexes the session identifier of the micro-service client to find the corresponding standard variable information from the variable library. Further, the server returns the corresponding standard variable information to the terminal, so that the terminal receives the standard variable information related to the micro-service client fed back by the server.
[0081] S302, the standard variable information is compared with the actual variable information for consistency.
[0082] Optionally, the number of the actual variable information and the standard variable information can be one or more; usually, the number of the actual variable information and the standard variable information is multiple, that is, at least two.
[0083] Exemplarily, in the case that the actual variable information and the standard variable information are both multiple, each actual variable information can be compared with the corresponding standard variable information for consistency in a certain order; or, batches can be divided according to the specific number, and the actual variable information involved in each batch can be verified in parallel. That is, in each batch, the consistency comparison process of multiple actual variable information and corresponding standard variable information is performed in parallel.
[0084] Further, the consistency comparison process of each actual variable information and the corresponding standard variable information can be that the variable name, variable format and variable value in the standard variable information are compared with the variable name, variable format and variable value in the corresponding actual variable information respectively; if any information is inconsistent, it is determined that the actual variable information and the corresponding standard variable information are inconsistent.
[0085] S303, according to the consistency comparison result, the verification result of the actual variable information is determined.
[0086] Optionally, all consistency comparison results can be summarized to determine the final verification result.
[0087] One implementation manner of the embodiments of the present application is that if the number of variables in the consistency comparison result, which are consistent between the actual variable information and the corresponding standard variable information, exceeds 95% of the total number of actual variables, it is determined that the verification result of the actual variable information is verified to pass; otherwise, it is determined that the verification result of the actual variable information is verified to fail.
[0088] In another possible implementation of the embodiments of the present application, if the consistency comparison result is that each actual variable information is consistent with the corresponding standard variable information, it is determined that the checking result of the actual variable information is a checking pass; if the consistency comparison result is that there is actual variable information that is inconsistent with the standard variable information, it is determined that the checking result of the actual variable information is a checking fail.
[0089] That is, if the consistency comparison result is that each actual variable information is consistent with the corresponding standard variable information, the final checking result of all the actual variable information is a checking pass; if the consistency comparison result is that there is one or more actual variable information that is inconsistent with the standard variable information, the final checking result of all the actual variable information is a checking fail.
[0090] In the embodiments of the present application, by performing consistency comparison between the standard variable information and the actual variable information, an optional way of quickly and accurately checking the actual variable information in the microservice client is provided, which provides a basis for determining whether the microservice client can normally provide services.
[0091] On the basis of the above-described embodiments, the embodiment of the present application explains and describes the above-described embodiment S203 in detail. Optionally, the process of determining the checking result of the microservice client according to the checking result of the actual variable information in the embodiments of the present application can include the following steps, as shown in the following table. Figure 4
[0092] S401, in the case that the checking result of the actual variable information is a checking fail, determining variable modification information according to the standard variable information and the actual variable information.
[0093] For example, if the checking result of the actual variable information is a checking fail, it indicates that there is one or more actual variable information that is inconsistent with the standard variable information. At this time, the actual variable information that is inconsistent with the standard variable information can be screened out as the variable modification information. Optionally, the information that is inconsistent with the actual variable can be marked as the variable modification information. For example, the variable name of the actual variable A is invalid; the variable format of the actual variable B is invalid; the variable format and the variable value of the actual variable C are invalid, and the like.
[0094] S402, determining an early warning level according to the variable modification information.
[0095] The early warning level can be used to represent the error degree of the actual variable information involved in the microservice client, and can include a shallow early warning, a medium early warning, a high early warning, and the like. Optionally, the greater the error degree, the higher the early warning level.
[0096] In an implementation of the embodiment, according to the variable modification information, the number of variables whose actual variable information is consistent with the corresponding standard variable information is determined, if the number of variables whose actual variable information is consistent with the corresponding standard variable information exceeds 95% of the total number of actual variables, it is determined that the early warning level is a light early warning; if the number of variables whose actual variable information is consistent with the corresponding standard variable information exceeds 75% of the total number of actual variables, it is determined that the early warning level is a medium early warning; otherwise, it is determined that the early warning level is a high early warning.
[0097] In another implementation of the embodiment, according to the variable modification information, the information category (variable name, variable format, and variable value, etc.) of the variable whose actual variable information is inconsistent with the corresponding standard variable information is determined, if the variable category whose actual variable information is inconsistent with the corresponding standard variable information exceeds 75% of the total number of actual variable categories, it is determined that the early warning level is a high early warning; if the variable category whose actual variable information is consistent with the corresponding standard variable information exceeds 45% of the total number of actual variable categories, it is determined that the early warning level is a medium early warning; otherwise, it is determined that the early warning level is a light early warning.
[0098] S403, the early warning level and the variable modification information are taken as the verification result of the microservice client.
[0099] For example, based on the early warning level and the variable modification information, a verification report of the microservice client is generated, which can be taken as the verification result of the microservice client and output in the form of a pdf or a compressed package.
[0100] In the embodiment, when the verification result of the actual variable information is a verification failure, the early warning level and the variable modification information are determined, which lays a foundation for subsequent code improvement and adjustment by the staff.
[0101] Based on the above embodiment, an optional example of a microservice verification method is provided. As shown in Figure 5 the specific implementation process is as follows:
[0102] S501, in the case of detecting that the microservice client is started, the actual variable information involved in the microservice client is obtained from the local of the microservice client.
[0103] Among them, the actual variable information includes variable name information and variable value information.
[0104] Optionally, the scanning tool is dispatched to scan the logic code in the local of the microservice client to obtain the actual variable information involved in the microservice client.
[0105] S502, a parameter request carrying a session identifier of the microservice client is sent to a server.
[0106] The parameter request is used to request the server to obtain the standard variable information of the micro-service client based on the session identifier of the micro-service client.
[0107] S503, receiving the standard variable information of the micro-service client fed back by the server.
[0108] The number of the actual variable information and the number of the standard variable information are both at least two.
[0109] S504, judging whether the standard variable information is consistent with the actual variable information. If yes, that is, each actual variable information is consistent with the corresponding standard variable information, S505 is executed; if not, that is, there is actual variable information inconsistent with the standard variable information, S506-S508 are executed.
[0110] S505, determining that the checking result of the actual variable information is checking passed, and taking the text information of checking passed as the checking result of the micro-service client.
[0111] Optionally, the text information can be a pre-set standard term, such as the terms of “checking no error” or “service has no problem”.
[0112] S506, determining that the checking result of the actual variable information is checking failed, and determining variable modification information according to the standard variable information and the actual variable information.
[0113] S507, determining an early warning level according to the variable modification information.
[0114] S508, taking the early warning level and the variable modification information as the checking result of the micro-service client.
[0115] The specific process of S501-S508 can refer to the description of the above method embodiments, and the implementation principles and technical effects are similar, which will not be described here.
[0116] It should be understood that although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless explicitly stated herein, the execution of these steps has no strict sequence limitation, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0117] Based on the same inventive concept, the application further provides a microservice verification device for implementing the above-mentioned microservice verification method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more microservice verification device embodiments provided below can refer to the limitations of the microservice verification method described above, which will not be repeated here.
[0118] In one exemplary embodiment, as shown in Figure 6 a microservice verification device 1 is provided, comprising an acquisition module 10, a verification module 20 and a determination module 30, wherein:
[0119] The acquisition module 10 is configured to acquire actual variable information related to the microservice client from the microservice client locally when it is detected that the microservice client is started; wherein the actual variable information comprises variable name information and variable value information.
[0120] The verification module 20 is configured to verify the actual variable information according to the standard variable information of the microservice client.
[0121] The determination module 30 is configured to determine the verification result of the microservice client according to the verification result of the actual variable information.
[0122] In one embodiment, the acquisition module 10 is specifically configured to:
[0123] Dispatch a scanning tool to scan the logic code locally of the microservice client to obtain the actual variable information related to the microservice client.
[0124] In one embodiment, as shown in Figure 7 the verification module 20 specifically comprises:
[0125] The information acquisition unit 21 is configured to acquire the standard variable information of the microservice client according to the session identifier of the microservice client.
[0126] The comparison unit 22 is configured to compare the standard variable information with the actual variable information for consistency.
[0127] The result determination unit 23 is configured to determine the verification result of the actual variable information according to the consistency comparison result.
[0128] In one embodiment, the information acquisition unit 21 is specifically configured to:
[0129] Send a parameter request carrying the session identifier of the microservice client to the server; wherein the parameter request is used to request the server to acquire the standard variable information of the microservice client based on the session identifier of the microservice client; and receive the standard variable information of the microservice client fed back by the server.
[0130] In one embodiment, the result determining unit 23 is specifically configured to:
[0131] If the consistency comparison result is that each actual variable information is consistent with the corresponding standard variable information, it is determined that the checking result of the actual variable information is checking passed; if the consistency comparison result is that there is actual variable information inconsistent with the standard variable information, it is determined that the checking result of the actual variable information is checking failed.
[0132] In one embodiment, the determining module 30 is specifically configured to:
[0133] In the case that the checking result of the actual variable information is checking failed, the variable modification information is determined according to the standard variable information and the actual variable information; the early warning level is determined according to the variable modification information; and the early warning level and the variable modification information are taken as the checking result of the micro-service client.
[0134] Each module in the micro-service checking apparatus can be realized by software, hardware and combinations thereof in whole or in part. Each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each module.
[0135] In one exemplary embodiment, a computer device is provided, which can be a terminal, and the internal structure diagram thereof can be as shown in Figure 8The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be achieved through WIFI, mobile cellular network, NFC (Near Field Communication) or other technologies. The computer program is executed by the processor to implement a microservice verification method. The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0136] Those skilled in the art can understand that, Figure 8 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0137] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the following steps:
[0138] In the case where the microservice client is detected to be started, actual variable information involved by the microservice client is obtained locally from the microservice client; wherein the actual variable information includes variable name information and variable value information;
[0139] The actual variable information is verified according to the standard variable information of the microservice client;
[0140] The verification result of the microservice client is determined according to the verification result of the actual variable information.
[0141] In one embodiment, a scanning tool is dispatched to scan the logic code locally from the microservice client to obtain the actual variable information involved by the microservice client.
[0142] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0143] According to the session identifier of the microservice client, the standard variable information of the microservice client is obtained; the standard variable information is compared with the actual variable information for consistency; and according to the consistency comparison result, the checking result of the actual variable information is determined.
[0144] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0145] A parameter request carrying the session identifier of the microservice client is sent to the server; wherein the parameter request is used to request the server to obtain the standard variable information of the microservice client based on the session identifier of the microservice client; and the standard variable information of the microservice client fed back by the server is received.
[0146] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0147] If the consistency comparison result is that each actual variable information is consistent with the corresponding standard variable information, it is determined that the checking result of the actual variable information is that the checking passes; and if the consistency comparison result is that there is actual variable information inconsistent with the standard variable information, it is determined that the checking result of the actual variable information is that the checking fails.
[0148] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0149] In the case that the checking result of the actual variable information is that the checking fails, the variable modification information is determined according to the standard variable information and the actual variable information; the warning level is determined according to the variable modification information; and the warning level and the variable modification information are taken as the checking result of the microservice client.
[0150] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program, when executed by a processor, implements the following steps:
[0151] In the case that the microservice client is detected to be started, the actual variable information involved by the microservice client is obtained from the microservice client locally; wherein the actual variable information includes variable name information and variable value information;
[0152] The actual variable information is checked according to the standard variable information of the microservice client;
[0153] According to the checking result of the actual variable information, the checking result of the microservice client is determined.
[0154] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0155] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0156] According to the session identifier of the microservice client, the standard variable information of the microservice client is obtained; the standard variable information is compared with the actual variable information for consistency; and according to the consistency comparison result, the verification result of the actual variable information is determined.
[0157] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0158] The parameter request carrying the session identifier of the microservice client is sent to the server; wherein, the parameter request is used to request the server to obtain the standard variable information of the microservice client based on the session identifier of the microservice client; and the standard variable information of the microservice client fed back by the server is received.
[0159] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0160] If the consistency comparison result is that each actual variable information is consistent with the corresponding standard variable information, it is determined that the verification result of the actual variable information is verification passed; if the consistency comparison result is that there is actual variable information inconsistent with the standard variable information, it is determined that the verification result of the actual variable information is verification failed.
[0161] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0162] In the case that the verification result of the actual variable information is verification failed, the variable modification information is determined according to the standard variable information and the actual variable information; the warning level is determined according to the variable modification information; and the warning level and the variable modification information are taken as the verification result of the microservice client.
[0163] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0164] In the case that the microservice client is detected to be started, the actual variable information involved by the microservice client is obtained from the microservice client locally; wherein, the actual variable information includes variable name information and variable value information;
[0165] The actual variable information is verified according to the standard variable information of the microservice client;
[0166] According to the checking result of the actual variable information, the checking result of the micro-service client is determined.
[0167] In one embodiment, the scanning tool is scheduled to scan the logic code local to the micro-service client to obtain the actual variable information involved by the micro-service client.
[0168] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0169] According to the session identifier of the micro-service client, the standard variable information of the micro-service client is obtained; the standard variable information is compared with the actual variable information for consistency; and according to the consistency comparison result, the checking result of the actual variable information is determined.
[0170] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0171] A parameter request carrying the session identifier of the micro-service client is sent to the server; wherein the parameter request is used to request the server to obtain the standard variable information of the micro-service client based on the session identifier of the micro-service client; and the standard variable information of the micro-service client fed back by the server is received.
[0172] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0173] If the consistency comparison result is that each actual variable information is consistent with the corresponding standard variable information, it is determined that the checking result of the actual variable information is that the checking passes; and if the consistency comparison result is that there is actual variable information inconsistent with the standard variable information, it is determined that the checking result of the actual variable information is that the checking fails.
[0174] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0175] In the case that the checking result of the actual variable information is that the checking fails, according to the standard variable information and the actual variable information, the variable modification information is determined; according to the variable modification information, the warning level is determined; and the warning level and the variable modification information are taken as the checking result of the micro-service client.
[0176] It should be noted that the micro-service client information (including but not limited to client device information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the client or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0177] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0178] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0179] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A microservice verification method, characterized in that, The method comprises: In the case of detecting the start of the microservice client, acquiring actual variable information involved by the microservice client from the microservice client locally; wherein the actual variable information comprises variable name information and variable value information; According to the standard variable information of the microservice client, the actual variable information is checked; According to the checking result of the actual variable information, the checking result of the microservice client is determined; The actual variable information involved by the microservice client is acquired from the microservice client locally, comprising: dispatching a scanning tool to scan the logical code of the microservice client locally to obtain the actual variable information involved by the microservice client; According to the session identifier of the microservice client, the standard variable information of the microservice client is acquired; the standard variable information is compared with the actual variable information for consistency; according to the consistency comparison result, the checking result of the actual variable information is determined; The standard variable information of the microservice client is acquired according to the session identifier of the microservice client, comprising: sending a parameter request carrying the session identifier of the microservice client to the server; wherein the parameter request is used to request the server to acquire the standard variable information of the microservice client based on the session identifier of the microservice client; receiving the standard variable information of the microservice client fed back by the server.
2. The method of claim 1, wherein, The number of the actual variable information and the standard variable information is at least two; Accordingly, according to the consistency comparison result, the checking result of the actual variable information is determined, comprising: If the consistency comparison result is that each actual variable information is consistent with the corresponding standard variable information, it is determined that the checking result of the actual variable information is that the checking is passed; If the consistency comparison result is that there is actual variable information inconsistent with the standard variable information, it is determined that the checking result of the actual variable information is that the checking is failed.
3. The method of claim 1, wherein, According to the checking result of the actual variable information, the checking result of the microservice client is determined, comprising: In the case that the checking result of the actual variable information is that the checking is failed, variable modification information is determined according to the standard variable information and the actual variable information; According to the variable modification information, the warning level is determined; The warning level and the variable modification information are taken as the checking result of the microservice client.
4. A microservice verification apparatus, characterized by, The device is applied to the method in any one of claims 1 to 3, and the device comprises: An acquisition module, configured to acquire actual variable information involved by the microservice client from the microservice client locally in the case of detecting the start of the microservice client; wherein the actual variable information comprises variable name information and variable value information; A checking module, configured to check the actual variable information according to the standard variable information of the microservice client; A determining module is configured to determine a verification result of the micro-service client according to a verification result of the actual variable information. 5.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-4 when the computer program is executed by the processor. The processor implements the steps of the method of any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 3.
7. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 3. The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 3.
Citation Information
Patent Citations
Interface comparison method, micro server, computer readable storage medium and electronic equipment
CN111752847A
Micro-service interface publishing method and device, electronic equipment and storage medium
CN112965705A