CN116610405A - Method and device for controlling page state and electronic equipment - Google Patents

Method and device for controlling page state and electronic equipment Download PDF

Info

Publication number
CN116610405A
CN116610405A CN202310597800.5A CN202310597800A CN116610405A CN 116610405 A CN116610405 A CN 116610405A CN 202310597800 A CN202310597800 A CN 202310597800A CN 116610405 A CN116610405 A CN 116610405A
Authority
CN
China
Prior art keywords
state
page
target page
page state
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310597800.5A
Other languages
Chinese (zh)
Inventor
贾德森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Du Xiaoman Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing Co Ltd
Priority to CN202310597800.5A priority Critical patent/CN116610405A/en
Publication of CN116610405A publication Critical patent/CN116610405A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a method, a device and electronic equipment for controlling page states, wherein the method is used for receiving a simulated page state control request, acquiring target state data corresponding to a state code from a target interface data file according to the state code of the target page state carried in the simulated page state control request, and controlling a target page to be displayed according to the target page state data based on the target page state data. By adopting the embodiment of the application, the corresponding page state data is acquired from the interface data file by adopting different page state codes in a mode of adding different page state codes in the simulated page state request. Therefore, the interface data file does not need to be frequently modified, the problems of conflict and repetition caused by frequent modification of the interface data file are avoided, the maintenance difficulty is reduced, and the accuracy of the program page control state is improved.

Description

Method and device for controlling page state and electronic equipment
Technical Field
The present application relates to the field of software development technologies, and in particular, to a method and an apparatus for controlling a page state, and an electronic device.
Background
In the field of software development technology, an application program is generally composed of a front-end project and a back-end project. The front-end and the back-end are the same and are respectively realized by different development technologies, so that in the development stage of the application program, the front-end project and the back-end project are usually developed separately, which is helpful for improving the development efficiency.
Because the front-end item is an interface for displaying an application program to a user, and a user request is determined according to an interface element triggered by the user, the back-end item is used for responding to the user request, acquiring data from a corresponding database, maintaining the data, and generally performing logic interaction between the front-end item and the back-end item through a configured interface. However, before the front-end and back-end projects have not been intermodulated, the interface request is typically simulated by a local Mock (a test tool) service, and the page status is controlled by acquiring page status data in the interface data file corresponding to the interface.
However, since the existing Mock service has a single function, only one page state data can be responded, and if interface requests of multiple page states need to be simulated, interface data files corresponding to interfaces need to be frequently and manually changed. This easily results in data collision and duplication, increases maintenance difficulty, and affects the accuracy of the control state of the application page.
Disclosure of Invention
In view of the above, the embodiments of the present application provide a method, an apparatus, and an electronic device for controlling a page status, so as to solve the problem of conflict existing in the existing page status control.
In a first aspect, an embodiment of the present application provides a method for controlling a page status, where the method includes:
receiving a simulated page state control request, wherein the simulated page state control request carries a state code of a target page state;
acquiring target page state data corresponding to the state code from a target interface data file according to the state code of the target page state;
and controlling the target page to be displayed according to the target page state data based on the target page state data.
With reference to the first aspect, in a second possible embodiment, the simulated page status control request is obtained in advance by:
and adding the state code of the target page state to the original address information of the target page to obtain the simulated page state control request.
With reference to the first aspect, in a third possible embodiment, the target interface data file stores state enumeration values of different page states in advance, where the different state enumeration values correspond to different page state data, and the method further includes:
determining a state enumeration value of a target page state corresponding to the state code of the target page state according to the corresponding relation between the state code of the page state and the state enumeration value of the page state;
and determining target page state data corresponding to the target page state enumeration value based on the state enumeration value of the target page state.
With reference to the first aspect, in a fourth possible embodiment, the simulated page state control request is parsed, and a state code of the target page state is obtained according to a preset filtering condition.
With reference to the second possible embodiment of the first aspect, in a fifth possible embodiment, the method further includes:
receiving a state code of a new target page state input by a user, and adding the state code of the new target page state to address information of the target page to generate a new simulated page state control request.
In a second aspect, an embodiment of the present application provides an apparatus for controlling a page status, where the apparatus includes:
the first receiving module is used for receiving a simulation page state control request, wherein the simulation page state control request carries a state code of a target page state;
the acquisition module is used for acquiring target page state data corresponding to the state code from a target interface data file according to the state code of the target page state;
and the page control module is used for controlling the target page to be displayed according to the target page state data based on the target page state data.
With reference to the second aspect, in a second possible embodiment, the first receiving module is further configured to:
and adding the state code of the target page state to the original address information of the target page to obtain the simulated page state control request.
With reference to the second aspect, in a third possible embodiment, the target interface data file stores state enumeration values of different page states in advance, where the different state enumeration values correspond to different page state data, and the apparatus further includes:
the first determining module is used for determining the state enumeration value of the target page state corresponding to the state code of the target page state according to the corresponding relation between the state code of the page state and the state enumeration value of the page state;
and the second determining module is used for determining target page state data corresponding to the target page state enumeration value based on the state enumeration value of the target page state.
With reference to the second aspect, in a fourth possible embodiment, the apparatus further includes:
the analysis module is used for analyzing the simulated page state control request and acquiring the state code of the target page state according to preset screening conditions.
With reference to the second possible embodiment of the second aspect, in a fifth possible embodiment, the apparatus further includes:
and the second receiving module is used for receiving a state code of a new target page state input by a user, and adding the state code of the new target page state into the address information of the target page so as to generate a new simulated page state control request.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a processor; and
a memory in which a program is stored,
wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method of controlling page status of the first aspect.
In a fourth aspect, embodiments of the present application provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of controlling page status of the first aspect.
The application has the beneficial effects that:
the application provides a method, a device and electronic equipment for controlling page states, wherein the method is used for receiving a simulated page state control request, acquiring target state data corresponding to a state code from a target interface data file according to the state code of the target page state carried in the simulated page state control request, and controlling a target page to be displayed according to the target page state data based on the target page state data. By adopting the embodiment of the application, the corresponding page state data is acquired from the interface data file by adopting different page state codes in a mode of adding different page state codes in the simulated page state request. Therefore, the interface data file does not need to be frequently modified, the problems of conflict and repetition caused by frequent modification of the interface data file are avoided, the maintenance difficulty is reduced, and the accuracy of the program page control state is improved.
The technical scheme provided by the embodiment of the application can realize the technical effect of solving the problem of low page control efficiency caused by conflict existing in the existing page state control method.
Drawings
Further details, features and advantages of the application are disclosed in the following description of exemplary embodiments with reference to the following drawings, in which:
FIG. 1 is a schematic diagram of one possible flow of a method for controlling page status according to an embodiment of the present application;
FIG. 2 is a schematic diagram of another possible flow chart of a method for controlling page status according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a possible logic structure of an apparatus for controlling page status according to an embodiment of the present application;
fig. 4 is a schematic diagram of a possible logic structure of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While the application is susceptible of embodiment in the drawings, it is to be understood that the application may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided to provide a more thorough and complete understanding of the application. It should be understood that the drawings and embodiments of the application are for illustration purposes only and are not intended to limit the scope of the present application.
It should be understood that the various steps recited in the method embodiments of the present application may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the application is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below. It should be noted that the terms "first," "second," and the like herein are merely used for distinguishing between different devices, modules, or units and not for limiting the order or interdependence of the functions performed by such devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those skilled in the art will appreciate that "one or more" is intended to be construed as "one or more" unless the context clearly indicates otherwise.
In the field of software development technology, an application program is generally composed of a front-end project and a back-end project. The front end and the back end are the same and are respectively realized by different development technologies, so that in the development stage of the application program, the front end project and the back end project are usually separated for development, and the development efficiency can be effectively improved.
Because the front-end project is an interface for displaying the application program to the user, and the user request is determined according to the interface element triggered by the user, the back-end project is used for responding to the user request, acquiring data from the corresponding database, maintaining the data, and generally, after the development of the front-end project and the back-end project is completed, logically interacting through the configured interface. Therefore, in the development process of the front-end and back-end projects, since the interfaces for performing logic interaction are not configured, development testers do not know the interfaces with specific configuration, and therefore the functions of the application program cannot be tested accurately according to the real interfaces.
Related art proposes to use Mock service to create an object that can replace an actual object (such an object that can replace an actual object is referred to herein as a simulation object for short) to simulate a real interface to test the function of an application. Since Mock can simulate the needs of various external triggers, such as databases, web services, etc. Therefore, in the case of using Mock, a developer or tester does not need to rely on external triggering requirements to test the code, which can effectively reduce the cost and time of testing.
In particular, the implementation principle of Mock can be generalized to create a virtual object in test code that is similar to a real object and provides the same interface. By using the Mock framework's API (Application Programming Interface ), a tester can define the behavior and properties of virtual objects and set desired results. When the tester calls the method of the virtual object, the Mock framework returns a corresponding result according to preset behaviors. In this way, the tester can test the code and verify its correctness without having to rely on external triggering requirements.
In Mock, there is a one-to-one correspondence between interfaces and interface data files, where the interfaces define external requirements that need to be simulated, and the interface data files contain input and output data of the corresponding interfaces. Specifically, a developer or tester can create a virtual object through an API provided by the Mock framework, where the virtual object is equivalent to simulating an external requirement, and provides a corresponding interface. The developer or tester may then use the interface data file to configure the behavior of the virtual object and the returned results to simulate the results output by the software in response to external demands.
By way of example, a front-end developer wants to simulate a first page state triggered by a user, creates a virtual object controlled by the page state through Mock, provides a corresponding first interface, and writes an output result corresponding to the first page state control in a first interface data file corresponding to the first interface. Therefore, by acquiring the state data of the first page state in the first interface data file, the first page state triggered by the user can be simulated.
Because the existing Mock service is not responsible for processing business logic or executing complex operations, the corresponding output data is only acquired from the requested parameter interface data file, and the acquired output data is returned to the front-end application program. Thus, for a request for a page state, only data for a page state is typically obtained from the interface data file. If the interface request of multiple page states needs to be simulated, the corresponding output result in the interface data file needs to be changed frequently and manually. This can easily lead to data conflicts and duplication, thereby causing the contents in the data file to become confusing, difficult to maintain, affecting the accuracy of the application page state control, and in turn severely affecting the efficiency of application development or testing.
In view of the above, the embodiments of the present application provide a method, an apparatus, and an electronic device for controlling a page status, which are used for solving the problem of conflict existing in the existing page status control. The method for controlling the page state can be applied to any electronic equipment with logic operation, including but not limited to personal mobile terminals, computers, servers and the like.
As shown in fig. 1, the method for controlling the page status provided by the embodiment of the application includes the following steps:
s11, receiving a simulated page state control request, wherein the simulated page state control request carries a state code of a target page state;
s12, acquiring target page state data corresponding to the state code from a target interface data file according to the state code of the target page state;
and S13, controlling the target page to be displayed according to the target page data based on the target page state data.
By adopting the embodiment of the application, the corresponding page state data is acquired from the interface data file by adopting different page state codes in a mode of adding different page state codes in the simulated page state request. Therefore, the interface data file does not need to be frequently modified, the problems of conflict and repetition caused by frequent modification of the interface data file are avoided, the maintenance difficulty is reduced, and the accuracy of the program page control state is improved.
The above steps S11 to S13 will be described in detail below:
in one possible embodiment, the method for controlling the page status may be applied to a Mock simulation service in an electronic device, where the steps S11 to S13 are performed by the Mock simulation service.
In performing step S11, in the embodiment of the present application, the simulated page status control request is a data request set based on Mock simulated service rules, which is similar to a request message in a conventional network communication technology, and carries information about a requested target object. Wherein in embodiments of the present application, the request may be an address information identification, such as a URL (Uniform Resource Locator ) address information identification, or other type of address information identification. Because the scheme of the embodiment of the application is applied to the simulation test stage of software development, in the embodiment of the application, the request needs to contain a simulation protocol type, a simulation host name, a simulation path, a simulation interface data file name and a state code of page state. The simulated page state control requests may be different for different simulated requirements, and the corresponding requests may be different.
In one possible embodiment, if the emulated protocol type is HTTP (HyperText Transfer Protocol) hypertext transfer protocol, the address information identifier may be an address information identifier constructed based on HTTP hypertext transfer protocol. The specific form can be as follows:
https://www.example.com/index.htmlid=123&name=John
where www.example.com is the host name of the emulated front-end item, index.html is the emulated interface data file name, and id=123 & name=john is the string of the query.
In one possible embodiment, the simulated page status control request in step S11 may be obtained in advance by:
and adding the state code of the target page state into the original address information of the target page to obtain a simulated page state control request.
Taking the HTTP request based on the URL as the analog state control request information, the state code of the target page state may be added to the query string of the corresponding URL information, that is, the status state code may be added to the query string of the URL. The obtained simulated page state control request is:
https://www.example.com/index.htmlstatus=1
the status is a status code of the page status, that is, the status code of the page status carried in the address information: status=1.
In a possible embodiment, in step S11, the new simulated page state control request may be generated by receiving a state code of a new target page state input by the user, and adding the state code of the new target page state to the address information of the target page.
In one possible embodiment, an input box may be provided to the user through a user interaction interface, in which the user may be facilitated to directly enter a status code for the desired page status. For example, if the current page state of the user is the first page state, the corresponding state code of the page state is status=1, and when the user wants to control the page state to be the second page state, the status=1 may be directly modified to status=2 in the input box, and the execution body may adaptively add the new status code to the location of the corresponding state code in the address information of the target page directly according to the new status code of the target page input by the user, so as to generate a new analog page state control request.
By adopting the embodiment of the application, the target object to be modified can be changed from the data object in the modification interface data file to only need to modify part of the sub data objects in the original address information, so that the data object in the interface data file is not needed to be manually modified, and the problem of data conflict caused by frequent manual modification of the data object in the interface data file is effectively avoided.
In a possible embodiment, the method for controlling the page status provided by the application further includes the following steps:
analyzing the simulated page state control request, and acquiring a state code of the target page state according to preset screening conditions.
The status code of the page status is added to the original address information to obtain the description content of the simulated page status control request part, and the status code of the page status is added to part of the sub-information of the original address information, such as the query character string part in the URL address information of HTTP. In order to accurately screen the state code of the target page state from the simulated page state control request, the embodiment of the application can analyze the information of each sub-part contained in the simulated page state by analyzing the simulated page state control request, and screen the state code of the target page state from the information of each sub-part based on the pre-designed screening condition.
The preset screening conditions are set based on the construction conditions of the simulated page state control request, and if the construction conditions of the simulated page state control request are different, the preset screening conditions are also different, and the application is not strictly limited. For example, if the simulated page status control request uses the query string portion as the status code of the page status, the preset filtering condition is: the status code of the page status is the content of the query string part. If the first subfield of the query string is used as the status code of the page status in the simulated page status control request, the preset screening condition is: the status code of the page status is the first subfield of the query string.
Specifically, as shown in fig. 2, the Mock service receives URL information of the analog page control request, then parses out various information contained in the URL information, screens out status code status=1 based on preset screening conditions through a request identifier filter, obtains corresponding status 1 data from the interface data file based on the status code, and returns to control the page status to be displayed according to the status 1 data. When other state data are acquired, the page state can be switched without changing the interface data file by only manually modifying the state code of the page state in the state data based on the same mode.
By analyzing the information of each part of the simulated page state control request and according to the preset screening conditions, the embodiment of the application can accurately determine the state code of the target page state from the information of each part, thereby being beneficial to further reducing the conflict problem caused by different page state codes.
In a possible embodiment, when executing step S12, state enumeration values of different page states are pre-stored in the target interface data file, where the different state enumeration values correspond to different page state data, and the method for controlling page states provided by the present application further includes the following steps:
determining a state enumeration value of a target page state corresponding to the state code of the target page state according to the corresponding relation between the state code of the page state and the state enumeration value of the page state;
and determining target page state data corresponding to the target page state enumeration value based on the state enumeration value of the target page state.
In the embodiment of the application, the state enumeration value of the page state is a set of predefined constant values, and different state enumeration values represent different states or options. Typically for replacing numbers or strings as parameters or parameter options in the target project program. In the embodiment of the application, the state enumeration value of the page state has a one-to-one correspondence with the state code of the page state, and the state enumeration value of the page state corresponding to the state code of the page state can be uniquely determined according to the known state code of the page state.
In the embodiment of the application, the enumerated value of the page state is a constant value written in the interface data file in advance, and the enumerated values of different page states represent different page states. Thus, the target state data in the interface data file can be further determined based on the state enumeration value corresponding to the state code of the target page state required to be simulated by the user. Based on the above, the embodiment of the application can directly represent different page states by means of different state enumeration values, and a user can modify the state code of the page state by himself according to the requirement, so that the page state data required to be acquired can be changed.
Based on this, when step S13 is performed, the page status may be controlled to control the page display in accordance with the received page status data based on the received page status data. For example, if the received page status data is highlighting the button1 in the page, the effect of changing the page status can be achieved by controlling the button1 in the page to be highlighted when executing step S13.
In a second aspect, the present application provides an apparatus for controlling a page status, as shown in fig. 3, the apparatus 30 includes:
the first receiving module 301 is configured to receive an analog page status control request, where the analog page status control request carries a status code of a target page status;
the acquiring module 302 is configured to acquire, according to the status code of the status of the target page, status data of the target page corresponding to the status code from the target interface data file;
the page control module 303 is configured to control, based on the target page status data, the target page to be displayed according to the target page status data.
In a possible embodiment, the first receiving module 301 is further configured to:
and adding the state code of the target page state into the original address information of the target page to obtain a simulated page state control request.
In one possible embodiment, the target interface data file stores therein page state data corresponding to state enumeration values of different page states in advance, and the apparatus 30 further includes:
a first determining module 304, configured to determine a state enumeration value of a target page state corresponding to the state code of the target page state according to a correspondence between the state code of the page state and the state enumeration value of the page state;
the second determining module 305 is configured to determine, based on the state enumeration value of the target page state, target page state data corresponding to the target state enumeration value.
In one possible embodiment, the apparatus 30 further comprises:
the parsing module 306 is configured to parse the simulated page status control request, and obtain a status code of the target page status according to a preset screening condition.
In one possible embodiment, the apparatus 30 further comprises:
the second receiving module 307 is configured to receive a status code of a new target page status input by the user, and add the status code of the new target page status to the original address information of the target page, so as to generate a new simulated page status control request.
The names of messages or information interacted between the devices in the embodiments of the present application are for illustrative purposes only and are not intended to limit the scope of such messages or information.
In a third aspect, exemplary embodiments of the present application further provide an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor for causing the electronic device to perform a method according to an embodiment of the application when executed by the at least one processor.
In a fourth aspect, the exemplary embodiments of the application also provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the application.
In a fifth aspect, the exemplary embodiments of the application also provide a computer program product comprising a computer program, wherein the computer program, when being executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the application.
Referring to fig. 4, a block diagram of an electronic device 400 that may be a server or a client of the present application will now be described, which is an example of a hardware device that may be applied to aspects of the present application. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 4, the electronic device 400 includes a computing unit 401 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In RAM 403, various programs and data required for the operation of device 400 may also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Various components in electronic device 400 are connected to I/O interface 405, including: an input unit 406, an output unit 407, a storage unit 408, and a communication unit 409. The input unit 406 may be any type of device capable of inputting information to the electronic device 400, and the input unit 406 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device. The output unit 407 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. Storage unit 404 may include, but is not limited to, magnetic disks, optical disks. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 401 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the respective methods and processes described above. For example, in some embodiments, the foregoing method of controlling page status may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 400 via the ROM 402 and/or the communication unit 409. In some embodiments, the computing unit 401 may be configured to perform the method of controlling the page state by any other suitable means (e.g. by means of firmware).
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

Claims (12)

1. A method of controlling page status, the method comprising:
receiving a simulated page state control request, wherein the simulated page state control request carries a state code of a target page state;
acquiring target page state data corresponding to the state code from a target interface data file according to the state code of the target page state;
and controlling the target page to be displayed according to the target page state data based on the target page state data.
2. The method of claim 1, wherein the simulated page state control request is derived in advance by:
and adding the state code of the target page state to the original address information of the target page to obtain the simulated page state control request.
3. The method of claim 1, wherein the target interface data file has state enumeration values for different page states pre-stored therein, the different state enumeration values corresponding to different page state data, the method further comprising:
determining a state enumeration value of a target page state corresponding to the state code of the target page state according to the corresponding relation between the state code of the page state and the state enumeration value of the page state;
and determining target page state data corresponding to the target page state enumeration value based on the state enumeration value of the target page state.
4. The method according to claim 1, wherein the method further comprises:
analyzing the simulated page state control request, and acquiring a state code of the target page state according to preset screening conditions.
5. The method according to claim 2, wherein the method further comprises:
receiving a state code of a new target page state input by a user, and adding the state code of the new target page state to address information of the target page to generate a new simulated page state control request.
6. An apparatus for controlling page status, the apparatus comprising:
the first receiving module is used for receiving a simulation page state control request, wherein the simulation page state control request carries a state code of a target page state;
the acquisition module is used for acquiring target page state data corresponding to the state code from a target interface data file according to the state code of the target page state;
and the page control module is used for controlling the target page to be displayed according to the target page state data based on the target page state data.
7. The apparatus of claim 6, wherein the first receiving module is further configured to:
and adding the state code of the target page state to the original address information of the target page to obtain the simulated page state control request.
8. The apparatus of claim 6, wherein the target interface data file has state enumeration values for different page states pre-stored therein, the different state enumeration values corresponding to different page state data, the apparatus further comprising:
the first determining module is used for determining the state enumeration value of the target page state corresponding to the state code of the target page state according to the corresponding relation between the state code of the page state and the state enumeration value of the page state;
and the second determining module is used for determining target page state data corresponding to the target page state enumeration value based on the state enumeration value of the target page state.
9. The apparatus of claim 6, wherein the apparatus further comprises:
the analysis module is used for analyzing the simulated page state control request and acquiring the state code of the target page state according to preset screening conditions.
10. The apparatus of claim 7, wherein the apparatus further comprises:
and the second receiving module is used for receiving a state code of a new target page state input by a user, and adding the state code of the new target page state into the address information of the target page so as to generate a new simulated page state control request.
11. An electronic device, comprising:
a processor; and
a memory in which a program is stored,
wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method according to any of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-5.
CN202310597800.5A 2023-05-25 2023-05-25 Method and device for controlling page state and electronic equipment Pending CN116610405A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310597800.5A CN116610405A (en) 2023-05-25 2023-05-25 Method and device for controlling page state and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310597800.5A CN116610405A (en) 2023-05-25 2023-05-25 Method and device for controlling page state and electronic equipment

Publications (1)

Publication Number Publication Date
CN116610405A true CN116610405A (en) 2023-08-18

Family

ID=87681442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310597800.5A Pending CN116610405A (en) 2023-05-25 2023-05-25 Method and device for controlling page state and electronic equipment

Country Status (1)

Country Link
CN (1) CN116610405A (en)

Similar Documents

Publication Publication Date Title
CN110221899B (en) User interface adjusting method, device and system
CN111309343B (en) Development deployment method and device
CN109726108B (en) Front-end code testing method, device, system and medium based on analog data
CN110059011A (en) Interface test method, device, medium and electronic equipment
CN106815150B (en) Server-side interface test system and method
CN114090365A (en) Method, device and equipment for performing function test by using dynamic link library
CN114417780A (en) State synchronization method and device, electronic equipment and storage medium
CN113515462A (en) Method, device, equipment and storage medium for testing
CN114546830A (en) Regression testing method, regression testing device, electronic equipment and storage medium
CN112988588B (en) Client software debugging method and device, storage medium and electronic equipment
CN112131092A (en) Page debugging method and device
CN116610405A (en) Method and device for controlling page state and electronic equipment
CN114003497A (en) Method, device and equipment for testing service system and storage medium
CN111538656B (en) Monitoring method, device and equipment for gradient inspection and storage medium
WO2021121130A1 (en) Method and apparatus for information collection, computer device, and storage medium
CN114741294A (en) Page debugging method, device, equipment and storage medium
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN114218313A (en) Data management method, device, electronic equipment, storage medium and product
CN112181802A (en) Test method and device
CN113760317A (en) Page display method, device, equipment and storage medium
CN114666258B (en) Interface testing method, device, electronic equipment and medium
CN111949248A (en) Server connection method and terminal equipment
CN113760356B (en) Differential configuration method, device, equipment and medium of program product
CN112559255B (en) Method, system, device and storage medium for testing file mount recovery
CN114237816A (en) Method, device, equipment and storage medium for acquiring dummy data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination