CN113536178B - Page data generation method and device, electronic medium and storage medium - Google Patents

Page data generation method and device, electronic medium and storage medium Download PDF

Info

Publication number
CN113536178B
CN113536178B CN202110625838.XA CN202110625838A CN113536178B CN 113536178 B CN113536178 B CN 113536178B CN 202110625838 A CN202110625838 A CN 202110625838A CN 113536178 B CN113536178 B CN 113536178B
Authority
CN
China
Prior art keywords
page
data
interceptor
page data
forgery
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.)
Active
Application number
CN202110625838.XA
Other languages
Chinese (zh)
Other versions
CN113536178A (en
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.)
Seashell Housing Beijing Technology Co Ltd
Original Assignee
Seashell Housing Beijing Technology 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 Seashell Housing Beijing Technology Co Ltd filed Critical Seashell Housing Beijing Technology Co Ltd
Priority to CN202110625838.XA priority Critical patent/CN113536178B/en
Publication of CN113536178A publication Critical patent/CN113536178A/en
Application granted granted Critical
Publication of CN113536178B publication Critical patent/CN113536178B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • 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/957Browsing optimisation, e.g. caching or content distillation

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a page data generation method, a device, electronic equipment and a storage medium, comprising the following steps: setting a first interceptor; the first interceptor is used for intercepting a page data request sent to the server by the service page end; determining whether a page data request intercepted by a first interceptor contains data forgery annotation information or not, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to a file name contained in the data forgery annotation information; and sending the page forging data to the service page end so as to enable the service page end to conduct page rendering. According to the embodiment, page data can be counterfeited locally and automatically under the condition of not depending on a server, so that the debugging and testing requirements of the page are met.

Description

Page data generation method and device, electronic medium and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for generating page data, an electronic device, and a storage medium.
Background
The data on the page of the APP is obtained from the backend server via a network request. When a page is newly added on the APP, development test work of the APP end and the server end is needed. In the development stage of a new page, an APP end engineer and a server end engineer need to agree on a protocol of page data, usually a string in Json format, the server is responsible for producing the string, and the APP end is responsible for parsing it and rendering it onto UI elements of the page. The APP end and the server end are usually developed in parallel, so that after the APP end completes the construction of the page, the server end does not need to complete the development, and the page of the APP end is free of data sources at the moment, so that the debugging and testing of the page cannot be performed, and the development can be continued after the completion of the development by the server. Therefore, data forgery (referred to as Mock hereinafter) is required to be performed without depending on a server, so as to meet the requirement of the APP end for debugging and testing by using the Mock data.
However, there are two types of Mock schemes currently in common use, the first is a stand-alone Mock data platform, which has the disadvantages: the development cost is required to be relatively high; the APP end has access cost; the APP end needs to be used in a networking way, and single-page Mock cannot be carried out, namely, if a Mock server is used, all pages can use Mock data. The second type of use of the bale plucking tool Mock, such as charles, has the disadvantage of: the bale plucking tool typically requires a high amount of expense; the APP end needs to be used in a networking way; the function supported by the bag grabbing tool is less, the data are scattered and difficult to maintain, and the mobile phone and the computer need to carry out additional configuration operation when in use.
Disclosure of Invention
Aiming at the problems existing in the prior art, the embodiment of the invention provides a page data generation method, a page data generation device, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present invention provides a method for generating page data, which is applied to a terminal device, including:
setting a first interceptor; the first interceptor is used for intercepting a page data request sent to the server by the service page end;
determining whether a page data request intercepted by a first interceptor contains data forgery annotation information or not, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to a file name contained in the data forgery annotation information;
and sending the page forging data to the service page end so as to enable the service page end to conduct page rendering.
Further, the method further comprises:
adding a tag in a page data request, wherein the attribute of the tag is an animation object;
correspondingly, determining whether the page data request intercepted by the first interceptor contains data falsification annotation information specifically includes:
and determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not based on the solicitation object in the tag.
Further, the method further comprises:
if the page data request intercepted by the first interceptor does not contain the data forgery annotation information, transmitting the page data request to the second interceptor; the second interceptor is configured to request the server to obtain page data corresponding to the page data request.
Further, the obtaining page forging data corresponding to the page data request from the local resource directory according to the file name contained in the data forging annotation information specifically includes:
and acquiring page forging data corresponding to the page data request from the json file under the local resource directory according to the json file name contained in the data forging annotation information.
In a second aspect, an embodiment of the present invention provides a page data generating apparatus, applied to a terminal device, including:
the setting module is used for setting the first interceptor; the first interceptor is used for intercepting a page data request sent to the server by the service page end;
the judging module is used for determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to the file name contained in the data forgery annotation information;
and returning a fake data module, which is used for sending the page fake data to the service page end so as to enable the service page end to conduct page rendering.
Further, the apparatus further comprises:
the configuration module is used for adding a label in the page data request, wherein the attribute of the label is an solicitation object;
correspondingly, when determining whether the page data request intercepted by the first interceptor contains the data falsification annotation information, the judging module is specifically configured to:
and determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not based on the solicitation object in the tag.
Further, the apparatus further comprises:
the transmission module is used for transmitting the page data request intercepted by the first interceptor to the second interceptor if the page data request does not contain the data forgery annotation information; the second interceptor is configured to request the server to obtain page data corresponding to the page data request.
Further, the judging module is specifically configured to, when executing obtaining the page forgery data corresponding to the page data request from the local resource directory according to the file name included in the data forgery annotation information:
and acquiring page forging data corresponding to the page data request from the json file under the local resource directory according to the json file name contained in the data forging annotation information.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the page data generating method according to the first aspect above when executing the program.
In a fourth aspect, embodiments of the present invention also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the page data generating method as described in the first aspect above.
As can be seen from the above technical solutions, in the page data generating method, apparatus, electronic device, and storage medium provided by the embodiments of the present invention, a first interceptor is set in an okhttp network library; the first interceptor is used for intercepting a page data request sent by a business page end to the server, further determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to a file name contained in the data forgery annotation information; the embodiment of the invention does not need to rely on a server, thereby utilizing the forged data to debug and test the page, and further, the embodiment of the invention can automatically forge the page data locally, thereby only needing to develop an APP end, needing not to develop and deploy a server, and having very low development cost; when an APP developer wants to forge data, the data can be forged by simply adding one piece of data forge annotation information, so that configuration and localization are truly realized, the effect of single interface forging can be achieved, the APP can be opened or closed only through simple configuration without complex operation, and meanwhile, the APP terminal can be used without a network; the forged data can be managed and maintained uniformly.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating a method for generating page data according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for generating page data according to another embodiment of the present invention;
FIG. 3 is a schematic diagram of obtaining counterfeit annotation information of data according to an embodiment of the present invention;
FIG. 4 is a diagram of obtaining counterfeit annotation information of data according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a page data generating apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a physical structure of an electronic device according to an embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention. The page data generating method provided by the invention will be explained and illustrated in detail by specific embodiments.
FIG. 1 is a flowchart illustrating a method for generating page data according to an embodiment of the present invention; as shown in fig. 1, the method includes:
step 101: setting a first interceptor; the first interceptor is used for intercepting a page data request sent to the server by the service page end.
In this step, referring to fig. 2, the respective modules in fig. 2 are explained first:
detail service page: this is a page (i.e. service page) on an APP, and the service is to display a detail data, abbreviated as detail;
mock interconnector: this is the interceptor (i.e., the first interceptor) used in this embodiment to implement one okhttp of Mock data;
call Server Interceptor: this is the interceptor built in okhttp for the request background server (i.e. the second interceptor mentioned in the subsequent embodiments).
In this step, it should be noted that, the detail service page initiates a network request to the okhttp network library according to the interface configuration statement of the detail service, where the configuration statement of the interface generally includes url of the request, a method of the request, parameters and values of the request, and the like. In this embodiment, one annotation is custom: the annotation can be used in the interface configuration statement of the service to specify the json file name under an assets directory, and the data in the data and other configuration statements are transmitted to the okhttp network library.
Step 102: and determining whether the page data request intercepted by the first interceptor contains data forgery annotation information, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to the file name contained in the data forgery annotation information.
In this step, it should be noted that after obtaining a request sent by a service, a Mock Interceptor (first Interceptor) of the okhttp network library analyzes the request to determine whether there is a data forgery annotation information of @ Mock.
If the page data request intercepted by the first Interceptor contains the data forgery annotation information, the Mock Interceptor loads the data forgery annotation information from the local resource catalog according to the json file name appointed by the @ Mock, acquires the page forgery data corresponding to the page data request, and analyzes the content of the data forgery annotation information and returns the content.
Step 103: and sending the page forging data to the service page end so as to enable the service page end to conduct page rendering.
In this step, it can be understood that the Mock interconnector returns the data parsed from the json file to the detail service page, which is the data of the Mock (i.e., the page forgery data).
Therefore, by adopting the scheme provided by the embodiment, for APP developers, only one @ Mock annotation is simply added to the page data request to use Mock data, so that the effects of collocation, localization and single-interface Mock are truly achieved.
According to the technical scheme, the page data generation method provided by the embodiment of the invention is characterized in that a first interceptor is arranged in an okhttp network library; the first interceptor is used for intercepting a page data request sent by a business page end to the server, further determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to a file name contained in the data forgery annotation information; the embodiment of the invention does not need to rely on a server, thereby utilizing the forged data to debug and test the page, and further, the embodiment of the invention can automatically forge the page data locally, thereby only needing to develop an APP end, needing not to develop and deploy a server, and having very low development cost; when an APP developer wants to forge data, the data can be forged by simply adding one piece of data forge annotation information, so that configuration and localization are truly realized, the effect of single interface forging can be achieved, the APP can be opened or closed only through simple configuration without complex operation, and meanwhile, the APP terminal can be used without a network; the forged data can be managed and maintained uniformly.
On the basis of the foregoing embodiment, in this embodiment, the method further includes:
adding a tag in a page data request, wherein the attribute of the tag is an animation object;
correspondingly, determining whether the page data request intercepted by the first interceptor contains data falsification annotation information specifically includes:
and determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not based on the solicitation object in the tag.
In this embodiment, referring to fig. 3 and fig. 4, it should be noted that the detail interface configuration statement is to add custom notes and values to the retrofit interface configuration method; mock internetpore is an interceptor of okhttp, in which this annotation and value needs to be received and then processed. However, as shown in fig. 3, the annotation information on the retrofit interface configuration method is converted into Call through CallAdapter, so that all the annotation information is lost, after the Call is executed, only one Request object remains after reaching the interceptor of the okhttp, and at this time, how to obtain the annotation information in the retrofit is a difficult problem. To solve this problem, the new characteristics of retrofit2.5 are ingeniously utilized in this embodiment: the annotation information can be simply and conveniently obtained by the aid of the solicitation; specifically, as shown in fig. 4, the OkHttpCall of retrofit adds a tag to a Request when creating a Request; the value of the tag is an invoke object, and the method of interface configuration and all notes and parameter lists are contained in the invoke object, so that in the interceptor of the okhttp, the tag of the Request object can be fetched from the invoke object only by fetching the tag. When a page is opened, a plurality of interface requests can be provided, and the page data generation method provided by the embodiment of the invention can mark which interface needs which dock to annotate, and can mark all interfaces of the page with dock, so that an APP end can independently dock a certain page.
On the basis of the above embodiment, in this embodiment, further includes:
the method further comprises the steps of:
if the page data request intercepted by the first interceptor does not contain the data forgery annotation information, transmitting the page data request to the second interceptor; the second interceptor is configured to request the server to obtain page data corresponding to the page data request.
In this embodiment, for example, referring to fig. 2, if it is determined that the page data request intercepted by the first interceptor does not include the data forgery annotation information, the page data request is transmitted to the second interceptor, for example, call Server Interceptor, that is, call Server Interceptor, where the background server is requested, and the second interceptor (Call Server Interceptor) requests the background server, and returns the acquired data to the detail service page, which is real data.
On the basis of the foregoing embodiment, in this embodiment, the obtaining, from the local resource directory, page forgery data corresponding to the page data request according to the file name included in the data forgery annotation information specifically includes:
and acquiring page forging data corresponding to the page data request from the json file under the local resource directory according to the json file name contained in the data forging annotation information.
In this implementation, it may be understood that the annotation may be used in the interface configuration statement of the service to specify a json file name under an assembly directory, where the data and the data in other configuration statements are transmitted to the okhttp network library, so as to obtain the page forging data corresponding to the page data request from the json file under the local resource directory.
For a better understanding of the present invention, the following examples are set forth to illustrate the invention, but are not to be construed as limiting the invention.
Step 1: the detail service page initiates a network request to an okhttp network library according to the interface configuration statement of the detail service, and the configuration statement of the interface generally includes url of the request, a method of the request, parameters and values of the request, and the like. In this embodiment a note is custom: the annotation can be used to specify the json file name under an assembly directory in the interface configuration statement of the service, and the data in the record and the data in other configuration statements are transmitted to the okhttp network library.
Step 2: after obtaining the request sent by the service, the Mock internetwork of the okhttp network library analyzes the request to determine whether the annotation data @ Mock exists, if not, the step 3 is carried out, and if so, the step 5 is carried out.
Step 3: if there is no annotation data @ Mock, then the Mock Interceptor does nothing and continues to call up the next Interceptor, i.e., call Server Interceptor to the requesting backend server.
Step 4: call Server Interceptor requests the background server to return the acquired data to the detail service page, which is the actual data.
Step 5: if the annotation data of @ Mock exists, the Mock internator loads the annotation data from the packages directory according to the json file name specified by @ Mock, and analyzes the content and returns the annotation data.
Step 6: the Mock interconnector returns the data parsed from the json file to the detail business page, which is the data of Mock.
Fig. 5 is a schematic structural diagram of a page data generating apparatus according to an embodiment of the present invention, as shown in fig. 5, where the apparatus includes: a setting module 201, a judging module 202 and a return falsification data module 203, wherein:
wherein, the setting module 201 is configured to set the first interceptor; the first interceptor is used for intercepting a page data request sent to the server by the service page end;
the judging module 202 is configured to determine whether the page data request intercepted by the first interceptor includes data forgery annotation information, if yes, obtain page forgery data corresponding to the page data request from a local resource directory according to a file name included in the data forgery annotation information;
and the return forging data module 203 is configured to send the page forging data to the service page end, so that the service page end performs page rendering.
On the basis of the foregoing embodiment, in this embodiment, the apparatus further includes:
the configuration module is used for adding a label in the page data request, wherein the attribute of the label is an solicitation object;
correspondingly, when determining whether the page data request intercepted by the first interceptor contains the data falsification annotation information, the judging module is specifically configured to:
and determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not based on the solicitation object in the tag.
On the basis of the foregoing embodiment, in this embodiment, the apparatus further includes:
the transmission module is used for transmitting the page data request intercepted by the first interceptor to the second interceptor if the page data request does not contain the data forgery annotation information; the second interceptor is configured to request the server to obtain page data corresponding to the page data request.
On the basis of the above embodiment, in this embodiment, when the judging module obtains, from the local resource directory, page forgery data corresponding to the page data request according to the file name included in the data forgery annotation information, the judging module is specifically configured to:
and acquiring page forging data corresponding to the page data request from the json file under the local resource directory according to the json file name contained in the data forging annotation information.
The page data generating device provided by the embodiment of the invention can be particularly used for executing the page data generating method of the embodiment, and the technical principle and the beneficial effects of the page data generating device are similar, and the page data generating device can be particularly referred to the embodiment and is not repeated here.
Based on the same inventive concept, an embodiment of the present invention provides an electronic device, referring to fig. 6, including the following details: a processor 301, a memory 302, a communication interface 303, and a communication bus 304;
wherein, the processor 301, the communication interface 303 and the memory 302 complete the communication with each other through the communication bus 304; the communication interface 303 is used for realizing information transmission between the modeling software and related devices such as an intelligent manufacturing equipment module library; the processor 301 is configured to invoke a computer program in the memory 302, and when the processor executes the computer program, the method provided by the above method embodiments is implemented, for example, when the processor executes the computer program, the following steps are implemented: setting a first interceptor; the first interceptor is used for intercepting a page data request sent to the server by the service page end; determining whether a page data request intercepted by a first interceptor contains data forgery annotation information or not, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to a file name contained in the data forgery annotation information; and sending the page forging data to the service page end so as to enable the service page end to conduct page rendering.
Based on the same inventive concept, a further embodiment of the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the method provided by the above-described method embodiments, for example, to set a first interceptor; the first interceptor is used for intercepting a page data request sent to the server by the service page end; determining whether a page data request intercepted by a first interceptor contains data forgery annotation information or not, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to a file name contained in the data forgery annotation information; and sending the page forging data to the service page end so as to enable the service page end to conduct page rendering.
The apparatus embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solutions may be embodied essentially or in part in the form of a software product, which may be stored in a computer-readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the various embodiments or methods of some parts of the embodiments.
Furthermore, in the present disclosure, such as "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Moreover, in the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
Furthermore, in the description herein, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for generating page data, which is applied to a terminal device, comprising:
when a page data request is newly built, adding a tag in the page data request, wherein the attribute of the tag is an animation object; the solicitation object comprises an interface configuration method, an interface annotation and a parameter list;
intercepting a page data request sent to a server by a service page end through a first interceptor, wherein the first interceptor is arranged in a network library;
determining whether a page data request intercepted by a first interceptor contains data forgery annotation information or not, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to a file name contained in the data forgery annotation information; when a page is opened, a tag in a page data request is taken out through a first interceptor, and a corresponding dock interface is obtained through the tag so as to independently dock a certain page;
and sending the page forging data to the service page end so as to enable the service page end to conduct page rendering.
2. The page data generation method according to claim 1, characterized in that the method further comprises:
the method for determining whether the page data request intercepted by the first interceptor contains data falsification annotation information specifically comprises the following steps:
and determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not based on the solicitation object in the tag.
3. The page data generation method according to claim 1, characterized in that the method further comprises:
if the page data request intercepted by the first interceptor does not contain the data forgery annotation information, transmitting the page data request to the second interceptor; the second interceptor is configured to request the server to obtain page data corresponding to the page data request.
4. The method for generating page data according to claim 1, wherein the step of acquiring page forgery data corresponding to the page data request from a local resource directory based on the file name included in the data forgery annotation information specifically includes:
and acquiring page forging data corresponding to the page data request from the json file under the local resource directory according to the json file name contained in the data forging annotation information.
5. A page data generating apparatus, characterized by being applied to a terminal device, comprising:
the configuration module is used for adding a label in the page data request, wherein the attribute of the label is an solicitation object; the animation object comprises an interface configuration method and all annotation and parameter lists;
the setting module is used for setting the first interceptor; the first interceptor is used for intercepting a page data request sent to the server by the service page end;
the judging module is used for intercepting a page data request sent to the server by the service page end through the first interceptor, determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not, if so, acquiring page forgery data corresponding to the page data request from a local resource directory according to a file name contained in the data forgery annotation information; when a page is opened, a tag in a page data request is taken out through a first interceptor, and a corresponding dock interface is obtained through the tag so as to independently dock a certain page;
and returning a fake data module, which is used for sending the page fake data to the service page end so as to enable the service page end to conduct page rendering.
6. The page data generating apparatus according to claim 5, wherein the apparatus further comprises:
the judging module is specifically configured to, when determining whether the page data request intercepted by the first interceptor includes data forgery annotation information:
and determining whether the page data request intercepted by the first interceptor contains data forgery annotation information or not based on the solicitation object in the tag.
7. The page data generating apparatus according to claim 5, wherein the apparatus further comprises:
the transmission module is used for transmitting the page data request intercepted by the first interceptor to the second interceptor if the page data request does not contain the data forgery annotation information; the second interceptor is configured to request the server to obtain page data corresponding to the page data request.
8. The apparatus according to claim 5, wherein the judging module, when executing the acquisition of the page-forgery data corresponding to the page data request from the local resource directory based on the file name included in the data-forgery-annotation information, is specifically configured to:
and acquiring page forging data corresponding to the page data request from the json file under the local resource directory according to the json file name contained in the data forging annotation information.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the page data generation method of any of claims 1 to 4 when the program is executed.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the steps of the page data generation method of any of claims 1 to 4.
CN202110625838.XA 2021-06-04 2021-06-04 Page data generation method and device, electronic medium and storage medium Active CN113536178B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110625838.XA CN113536178B (en) 2021-06-04 2021-06-04 Page data generation method and device, electronic medium and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110625838.XA CN113536178B (en) 2021-06-04 2021-06-04 Page data generation method and device, electronic medium and storage medium

Publications (2)

Publication Number Publication Date
CN113536178A CN113536178A (en) 2021-10-22
CN113536178B true CN113536178B (en) 2024-04-12

Family

ID=78095193

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110625838.XA Active CN113536178B (en) 2021-06-04 2021-06-04 Page data generation method and device, electronic medium and storage medium

Country Status (1)

Country Link
CN (1) CN113536178B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138448A (en) * 2014-06-05 2015-12-09 北京畅游天下网络技术有限公司 Method and device for page test at front end
AU2017204416A1 (en) * 2011-01-27 2017-07-20 Amplifier Marketing Pty Limited Method and system for providing content
CN106970873A (en) * 2017-01-10 2017-07-21 阿里巴巴集团控股有限公司 Mock method of testings, apparatus and system on line
CN107368405A (en) * 2016-05-11 2017-11-21 腾讯科技(北京)有限公司 Test system, method of testing, mock platforms, blocker and client
CN110008117A (en) * 2019-03-12 2019-07-12 深圳壹账通智能科技有限公司 Page test method, device, computer equipment and storage medium
CN111597110A (en) * 2020-04-27 2020-08-28 五八有限公司 Page testing method and device, electronic equipment and storage medium
CN112131118A (en) * 2020-09-25 2020-12-25 平安国际智慧城市科技股份有限公司 Mock testing method, Mock testing device, electronic equipment and computer readable storage medium
CN112487324A (en) * 2020-10-28 2021-03-12 贝壳技术有限公司 Page generation method and device, electronic medium and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2017204416A1 (en) * 2011-01-27 2017-07-20 Amplifier Marketing Pty Limited Method and system for providing content
CN105138448A (en) * 2014-06-05 2015-12-09 北京畅游天下网络技术有限公司 Method and device for page test at front end
CN107368405A (en) * 2016-05-11 2017-11-21 腾讯科技(北京)有限公司 Test system, method of testing, mock platforms, blocker and client
CN106970873A (en) * 2017-01-10 2017-07-21 阿里巴巴集团控股有限公司 Mock method of testings, apparatus and system on line
CN110008117A (en) * 2019-03-12 2019-07-12 深圳壹账通智能科技有限公司 Page test method, device, computer equipment and storage medium
CN111597110A (en) * 2020-04-27 2020-08-28 五八有限公司 Page testing method and device, electronic equipment and storage medium
CN112131118A (en) * 2020-09-25 2020-12-25 平安国际智慧城市科技股份有限公司 Mock testing method, Mock testing device, electronic equipment and computer readable storage medium
CN112487324A (en) * 2020-10-28 2021-03-12 贝壳技术有限公司 Page generation method and device, electronic medium and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Experimental study on the preload and afterload responses of a pneumatic mock right ventricle;Feng Huang 等;《2019 IEEE 8th international conference on fluid power and mechatronics》;第1-2页 *
自动化测试技术中mock框架的建设与应用;孟燕 等;《武汉理工大学学报》;第39卷(第3期);第364-367页 *

Also Published As

Publication number Publication date
CN113536178A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
Tao et al. A reusable software component for integrated syntax and semantic validation for services computing
US10185546B2 (en) Service extraction and application composition
CN110221968A (en) Method for testing software and Related product
US20090282136A1 (en) Automatic Generation of Web Service client for Web Services Interoperability Testing
US20040128584A1 (en) Method and system for determining computer software test coverage
CN109684607B (en) JSON data analysis method and device, computer equipment and storage medium
CN108459850B (en) Method, device and system for generating test script
CN108156022A (en) A kind of service calling method, device and electronic equipment
US10452522B1 (en) Synthetic data generation from a service description language model
CN105051687B (en) Using dispositions method and equipment
CN101946248A (en) Method and apparatus for providing API service and making API mash-up, and computer readable recording medium thereof
CN106412034B (en) Method for processing business and device
CN107870989A (en) webpage generating method and terminal device
CN111597110B (en) Page test method and device, electronic equipment and storage medium
US20110161063A1 (en) Method, computer program product and apparatus for providing an interactive network simulator
US9021456B2 (en) Using collaborative annotations to specify real-time process flows and system constraints
CN113227976A (en) Methods, systems, and computer readable media for data transformation using representational state transfer (REST) Application Programming Interfaces (APIs)
CN109298900A (en) A kind of application fractionation and on-demand loading method, apparatus
CA2846581A1 (en) Data infrastructure for providing interconnectivity between platforms, devices and operating systems
US8341212B2 (en) Service description refinement based on actual service use
US8972487B2 (en) Automated framework for testing enterprise services consumer technologies
CN102662838B (en) The adjustment method of Flash and system in a kind of browser
CN109582317A (en) Method and apparatus for debugging boarding application
CN104461893B (en) Data processing method and data processing equipment
CN113536178B (en) Page data generation method and device, electronic medium and storage medium

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
TA01 Transfer of patent application right

Effective date of registration: 20240129

Address after: Room 102, 1st Floor, Building 1, No. 2 Chuangye Road, Haidian District, Beijing, 100080

Applicant after: Seashell Housing (Beijing) Technology Co.,Ltd.

Country or region after: China

Address before: 101309 room 24, 62 Farm Road, Erjie village, Yangzhen, Shunyi District, Beijing

Applicant before: Beijing fangjianghu Technology Co.,Ltd.

Country or region before: China

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant