Grayscale environment inspection method and device, electronic equipment, medium and product
By carrying the grayscale logo in the inspection request and using the Puppeteer and Node.js platforms to simulate access, the high-cost problem caused by the reliance on manual labor and API tools for grayscale environment inspections in the existing technology is solved, and automated inspections are realized and improved. for efficiency and convenience.
Patent Information
- Application Number
- CN202410749942.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-10
AI Technical Summary
Existing grayscale environment inspection methods rely on manual modification or API tools, resulting in high manpower and time costs and low efficiency.
By carrying the grayscale identifier in the inspection request, the Puppeteer and Node.js platforms are used to simulate access to the grayscale environment, realize automated inspection, and simplify the inspection process of the grayscale environment.
There is no need for users to manually modify or execute inspection requests, realizing automated inspections in grayscale environments, reducing labor and time costs, and improving inspection efficiency and convenience.
Smart Images

Figure CN118626375A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a grayscale environment inspection method, device, electronic equipment, medium and product. Background Art
[0002] In recent years, with the rapid development of the Internet, the grayscale environment plays a very important role in the software development and release process. The grayscale environment is a gray version release environment between the test environment and the production environment. This transition stage simulates the settings in the production environment, allowing developers, testers and other users to inspect software functions, environment configurations and other aspects before the software is officially launched.
[0003] Since the grayscale environment is closer to the real production environment, defects that may have been missed in the previous testing phase can be captured in the grayscale version release environment, ensuring that security vulnerabilities are not released to the production environment when the software is released.
[0004] At present, the inspection method of the gray environment usually relies on manual modification of software code or inspection of the gray environment through API (Application Programming Interface) tools such as Postman. However, this inspection method consumes a lot of manpower and time costs. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present application provides a grayscale environment inspection method, device, electronic equipment, medium and product.
[0006] According to a first aspect of any embodiment of the present application, a grayscale environment inspection method is provided, the method comprising:
[0007] According to the grayscale identifier input by the user, the grayscale identifier is set to be carried in the inspection request; wherein the grayscale identifier is used to access the grayscale environment corresponding to the inspection request; the inspection request includes at least one of the following: a front-end inspection request and a back-end inspection request;
[0008] The inspection request carrying the grayscale identifier is accessed, and the grayscale environment corresponding to the inspection request is inspected.
[0009] According to a second aspect of any embodiment of the present application, a grayscale environment inspection device is provided, the device comprising:
[0010] A grayscale identification setting module is used to set the grayscale identification to be carried in the inspection request according to the grayscale identification input by the user; wherein the grayscale identification is used to access the grayscale environment corresponding to the inspection request; the inspection request includes at least one of the following: a front-end inspection request and a back-end inspection request;
[0011] The grayscale environment inspection module is used to access the inspection request carrying the grayscale identifier and inspect the grayscale environment corresponding to the inspection request.
[0012] According to a third aspect of any embodiment of the present application, there is provided an electronic device, including:
[0013] processor;
[0014] a memory for storing processor-executable instructions;
[0015] The processor implements the method described in any embodiment of the present application by running the executable instructions.
[0016] According to a fourth aspect of any embodiment of the present application, a computer program product is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the method described in any embodiment of the present application is implemented.
[0017] The technical solution provided by this application may have the following beneficial effects:
[0018] According to the above embodiments, by setting the inspection request to carry the grayscale identifier according to the grayscale identifier input by the user, accessing the inspection request carrying the grayscale identifier, and inspecting the grayscale environment corresponding to the inspection request, since the set inspection request carries the grayscale identifier, accessing the inspection request can automatically access the grayscale environment corresponding to the inspection request, without the need for the user to manually modify or manually execute the inspection request, thereby solving the inconvenience of manual inspection, and thus realizing the automated inspection of the grayscale environment simply and conveniently.
[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0021] Figure 1 is a flow chart of a grayscale environment inspection method according to an exemplary embodiment of the present application;
[0022] Figure 2It is a structural schematic diagram of an inspection platform according to an exemplary embodiment of the present application;
[0023] Figure 3 is an interactive diagram of a grayscale environment inspection method according to an exemplary embodiment of the present application;
[0024] Figure 4 is a structural schematic diagram of an electronic device according to an exemplary embodiment of the present application;
[0025] Figure 5 It is a block diagram of a grayscale environment inspection device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0026] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0027] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0028] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0029] Currently, the common inspection methods for grayscale environments rely on manual modification of software codes or inspection of grayscale environments through API tools, which consumes a lot of manpower and time costs.
[0030] In order to solve the above problems, the present application proposes a grayscale environment inspection method. Before introducing the grayscale environment inspection method, in order to make the description of the method easier to understand, some concepts involved in the subsequent description of the embodiments of the present application are first explained:
[0031] 1)Node
[0032] Node is a JavaScript runtime environment based on the Chrome V8 engine. It uses an event-driven and non-blocking I / O (Input / Output) model, provides Node services built on the Node.js platform, and can process requests from clients such as web browsers and mobile applications, execute corresponding business logic, and return responses.
[0033] 2) Puppeteer
[0034] Puppeteer is a Node.js library that provides a high-level API to control headless Chrome through the DevTools protocol. Puppeteer has the functions of obtaining browser page DOM nodes, network requests and responses, programmatically manipulating page behaviors, performing page performance monitoring and optimization, and obtaining browser page screenshots.
[0035] 3) Puppeteer Pool
[0036] Puppeteer Pool is a tool for managing and reusing Puppeteer instances. Puppeteer Pool can optimize resource allocation when using Puppeteer and avoid performance issues caused by opening too many pages at the same time.
[0037] To further illustrate the present application, the following examples are provided:
[0038] See also Figure 1 , Figure 1 It is a flow chart of a grayscale environment inspection method shown in the present application according to an exemplary embodiment. The grayscale environment inspection method can be applied to the inspection platform.
[0039] To further explain the inspection platform, Figure 2 The schematic diagram of the structure of an inspection platform is shown. The inspection platform comprises: an inspection platform front end 21 and an inspection platform back end 22. The inspection platform front end 21 is used to display and receive information required for the inspection of the grayscale environment through the interface of the inspection platform front end 21.
[0040] The inspection platform backend 22 is used to process the logic required for the inspection grayscale environment. The inspection platform backend 22 includes one or more Puppeteer instances, which are used to simulate the state of the grayscale environment of a real browser accessing the software frontend.
[0041] It can be understood that the structure of the inspection platform shown in the present application is only an example. An inspection platform that only includes the inspection platform backend 22 can also be used to receive the information required for the inspection grayscale environment input by the user through command line parameters, API interface, etc. As long as the inspection platform can implement the method described in the embodiments of the present application, the embodiments of the present application do not impose any restrictions on this.
[0042] Please continue reading Figure 1 The grayscale environment inspection method may include the following steps:
[0043] Step 102: according to the grayscale identifier input by the user, set the inspection request to carry the grayscale identifier; wherein the grayscale identifier is used to access the grayscale environment corresponding to the inspection request; the inspection request includes at least one of the following: a front-end inspection request and a back-end inspection request.
[0044] In this step, the user can input the grayscale identifier through the interface of the inspection platform front end 21. The inspection platform back end 22 determines the fixed key corresponding to the grayscale identifier in the preset field in the inspection request based on the grayscale identifier input by the user, and sets the value corresponding to the fixed key to the grayscale identifier.
[0045] The grayscale identifier and the fixed key are data preset by the developer, and may be characters, numbers, etc. The grayscale identifier is used to access the grayscale environment corresponding to the inspection request, and the fixed key is used to identify the grayscale identifier carried in the inspection request.
[0046] The preset field is used to carry the grayscale identifier, which may be a header, cookie, etc. in the inspection request, or a custom field pre-set by the developer in the inspection request. The embodiment of the present application does not impose any restrictions on this.
[0047] Taking the preset field as header as an example, the grayscale identifier input by the user through the interface of the inspection platform front end 21 is "xxx", and the fixed key corresponding to the grayscale identifier is "TAL-XXX-HEADER". The inspection platform back end 22 can use the setExtraHTTPHeaders event in Puppeteer to set the value corresponding to the fixed key "TAL-XXX-HEADER" to the grayscale identifier "xxx".
[0048] Taking the preset field as cookie as an example, the grayscale identifier input by the user through the interface of the inspection platform front end 21 is "xxx", and the fixed key corresponding to the grayscale identifier is "TAL-XXX-HEADER". The inspection platform back end 22 can use the setCookie event in Puppeteer to set the value corresponding to the fixed key "TAL-XXX-HEADER" to the grayscale identifier "xxx".
[0049] Software includes: software front-end and software back-end. Software front-end refers to the web page of software located in browser, APP and other applications, and software back-end refers to the software's server, database and other components.
[0050] Inspection requests are requests for inspections of business, security, and configuration in the grayscale environment of the software. Inspection requests include at least one of the following: front-end inspection request and back-end inspection request.
[0051] The front-end inspection request is a front-end request carrying a grayscale mark, and the back-end inspection request is a back-end request carrying a grayscale mark. The front-end request is a request for accessing the software front-end simulated by the inspection platform back-end 22, and the back-end request is a request for accessing the software back-end corresponding to the front-end request. The back-end request is used to respond to and execute the processing logic corresponding to the front-end request.
[0052] The inspection platform backend 22 can set the grayscale flag to be carried in the frontend request to obtain the frontend inspection request, and does not set the grayscale flag to be carried in the backend request.
[0053] Or, do not set the grayscale flag in the front-end request, set the grayscale flag in the back-end request, and obtain the back-end inspection request.
[0054] Or, set the front-end request to carry a grayscale flag, and set the back-end request to carry a grayscale flag, to obtain a front-end inspection request and a back-end inspection request.
[0055] Step 104: Access the inspection request carrying the grayscale identifier, and inspect the grayscale environment corresponding to the inspection request.
[0056] In this step, the inspection platform backend 22 can call the Puppeteer tool through the Node service to simulate access to the inspection request carrying the grayscale identifier in the inspection platform.
[0057] Since the inspection request carries a grayscale identifier, the inspection request initiated by the inspection platform simulation can access the grayscale environment corresponding to the inspection request, simulate the state of the grayscale environment of the real access software, and thus inspect the grayscale environment corresponding to the inspection request.
[0058] If the front-end request is set to carry the grayscale flag and the back-end request is set not to carry the grayscale flag, the front-end inspection request initiated by the inspection platform can access the grayscale environment of the software front-end. Since the back-end request does not carry the grayscale flag, the back-end request can access the production environment of the software back-end.
[0059] If the front-end request is set not to carry the grayscale flag, and the back-end request is set to carry the grayscale flag, the back-end inspection request initiated by the inspection platform can access the grayscale environment of the software backend. Since the front-end request does not carry the grayscale flag, the front-end request can access the production environment of the software front-end.
[0060] If the front-end inspection request is set to carry a grayscale flag, and the back-end inspection request is set to carry a grayscale flag, the front-end inspection request initiated by the inspection platform can access the grayscale environment of the software front-end, and the back-end inspection request can access the grayscale environment of the software back-end.
[0061] By accessing the inspection request carrying the grayscale identifier, the grayscale environment corresponding to the inspection request is inspected. While supporting the inspection of the grayscale environment of the software front-end and the grayscale environment of the software back-end, it also supports the inspection of the production environment of the software front-end and the grayscale environment of the software back-end, as well as the inspection of the grayscale environment of the software front-end and the production environment of the software back-end, meeting the user's needs for inspection in different inspection scenarios and improving the applicability of grayscale environment inspection.
[0062] It can be understood that whether to set the grayscale flag in the front-end request and whether to set the grayscale flag in the back-end request can be based on the inspection strategy preset in the inspection platform or the inspection platform can adopt the inspection strategy received from the user. The embodiments of the present application do not limit this.
[0063] The inspection method for a grayscale environment in the present embodiment performs an inspection on the grayscale environment corresponding to the inspection request by setting the grayscale identifier in the inspection request according to the grayscale identifier input by the user, accessing the inspection request carrying the grayscale identifier, and inspecting the grayscale environment corresponding to the inspection request. Since the set inspection request carries the grayscale identifier, accessing the inspection request can automatically access the grayscale environment corresponding to the inspection request, without the need for the user to manually modify or manually execute the inspection request, thereby solving the inconvenience of manual inspection and realizing automated inspection of the grayscale environment simply and conveniently.
[0064] In the above embodiment, it is introduced that the grayscale environment corresponding to the inspection request is inspected by accessing the inspection request carrying the grayscale identifier. In the following embodiment, how to access the inspection request carrying the grayscale identifier is described in more detail and can be applied to any of the above embodiments.
[0065] In one embodiment, the user can set the inspection device information through the interface of the inspection platform front end 21. The inspection platform back end 22 uses Puppeteer Pool to create a corresponding number of Puppeteer instances according to the number of simulated inspection devices corresponding to the inspection device information.
[0066] The number of Puppeteer instances is the number of simulated inspection devices that need to be inspected. In each Puppeteer instance, only one simulated inspection device is simulated in the grayscale environment.
[0067] The inspection platform backend 22 creates a simulated inspection device corresponding to each set of inspection device information set by the user in each Puppeteer instance.
[0068] The interface of the inspection platform front end 21 can display multiple simulated inspection devices at the same time. The inspection platform back end 22 accesses the inspection request in each simulated inspection device of the inspection platform and inspects the grayscale environment corresponding to the inspection request.
[0069] Among them, the inspection device information is used to set the display information of the simulated inspection device, such as: the screen size (width and height) of the simulated inspection device, whether to scale the display (deviceScaleFactor method in Puppeteer), and horizontal or vertical screen display (isLandscape method in Puppeteer).
[0070] The simulated inspection device is used to simulate the inspection of the grayscale environment on a real device, such as iPad, iPhone, Kindle Fire HDX, etc.
[0071] As described above, based on the inspection device information set by the user, a simulated inspection device corresponding to the inspection device information is created, the inspection request is accessed in each simulated inspection device, and the grayscale environment corresponding to the inspection request is inspected. Since the simulated inspection device is created based on the inspection device information customized by the user, while supporting a one-time inspection of the grayscale environment of each simulated inspection device, the adaptability of the software's grayscale environment to different simulated inspection devices is improved, further improving the inspection coverage.
[0072] In one embodiment, the inspection platform may provide a preset inspection device template of a simulated inspection device, so that the user can directly create a simulated inspection device by selecting the inspection device template.
[0073] The user can select the inspection device template through the interface of the inspection platform front end 21, and the inspection platform back end 22 uses Puppeteer Pool to create a corresponding number of Puppeteer instances according to the number of simulated inspection devices corresponding to the inspection device template selected by the user.
[0074] The inspection platform backend 22 creates a simulated inspection device corresponding to each inspection device template selected by the user in each Puppeteer instance.
[0075] The interface of the inspection platform front end 21 can display multiple simulated inspection devices at the same time. The inspection platform back end 22 accesses the inspection request in each simulated inspection device behind the inspection platform and inspects the grayscale environment corresponding to the inspection request.
[0076] The inspection device template is used to identify fixed display information of simulated inspection devices, such as iPad display information, iPhone X display information, etc.
[0077] The inspection equipment template may be pre-set by the inspection platform, or may be stored according to the inspection equipment information frequently selected by the user, and the embodiments of the present application do not impose any restrictions on this.
[0078] As described above, by creating a simulated inspection device corresponding to the inspection device template selected by the user, accessing the inspection request in each simulated inspection device, and inspecting the grayscale environment corresponding to the inspection request, the user does not need to manually set the inspection device information, thereby further improving the efficiency and convenience of inspecting the grayscale environments of several simulated inspection devices at the same time.
[0079] In the above embodiments, it is introduced that the inspection request is accessed in each simulation inspection device, and the grayscale environment corresponding to the inspection request is inspected. In the following embodiments, how to set the grayscale identifier in the inspection request is described in more detail, and can be applied to any of the above embodiments.
[0080] In one embodiment, the user can input the front-end address of the software front-end to be inspected through the interface of the inspection platform front-end 21. The inspection platform back-end 22 receives the grayscale identifier and the front-end address input by the user, uses the front-end address input by the user as the access address of the front-end request, sets the request header information in the front-end request to carry the grayscale identifier, and obtains the front-end inspection request.
[0081] The inspection platform backend 22 accesses the access address corresponding to the front-end inspection request, and simulates opening the browser page corresponding to the front-end address in the inspection platform through Puppeteer's goto event. The inspection platform backend 22 simulates the front-end inspection request corresponding to the functions such as access button clicks and input box input in the browser page, and the grayscale environment corresponding to the inspection software front end.
[0082] The inspection platform backend 22 can also monitor the backend request in the page corresponding to the access address through the on("request") event in Puppeteer, and intercept the backend request by configuring Puppeteer's setRequestInterception to true.
[0083] Through the continue event of Puppeteer, the request header information is set to carry the grayscale flag in the intercepted backend request to obtain the backend inspection request.
[0084] The request header information is the header in the inspection request, which is used to carry the grayscale identifier. The front-end address is the access address corresponding to the page of the software front-end.
[0085] It is understandable that the inspection platform backend 22 can only set the request header information of the front-end request to carry the grayscale identifier, and not set the request header information of the back-end request to carry the grayscale identifier, thereby realizing the grayscale environment of the inspection software front-end and the production environment of the software back-end.
[0086] It is also possible to only set the request header information of the backend request to carry the grayscale flag, and not set the request header information of the frontend request to carry the grayscale flag, so as to realize the production environment of the inspection software front end and the grayscale environment of the software back end.
[0087] As described above, by using the front-end address input by the user as the access address of the front-end request, setting the request header information in the front-end request to carry the grayscale identifier, obtaining the front-end inspection request, monitoring the back-end request in the page corresponding to the access address, setting the request header information in the back-end request to carry the grayscale identifier, and obtaining the back-end inspection request, using the request header information to carry the grayscale identifier is more flexible and further improves the simplicity of the inspection grayscale environment.
[0088] In one embodiment, the inspection platform backend 22 uses the front-end address input by the user as the access address of the front-end request, and sets the session tracking data in the front-end request to carry a grayscale flag.
[0089] The inspection platform backend 22 accesses the front-end address corresponding to the front-end inspection request, and through the goto event of Puppeteer, simulates opening the browser page corresponding to the access address and the grayscale environment corresponding to the inspection software front end.
[0090] Since the session tracking data will establish a session tracking mechanism between the software front-end and the software back-end, the back-end inspection request will carry the same session tracking data as the front-end inspection request.
[0091] When the session tracking data in the front-end inspection request carries the grayscale identifier, there is no need to set the session tracking data separately for the back-end request in the page corresponding to the monitored front-end address. The session tracking data of the back-end request will also carry the grayscale identifier, and the back-end inspection request will be obtained, so as to access the back-end inspection request carrying the grayscale identifier and inspect the grayscale environment of the software back-end corresponding to the back-end inspection request.
[0092] The session tracking data is a session tracking cookie stored in the user's local device, and is used to carry the grayscale identifier carried by the front-end inspection request in the back-end inspection request.
[0093] As described above, by using the front-end address input by the user as the access address of the front-end request and setting the session tracking data in the front-end request to carry the grayscale identifier, the back-end inspection request carries the grayscale identifier in the front-end inspection request, and there is no need to set the monitored back-end inspection request again, thereby further improving the simplicity of the inspection grayscale environment.
[0094] In the above-mentioned embodiment, it is introduced that the grayscale environment corresponding to the inspection request is accessed by setting the request header information or session tracking data in the inspection request to carry the grayscale identifier. In the following embodiment, the inspection result of the grayscale environment will be described in detail and can be applied to any of the above embodiments.
[0095] In one embodiment, the inspection platform backend 22 can summarize the inspection results of the inspection requests, and can return the inspection results of the inspection requests to the user by displaying them through the interface of the inspection platform frontend 21, generating a file containing the inspection results, etc.
[0096] Among them, the inspection results are used to determine whether there are defects, safety hazards and other abnormal problems in the grayscale environment.
[0097] As described above, by returning the inspection result of the inspection request to the user, the user does not need to manually query the inspection result, which facilitates the user to quickly determine whether there is an abnormal problem in the grayscale environment, thereby improving the speed of discovering abnormal problems in the grayscale environment.
[0098] Furthermore, the inspection results of the inspection requests summarized by the inspection platform backend 22 include at least one of the following: page screenshots, front-end inspection results, and back-end inspection results.
[0099] The page screenshot is a screenshot of the access page corresponding to the front-end inspection request. The front-end inspection result is used to determine whether there is an abnormality in the front-end inspection request, and the back-end inspection result is used to determine whether there is an abnormality in the back-end inspection request.
[0100] Exemplarily, the inspection platform backend 22 can perform a screenshot operation on the page corresponding to the front-end inspection request through the screenshot event of Puppeteer to generate a page screenshot.
[0101] Through Puppeteer's on.("console") event, the results of the browser console output are summarized as the front-end inspection results.
[0102] Through Puppeteer's on.("requestfailed") event, all failed backend inspection requests are summarized as the backend inspection result.
[0103] As described above, by returning at least one of the page screenshots, front-end inspection results and back-end inspection results to the user, the user can quickly and comprehensively check the grayscale environment of the software front-end and the inspection results of the grayscale environment of the software front-end, further ensuring that there are no missed abnormal problems in the grayscale environment.
[0104] To further explain the inspection process for the grayscale environment, Figure 3 is an interactive diagram of a grayscale environment inspection method according to an exemplary embodiment of the present application. Figure 3 As shown, taking the preset field carrying the grayscale identifier in the inspection request as the request header information as an example, the inspection method for the grayscale environment may include the following steps:
[0105] Step 302: The inspection platform front end 21 receives the grayscale identifier, front end address and information required to create a simulated inspection device input by the user.
[0106] In this step, the inspection platform front end 21 receives the grayscale identifier, front end address and information required to create a simulated inspection device input by the user. The information required to create a simulated inspection device can be inspection device information or an inspection device template.
[0107] Step 304: the inspection platform front end 21 sends the grayscale identifier, the front end address and the information required to create a simulated inspection device to the inspection platform back end 22.
[0108] Step 306: The inspection platform backend 22 creates a Puppeteer instance according to the number of simulated inspection devices.
[0109] In this step, the inspection platform backend 22 uses PuppeteerPool to create a corresponding number of Puppeteer instances according to the number of simulated inspection devices to be inspected.
[0110] Step 308: The inspection platform backend 22 uses the front-end address input by the user as the access address requested by the front-end.
[0111] Step 310: The inspection platform backend 22 sets the request header information in the frontend request to carry the grayscale identifier to obtain the frontend inspection request.
[0112] Step 312: The inspection platform backend 22 accesses the page corresponding to the front-end inspection request in the simulated inspection device corresponding to each Puppeteer instance.
[0113] Step 314: the inspection platform backend 22 monitors the backend request in the page corresponding to the access address, sets the request header information in the backend request to carry the grayscale identifier, and obtains the backend inspection request.
[0114] Step 316: The inspection platform backend 22 summarizes the inspection results corresponding to the inspection request.
[0115] In this step, the inspection platform backend 22 summarizes the inspection results such as the page screenshots corresponding to the inspection request, the front-end inspection results, and the back-end inspection results.
[0116] Step 318: the inspection platform backend 22 sends the inspection result corresponding to the inspection request to the inspection platform frontend 21.
[0117] Step 320: The inspection platform front end 21 displays the inspection results to the user.
[0118] In this step, the inspection platform front end 21 displays the inspection results to the user through the interface of the inspection platform front end 21.
[0119] Figure 4 1 is a schematic diagram of a structure of an electronic device according to an exemplary embodiment of the present application. The electronic device may be, for example, a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a personal digital assistant, a server, a smart home appliance, etc. Figure 4 At the hardware level, the electronic device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include hardware required for other services. The processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it, forming a grayscale environment inspection device at the logical level. Of course, in addition to the software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0120] Figure 5 is a block diagram of a grayscale environment inspection device according to an exemplary embodiment of the present application. Figure 5 The device may include: a grayscale identification setting module 502 and a grayscale environment inspection module 504, wherein:
[0121] The grayscale identifier setting module 502 is used to set the grayscale identifier to be carried in the inspection request according to the grayscale identifier input by the user; wherein the grayscale identifier is used to access the grayscale environment corresponding to the inspection request; the inspection request includes at least one of the following: a front-end inspection request and a back-end inspection request;
[0122] The grayscale environment inspection module 504 is used to access the inspection request carrying the grayscale identifier and inspect the grayscale environment corresponding to the inspection request.
[0123] In one example, the grayscale environment inspection module 504, when used to access the inspection request carrying the grayscale identifier and inspect the grayscale environment corresponding to the inspection request, includes: creating a simulated inspection device corresponding to the inspection device information according to the inspection device information set by the user; wherein the inspection device information is used to set the display information of the simulated inspection device; accessing the inspection request in each simulated inspection device, and inspecting the grayscale environment corresponding to the inspection request.
[0124] In one example, the grayscale environment inspection module 504, when used to access the inspection request carrying the grayscale identifier and inspect the grayscale environment corresponding to the inspection request, includes: creating a simulated inspection device corresponding to the inspection device template based on the inspection device template selected by the user; accessing the inspection request in each simulated inspection device, and inspecting the grayscale environment corresponding to the inspection request.
[0125] In an example, the grayscale identifier setting module 502, when used to set the grayscale identifier in the inspection request according to the grayscale identifier input by the user, includes: using the front-end address input by the user as the access address of the front-end request; setting the request header information in the front-end request to carry the grayscale identifier to obtain the front-end inspection request; monitoring the back-end request in the page corresponding to the access address, setting the request header information in the back-end request to carry the grayscale identifier, and obtaining the back-end inspection request.
[0126] In one example, the grayscale identifier setting module 502, when used to set the grayscale identifier in the inspection request according to the grayscale identifier input by the user, includes: using the front-end address input by the user as the access address of the front-end request; setting the session tracking data in the front-end request to carry the grayscale identifier to obtain the front-end inspection request; wherein the session tracking data is used to carry the grayscale identifier carried by the front-end inspection request in the back-end inspection request.
[0127] In one example, the grayscale environment inspection module 504 is further used to return the inspection result of the inspection request to the user, and the inspection result is used to determine whether there is any abnormal problem in the grayscale environment.
[0128] In an example, the inspection result includes at least one of the following: a page screenshot, which is a screenshot of the access page corresponding to the front-end inspection request; a front-end inspection result, which is used to determine whether the front-end inspection request has the abnormal problem; a back-end inspection result, which is used to determine whether the back-end inspection request has the abnormal problem.
[0129] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0130] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0131] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including instructions. The above instructions can be executed by a processor of the inspection device for a gray environment to implement any of the methods described in the above embodiments.
[0132] The non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc., and the present application does not limit this.
[0133] In an exemplary embodiment, a computer program product including a computer program / instruction is further provided. The computer program / instruction can be executed by a processor of a patrol device for a grayscale environment to implement any of the methods described in the above embodiments.
[0134] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0135] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the inventions claimed herein. The present application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0136] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A grayscale environment inspection method, characterized in that: The method comprises: According to the grayscale identifier input by the user, the grayscale identifier is set to be carried in the inspection request; wherein the grayscale identifier is used to access the grayscale environment corresponding to the inspection request; the inspection request includes at least one of the following: a front-end inspection request and a back-end inspection request; The inspection request carrying the grayscale identifier is accessed, and the grayscale environment corresponding to the inspection request is inspected.
2. The method according to claim 1, characterized in that The accessing the inspection request carrying the grayscale identifier and inspecting the grayscale environment corresponding to the inspection request includes: According to the inspection device information set by the user, create a simulated inspection device corresponding to the inspection device information; wherein the inspection device information is used to set the display information of the simulated inspection device; The inspection request is accessed in each simulated inspection device, and the grayscale environment corresponding to the inspection request is inspected.
3. The method according to claim 1, characterized in that The accessing the inspection request carrying the grayscale identifier and inspecting the grayscale environment corresponding to the inspection request includes: According to the inspection equipment template selected by the user, create a simulated inspection equipment corresponding to the inspection equipment template; The inspection request is accessed in each simulated inspection device, and the grayscale environment corresponding to the inspection request is inspected.
4. The method according to claim 1, characterized in that: The step of setting the inspection request to carry the grayscale identifier according to the grayscale identifier input by the user includes: Using the front-end address input by the user as the access address requested by the front-end; Setting the request header information in the front-end request to carry the grayscale identifier to obtain the front-end inspection request; The backend request in the page corresponding to the access address is monitored, and the request header information in the backend request is set to carry the grayscale identifier to obtain the backend inspection request.
5. The method according to claim 1, characterized in that The step of setting the inspection request to carry the grayscale identifier according to the grayscale identifier input by the user includes: Using the front-end address input by the user as the access address requested by the front-end; Setting the session tracking data in the front-end request to carry the grayscale identifier to obtain the front-end inspection request; The session tracking data is used to carry the grayscale identifier carried by the front-end inspection request in the back-end inspection request.
6. The method according to claim 1, characterized in that The method further comprises: The inspection result of the inspection request is returned to the user, and the inspection result is used to determine whether there is an abnormal problem in the grayscale environment.
7. The method according to claim 6, characterized in that The inspection result includes at least one of the following: A page screenshot, wherein the page screenshot is a screenshot of the access page corresponding to the front-end inspection request; The front-end inspection result is used to determine whether the front-end inspection request has the abnormal problem; The backend inspection result is used to determine whether the backend inspection request has the abnormal problem.
8. A patrol device for grayscale environment, characterized in that: The device comprises: A grayscale identification setting module is used to set the grayscale identification to be carried in the inspection request according to the grayscale identification input by the user; wherein the grayscale identification is used to access the grayscale environment corresponding to the inspection request; the inspection request includes at least one of the following: a front-end inspection request and a back-end inspection request; The grayscale environment inspection module is used to access the inspection request carrying the grayscale identifier and inspect the grayscale environment corresponding to the inspection request.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 7 by running the executable instructions.
10. A computer program product having a computer program / instructions stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
