A method, apparatus, device and storage medium for virtually acquiring data
By using custom syntactic sugar to obtain data type information within the e-commerce platform and generating virtual interface request instructions, the inefficiency caused by e-commerce personnel modifying request parameters repeatedly is solved, achieving efficient data acquisition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU PINWEI SOFTWARE CO LTD
- Filing Date
- 2022-09-16
- Publication Date
- 2026-04-24
AI Technical Summary
When e-commerce personnel retrieve data from a product details page, they need to modify the request parameters one by one, resulting in low efficiency.
By obtaining the target syntactic sugar customized by the user on the preset page, parsing the target data type information, generating a virtual interface request instruction, and sending it to the server to obtain matching data.
It improves the efficiency of virtual data acquisition, allowing users to obtain the required data type directly through custom syntax sugar without having to modify the request parameters one by one, thus improving the speed and efficiency of data acquisition.
Smart Images

Figure CN115455101B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of virtual data, and more specifically, to a method, apparatus, device, and storage medium for virtually acquiring data. Background Technology
[0002] With the development of e-commerce technology, more and more products are being sold on online websites, attracting more people to shop there. Each product has its own product details page, displaying statuses such as "available," "out of stock," and "sold out." The structural logic of each product details page typically includes a status parameter to control this status. E-commerce personnel need to ensure that the product details page accurately reflects the actual product. Therefore, for popular products that may sell out quickly, e-commerce personnel need to preview the "sold out" product details page to ensure it displays correctly (whether all data types, such as images, videos, and text, are displayed correctly).
[0003] When e-commerce personnel need to obtain a large amount of different types of data from product pages, according to the setting of virtual data acquisition, they need to modify the request parameters one by one. Furthermore, they need to find different types of data during virtual data acquisition, which leads to low efficiency in virtual data acquisition. Summary of the Invention
[0004] In view of the above problems, this application is made to provide a method, apparatus, device and readable storage medium for virtual data acquisition, so as to improve the efficiency of virtual interface for data acquisition.
[0005] To achieve the above objectives, the following specific solutions are proposed:
[0006] A method for virtually acquiring data includes:
[0007] Retrieve the target syntactic sugar defined by the user under the path of the preset page;
[0008] Parse the target syntactic sugar to obtain the target data type information;
[0009] Using the target data type information as the interface input parameter, a virtual interface request instruction is generated;
[0010] Send the virtual interface request instruction to the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction.
[0011] Optionally, obtaining the target syntactic sugar customized by the user under the path of the preset page includes:
[0012] In response to the user's operation of customizing the syntactic sugar structure information in the path of the preset page, the target syntactic sugar in the path of the preset page is generated.
[0013] Optionally, before parsing the target syntactic sugar to obtain the target data type information, the process further includes:
[0014] Detect the syntactic sugar structure of the target syntactic sugar and determine whether the syntactic sugar structure conflicts with the pre-configured input parameter structures in the client;
[0015] If not, the target syntactic sugar is determined to be the target syntactic sugar to be parsed.
[0016] Optionally, the method further includes:
[0017] If the syntactic sugar structure conflicts with the pre-configured input parameter structures in the client, a prompt message indicating that the target syntactic sugar does not conform to the input parameter specifications will be displayed, allowing the user to re-enter the syntactic sugar structure information.
[0018] Optionally, the method further includes:
[0019] Parse the target syntactic sugar to obtain the target data quantity information;
[0020] Using the target data type information as interface input parameters, a virtual interface request instruction is generated, including:
[0021] Using the target data type information and the target data quantity information as interface input parameters, a virtual interface request instruction containing the quantity information is generated.
[0022] Sending the virtual interface request instruction to the server, so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction, includes:
[0023] Send a virtual interface request instruction containing the quantity information to the server, so that the server responds to the virtual interface request instruction containing the quantity information and returns the data of the target data quantity information that matches the target data type information in the virtual interface request instruction containing the target data quantity information on the preset page.
[0024] Optionally, sending the virtual interface request instruction to the server, so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction, includes:
[0025] Determine the target interface in the server that matches the target data type information in the virtual interface request instruction;
[0026] Send the virtual interface request instruction to the target interface in the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction through the target interface.
[0027] A method for virtually acquiring data, applied on the server side, includes:
[0028] Receive a virtual interface request instruction sent by the client, and in the page corresponding to the virtual interface request instruction, query the target data corresponding to the target data type information in the virtual interface request instruction. The virtual interface request instruction contains target data type information for the virtual interface to obtain data. The target data type information is obtained by parsing the target syntax sugar that the user has customized and entered in the path of the page.
[0029] The driver reads the target data through the target interface corresponding to the target data type information, and sends the target data to the client through the target interface.
[0030] A device for virtually acquiring data, applied to a client, comprising:
[0031] The syntactic sugar acquisition unit is used to acquire the target syntactic sugar that the user has defined in the path of the preset page;
[0032] The syntactic sugar parsing unit is used to parse the target syntactic sugar to obtain target data type information;
[0033] The request instruction generation unit is used to generate a virtual interface request instruction using the target data type information as the interface input parameter.
[0034] The request instruction sending unit is used to send the virtual interface request instruction to the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction.
[0035] Optionally, the syntactic sugar acquisition unit includes:
[0036] The syntactic sugar acquisition subunit is used to generate the target syntactic sugar in the path of the preset page in response to the user's operation of custom typing syntactic sugar structure information in the path of the preset page.
[0037] Optionally, the device may also include:
[0038] The syntactic sugar structure checking unit is used to check the syntactic sugar structure of the target syntactic sugar before the syntactic sugar parsing unit parses the target syntactic sugar and obtains the target data type information, and to determine whether the syntactic sugar structure conflicts with the pre-configured input parameter structure in the client. If not, the target syntactic sugar determination unit is executed.
[0039] The target syntactic sugar determination unit is used to determine that the target syntactic sugar is the target syntactic sugar to be parsed.
[0040] Optionally, the device may also include:
[0041] The prompt message display unit is used to display a prompt message indicating that the target syntactic sugar does not conform to the input parameter specification if the syntactic sugar structure conflicts with the pre-configured input parameter structure in the client.
[0042] Optionally, the device may also include:
[0043] A quantity information determination unit is used to parse the target syntactic sugar to obtain target data quantity information;
[0044] The request instruction generation unit includes:
[0045] The request instruction generation subunit is used to generate a virtual interface request instruction containing the quantity information, using the target data type information and the target data quantity information as interface input parameters.
[0046] The request instruction sending unit includes:
[0047] The request instruction sending subunit is used to send a virtual interface request instruction containing the quantity information to the server, so that the server responds to the virtual interface request instruction containing the quantity information and returns the data of the target data quantity information that matches the target data type information in the virtual interface request instruction containing the target data quantity information on the preset page.
[0048] Optionally, the request instruction sending subunit includes:
[0049] The target interface determination unit is used to determine the target interface in the server that matches the target data type information in the virtual interface request instruction.
[0050] The target interface instruction sending unit is used to send the virtual interface request instruction to the target interface in the server, so that the server responds to the virtual interface request instruction and returns data on the preset page through the target interface that matches the target data type information in the virtual interface request instruction.
[0051] A device for virtually acquiring data, applied on a server side, includes:
[0052] The request instruction receiving unit is used to receive a virtual interface request instruction sent by the client, and to query the target data corresponding to the target data type information in the virtual interface request instruction in the page corresponding to the virtual interface request instruction. The virtual interface request instruction contains target data type information for the virtual interface to obtain data. The target data type information is obtained by parsing the target syntax sugar that the user has customized and entered in the path of the page.
[0053] The target data sending unit is used to drive the target interface corresponding to the target data type information to read the target data, and send the target data to the client through the target interface.
[0054] A device for virtually acquiring data, including a memory and a processor;
[0055] The memory is used to store programs;
[0056] The processor is used to execute the program to implement the various steps of the virtual data acquisition method described above.
[0057] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for virtually acquiring data as described above.
[0058] By employing the above technical solution, this application obtains the target syntactic sugar customized by the user under a preset page path, parses the target syntactic sugar to obtain target data type information, uses the target data type information as interface input parameters, generates a virtual interface request instruction, and sends the virtual interface request instruction to the server. The server then responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction. Therefore, the target syntactic sugar is user-defined, and the target data type information of the requested data can be obtained by parsing the target syntactic sugar. This eliminates the need to modify the request parameters repeatedly when virtually retrieving multiple types of data; simply responding to the user-defined target syntactic sugar is sufficient to obtain the custom data type request parameters, thereby obtaining the requested data type and improving the efficiency of virtual data retrieval. Attached Figure Description
[0059] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0060] Figure 1 A system architecture diagram for implementing virtual data acquisition provided in the embodiments of this application;
[0061] Figure 2 A schematic diagram illustrating a process for a client to virtually acquire data, as provided in this application embodiment;
[0062] Figure 3 A schematic diagram illustrating a process for a server to virtually acquire data, as provided in an embodiment of this application;
[0063] Figure 4 A schematic diagram of a device structure for implementing virtual data acquisition for a client provided in this application embodiment;
[0064] Figure 5 A schematic diagram of a device structure for implementing virtual data acquisition on a server side, as provided in the embodiments of this application;
[0065] Figure 6 This is a schematic diagram of the structure of a device for virtually acquiring data, provided in an embodiment of this application. Detailed Implementation
[0066] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0067] Figure 1 An optional system architecture for implementing virtual data acquisition provided in the embodiments of this application, such as Figure 1 As shown, the system architecture may include: client 10 and server 20.
[0068] Specifically, client 10 can have the function of accepting user-defined input syntax sugar, and server 20 can have multiple virtual data acquisition interfaces, each corresponding to a data data type. Both client 10 and server 20 support the transmission of commands and data.
[0069] Client 10 can be used to obtain the target syntactic sugar customized by the user on a preset page, parse the target syntactic sugar to obtain the target data type information, use the target data type information as the interface input parameter, generate a virtual interface request instruction, and send the virtual interface request instruction to server 20.
[0070] The server 20 can respond to the virtual interface request instruction, read data from the preset page that matches the target data type information in the virtual interface request instruction, and return the data to the client 10.
[0071] By employing the above technical solution, this application obtains the target syntactic sugar customized by the user under a preset page path, parses the target syntactic sugar to obtain target data type information, uses the target data type information as interface input parameters, generates a virtual interface request instruction, and sends the virtual interface request instruction to the server. The server then responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction. Therefore, the target syntactic sugar is user-defined, and the target data type information of the requested data can be obtained by parsing the target syntactic sugar. This eliminates the need to modify the request parameters repeatedly when virtually retrieving multiple types of data; simply responding to the user-defined target syntactic sugar is sufficient to obtain the custom data type request parameters, thereby obtaining the requested data type and improving the efficiency of virtual data retrieval.
[0072] Next, this application embodiment will first further introduce the method of virtually acquiring data from the perspective of client 10, combined with Figure 2 The method may include:
[0073] Step S110: Obtain the target syntactic sugar customized by the user under the path of the preset page.
[0074] Specifically, the preset page can represent the page where the data requested by the user is located, and the user-defined target syntactic sugar can represent the syntactic sugar for the request information of the requested data. The user-defined target syntactic sugar under the path of the preset page can indicate that the user needs to customize the request information of the requested data under the page where the requested data is located. Therefore, obtaining the user-defined target syntactic sugar under the path of the preset page can indicate that the user has pre-configured a syntactic sugar structure that matches the virtual data retrieval in the client 10, and the client 10 responds to the user's custom input with the target syntactic sugar corresponding to this syntactic sugar structure.
[0075] The syntactic sugar structure can be customized. This syntactic sugar structure can represent the indicator information for defining virtual data acquisition. It can be any character, such as "@" or "#". The part after the character can be the request content of the requested data, such as data type information, which can include images, addresses, etc.
[0076] Step S120: Parse the target syntactic sugar to obtain the target data type information.
[0077] Specifically, the target syntactic sugar can be parsed using syntactic sugar, and the parsed result can be the request content of the data to be requested, such as the target data type information obtained by parsing the target syntactic sugar.
[0078] For example, if the target syntactic sugar is "@img", then parsing "@img" will reveal that the data type of the requested data is the image type corresponding to "img".
[0079] Step S130: Using the target data type information as the interface input parameter, generate a virtual interface request instruction.
[0080] Specifically, the virtual interface request instruction may include target data type information, and may represent an instruction to request the server 20 to return data corresponding to the target data type information.
[0081] It is understandable that by parsing the target data type information obtained from the target syntactic sugar, the interface on the server 20 that needs to communicate is determined, and instructions and data are transmitted through this interface.
[0082] Step S140: Send the virtual interface request instruction to the server 20 so that the server 20 responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction.
[0083] It is understandable that, since the target syntactic sugar is custom-made based on the pre-configured syntactic sugar structure, the target data type information obtained by parsing the target syntactic sugar is the data type information of the data requested from the server 20. Therefore, after receiving the virtual interface request instruction containing the target data type information, the server 20 can search for data that matches the target data type information in the preset page and return it to the client 10.
[0084] For example, suppose the address of the preset page is "www.abc.com", and there are product images of various products under this address. Then, if the target syntactic sugar "@img" input by the user is obtained under "www.abc.com", the target data type information of "@img" can be parsed to obtain the image type corresponding to "img". Then, the image type can be used as the input parameter of the interface to generate a virtual interface request instruction with image type information and send it to the server 20. After receiving the virtual interface request instruction, the server 20 can search for the image type data from the page corresponding to "www.abc.com" and return all the image type data to the client 10.
[0085] The virtual data acquisition method provided in this embodiment obtains the target syntactic sugar customized by the user under the path of a preset page through the client 10, parses the target syntactic sugar to obtain the target data type information, uses the target data type information as interface input parameters to generate a virtual interface request instruction, and sends the virtual interface request instruction to the server 20, so that the server 20 responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction. Therefore, the target syntactic sugar is user-defined, and the target data type information of the requested data can be obtained by parsing the target syntactic sugar. This eliminates the need to modify the request parameters repeatedly when virtually acquiring multiple types of data; simply responding to the user's customized input target syntactic sugar is enough to obtain the custom data type request parameters, thereby obtaining the requested data type, thus improving the efficiency of virtual data acquisition.
[0086] In some embodiments of this application, the process of obtaining the target syntactic sugar customized by the user under the path of the preset page in step S110 is described. This process may include:
[0087] In response to the user's operation of customizing the syntactic sugar structure information in the path of the preset page, the target syntactic sugar in the path of the preset page is generated.
[0088] Specifically, before the user customizes the syntactic sugar structure information in the path of the preset page, the client 10 has been configured with a command that matches the syntactic sugar structure of the virtual data acquisition, so that the user can customize the syntactic sugar structure information according to the pre-configured syntactic sugar structure, thereby generating the target syntactic sugar in the path of the preset page.
[0089] For example, if client 10 is pre-configured with "@" as a virtual command to retrieve data, then the user can type "@" and then customize the data type requested after "@", such as the syntactic sugar structure information "img", thereby generating the target syntactic sugar "@img".
[0090] The virtual data acquisition method provided in this embodiment generates the target syntactic sugar under the preset page path by responding to the user's operation of custom typing syntactic sugar structure information in the path of the preset page, and can quickly obtain the syntactic sugar corresponding to the virtual data acquisition required by the user.
[0091] Considering that the pre-configured syntactic sugar structure is the same as other input parameters to the server 20, which may cause parameter conflicts, some embodiments of this application further include the following process before parsing the target syntactic sugar and obtaining the target data type information in step 120:
[0092] S1. Detect the syntactic sugar structure of the target syntactic sugar and determine whether the syntactic sugar structure conflicts with the pre-configured input parameter structures in the client. If not, execute S2; if yes, execute S3.
[0093] Specifically, the pre-configured input parameter structures in client 10 can be checked, and each input parameter structure can be compared with the syntactic sugar structure one by one. If an input parameter structure is successfully compared with the syntactic sugar structure, it is determined to be a conflict. If all input parameter structures are different from the syntactic sugar structure, it is determined to be a non-conflict.
[0094] S2. Determine that the target syntactic sugar is the target syntactic sugar to be parsed.
[0095] It is understandable that when the syntactic sugar structure is different from all the pre-configured input parameter structures, the client 10 can uniquely determine that the operation being responded to is a virtual data acquisition operation based on the syntactic sugar structure, and thus determine that the target syntactic sugar is the target syntactic sugar to be parsed.
[0096] S3. Display a message indicating that the target syntactic sugar does not conform to the input parameter specification.
[0097] Specifically, if the syntactic sugar structure conflicts with the pre-configured input parameter structures in the client, a prompt message indicating that the target syntactic sugar does not conform to the input parameter specifications is displayed, allowing the user to re-enter the syntactic sugar structure information.
[0098] It is understandable that when the syntactic sugar structure is the same as the pre-configured input parameter structure, the client 10 may not be able to uniquely determine whether the responded operation is a virtual data acquisition operation based on the syntactic sugar structure. In this case, a prompt message indicating that the target syntactic sugar does not conform to the input parameter specification can be displayed to prompt the user to reconfigure the syntactic sugar structure information.
[0099] The virtual data acquisition method provided in this embodiment detects the syntactic sugar structure of the target syntactic sugar before parsing the target syntactic sugar to obtain the target data type information, and determines whether the syntactic sugar structure conflicts with the pre-configured input parameter structures in the client, so that the target data type information obtained by parsing the target syntactic sugar information can be input normally, avoiding errors in virtual data acquisition.
[0100] Considering that there are quantity requirements for the virtually acquired data, some embodiments of this application also provide a method for virtually acquiring data according to the requested quantity. This method may include:
[0101] S1. Obtain the target syntactic sugar that the user defines under the path of the preset page.
[0102] This step S1 corresponds one-to-one with step S110 in the previous embodiment. Please refer to the above description for details, which will not be repeated here.
[0103] S2. Parse the target syntactic sugar to obtain the target data type information and the target data quantity information.
[0104] Specifically, the request content of the requested data obtained by parsing the target syntactic sugar can include not only the target data type information but also the target data quantity information. Therefore, the target syntactic sugar can be composed of the syntactic sugar structure, the data type of the data to be requested, and the quantity of the data to be requested.
[0105] For example, the target syntactic sugar could be "@img@10", which means requesting ten images as virtual data.
[0106] S3. Using the target data type information as the interface input parameter, generate a virtual interface request instruction.
[0107] It is understandable that since the request content of the requested data obtained by parsing the target syntactic sugar contains the target data type information and the target data quantity information, the target data type information and the target data quantity information can be used as interface input parameters to generate a virtual interface request instruction containing the quantity information. Thus, the virtual interface request instruction contains both the target data quantity information and the target data type information.
[0108] S4. Send the virtual interface request instruction to the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction.
[0109] It is understood that, since the virtual interface request instruction contains target data quantity information and target data type information, a virtual interface request instruction containing the quantity information can be sent to the server so that the server responds to the virtual interface request instruction containing the quantity information and returns the data in the preset page that matches the target data quantity information in the virtual interface request instruction containing the target data quantity information.
[0110] For example, assuming the default page address is "www.abc.com", which contains product images for various products, then by obtaining the target syntactic sugar "@img@10" input by the user on "www.abc.com", we can parse "@img@10" to obtain the target data type information as the image type corresponding to "img", and the target data quantity information as "10" images. Then, we can use the image type and ten images as interface input parameters to generate a virtual interface request instruction with image type information and ten images (quantity information) and send it to the server 20. After receiving the virtual interface request instruction, the server 20 can search for image type data from the page corresponding to "www.abc.com" and select 10 images from the data with image type data to return to the client 10.
[0111] The virtual data acquisition method provided in this embodiment obtains target data quantity information and target data type information by parsing the target syntactic sugar. This ensures that the instructions received by the server 20 also contain target data quantity information and target data type information, enabling the server 20 to provide data in the preset page that matches the target data type information in the virtual interface request instruction containing the target data quantity information, thus allowing for more flexible virtual data acquisition.
[0112] In some embodiments of this application, the process of step S140 above, which involves sending the virtual interface request instruction to the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction, is described. This process may include:
[0113] S1. Determine the target interface in the server 20 that matches the target data type information in the virtual interface request instruction.
[0114] Understandably, since server 20 has multiple virtual data retrieval interfaces, and each interface corresponds to a data type, when determining the data type of the data to be requested, the data type of the data to be requested can be compared with each interface, and the interface corresponding to the data type that matches the target data type can be determined as the target interface.
[0115] Specifically, after the target interface is determined, the client 10 can transmit instructions and data with the target interface in the server 20.
[0116] S2. Send the virtual interface request instruction to the target interface in the server 20, so that the server 20 responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction through the target interface.
[0117] The virtual data acquisition method provided in this embodiment transmits instructions and data through the interface in the server 20, so that after determining the data type of the requested data, the target interface that matches it can be determined, so that the virtual data acquisition can be carried out more reasonably.
[0118] Next, this application embodiment will first further introduce the method of virtually acquiring data from the perspective of server 20, combined with Figure 2 The method may include:
[0119] Step S210: Receive the virtual interface request instruction sent by the client 10, and query the target data corresponding to the target data type information in the virtual interface request instruction on the page corresponding to the virtual interface request instruction.
[0120] Specifically, the virtual interface request instruction may include target data type information for the virtual interface to obtain data, and the target data type information may be obtained by parsing the target syntactic sugar that the user has customized and entered in the path of the page.
[0121] Step S220: Drive the target interface corresponding to the target data type information to read the target data, and send the target data to the client 10 through the target interface.
[0122] The virtual data acquisition method provided in this embodiment receives a virtual interface request instruction sent by a client 10 through a server 20. On the page corresponding to the virtual interface request instruction, target data corresponding to the target data type information in the virtual interface request instruction is queried. The virtual interface request instruction may contain target data type information for virtual interface data acquisition. This target data type information can be obtained by parsing user-defined target syntax sugar entered in the path on the page. Further, the target interface corresponding to the target data type information is driven to read the target data, and the target data is sent to the client 10 through the target interface. It is evident that the target syntax sugar is user-defined, and the target data type information is obtained by parsing the target syntax sugar, enabling faster provision of a large amount of virtual data of various types required by the client 10, thus improving the efficiency of virtual data acquisition.
[0123] The apparatus for virtual data acquisition provided in the embodiments of this application is described below. The apparatus for data acquisition described below and the method for data acquisition described above can be referred to in correspondence.
[0124] See Figure 4 , Figure 4 This is a schematic diagram of the device structure for a client 10 to acquire data, as disclosed in an embodiment of this application.
[0125] like Figure 4 As shown, the device may include:
[0126] Syntactic sugar acquisition unit 11 is used to acquire target syntactic sugar customized by the user under the path of the preset page;
[0127] Syntactic sugar parsing unit 12 is used to parse the target syntactic sugar to obtain target data type information;
[0128] The request instruction generation unit 13 is used to generate a virtual interface request instruction using the target data type information as the interface input parameter.
[0129] The request instruction sending unit 14 is used to send the virtual interface request instruction to the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction.
[0130] Optionally, the syntactic sugar acquisition unit includes:
[0131] The syntactic sugar acquisition subunit is used to generate the target syntactic sugar in the path of the preset page in response to the user's operation of custom typing syntactic sugar structure information in the path of the preset page.
[0132] Optionally, the device may also include:
[0133] The syntactic sugar structure checking unit is used to check the syntactic sugar structure of the target syntactic sugar before the syntactic sugar parsing unit parses the target syntactic sugar and obtains the target data type information, and to determine whether the syntactic sugar structure conflicts with the pre-configured input parameter structure in the client. If not, the target syntactic sugar determination unit is executed.
[0134] The target syntactic sugar determination unit is used to determine that the target syntactic sugar is the target syntactic sugar to be parsed.
[0135] Optionally, the device may also include:
[0136] The prompt message display unit is used to display a prompt message indicating that the target syntactic sugar does not conform to the input parameter specification if the syntactic sugar structure conflicts with the pre-configured input parameter structure in the client.
[0137] Optionally, the device may also include:
[0138] A quantity information determination unit is used to parse the target syntactic sugar to obtain target data quantity information;
[0139] The request instruction generation unit includes:
[0140] The request instruction generation subunit is used to generate a virtual interface request instruction containing the quantity information, using the target data type information and the target data quantity information as interface input parameters.
[0141] The request instruction sending unit includes:
[0142] The request instruction sending subunit is used to send a virtual interface request instruction containing the quantity information to the server, so that the server responds to the virtual interface request instruction containing the quantity information and returns the data of the target data quantity information that matches the target data type information in the virtual interface request instruction containing the target data quantity information on the preset page.
[0143] Optionally, the request instruction sending subunit includes:
[0144] The target interface determination unit is used to determine the target interface in the server that matches the target data type information in the virtual interface request instruction.
[0145] The target interface instruction sending unit is used to send the virtual interface request instruction to the target interface in the server, so that the server responds to the virtual interface request instruction and returns data on the preset page through the target interface that matches the target data type information in the virtual interface request instruction.
[0146] See Figure 5 , Figure 5 This is a schematic diagram of the structure of a server 20 for acquiring data, as disclosed in an embodiment of this application.
[0147] like Figure 5 As shown, the device may include:
[0148] The request instruction receiving unit 21 is used to receive a virtual interface request instruction sent by the client, and to query the target data corresponding to the target data type information in the virtual interface request instruction in the page corresponding to the virtual interface request instruction. The virtual interface request instruction contains target data type information for the virtual interface to obtain data. The target data type information is obtained by parsing the target syntax sugar that the user has customized and entered in the path of the page.
[0149] The target data sending unit 22 is used to drive the target interface corresponding to the target data type information to read the target data, and send the target data to the client through the target interface.
[0150] The data acquisition device provided in this application embodiment can be applied to data acquisition devices, such as terminals: mobile phones, computers, etc. Optionally, Figure 6 A hardware block diagram of the data acquisition device is shown, with reference to... Figure 6 The hardware structure of the device for acquiring data may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;
[0151] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0152] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0153] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0154] The memory stores a program, which the processor can call. The program is used for:
[0155] Retrieve the target syntactic sugar defined by the user under the path of the preset page;
[0156] Parse the target syntactic sugar to obtain the target data type information;
[0157] Using the target data type information as the interface input parameter, a virtual interface request instruction is generated;
[0158] Send the virtual interface request instruction to the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction.
[0159] Optionally, the refined and extended functions of the program can be found in the description above.
[0160] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor, the program being used for:
[0161] Retrieve the target syntactic sugar defined by the user under the path of the preset page;
[0162] Parse the target syntactic sugar to obtain the target data type information;
[0163] Using the target data type information as the interface input parameter, a virtual interface request instruction is generated;
[0164] Send the virtual interface request instruction to the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction.
[0165] Optionally, the refined and extended functions of the program can be found in the description above.
[0166] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0167] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0168] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for virtually acquiring data, characterized in that, Applied to the client side, including: Retrieve the target syntactic sugar defined by the user under the path of the preset page; Parse the target syntactic sugar to obtain the target data type information; Using the target data type information as the interface input parameter, a virtual interface request instruction is generated; Send the virtual interface request instruction to the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction; Sending the virtual interface request instruction to the server, so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction, includes: Determine the target interface in the server that matches the target data type information in the virtual interface request instruction; Send the virtual interface request instruction to the target interface in the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction through the target interface.
2. The method according to claim 1, characterized in that, The step of obtaining the user's custom target syntactic sugar under the preset page path includes: In response to the user's operation of customizing the syntactic sugar structure information in the path of the preset page, the target syntactic sugar in the path of the preset page is generated.
3. The method according to claim 1, characterized in that, Before parsing the target syntactic sugar to obtain the target data type information, the process also includes: Detect the syntactic sugar structure of the target syntactic sugar and determine whether the syntactic sugar structure conflicts with the pre-configured input parameter structures in the client; If not, the target syntactic sugar is determined to be the target syntactic sugar to be parsed.
4. The method according to claim 3, characterized in that, Also includes: If the syntactic sugar structure conflicts with the pre-configured input parameter structures in the client, a prompt message indicating that the target syntactic sugar does not conform to the input parameter specifications will be displayed, allowing the user to re-enter the syntactic sugar structure information.
5. The method according to claim 1, characterized in that, Also includes: Parse the target syntactic sugar to obtain the target data quantity information; Using the target data type information as interface input parameters, a virtual interface request instruction is generated, including: Using the target data type information and the target data quantity information as interface input parameters, a virtual interface request instruction containing the quantity information is generated. Sending the virtual interface request instruction to the server, so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction, includes: Send a virtual interface request instruction containing the quantity information to the server, so that the server responds to the virtual interface request instruction containing the quantity information and returns the data of the target data quantity information that matches the target data type information in the virtual interface request instruction containing the target data quantity information on the preset page.
6. A method for virtually acquiring data, characterized in that, Applied to the server side, including: Receive a virtual interface request instruction sent by the client, and in the page corresponding to the virtual interface request instruction, query the target data corresponding to the target data type information in the virtual interface request instruction. The virtual interface request instruction contains target data type information for the virtual interface to obtain data. The target data type information is obtained by parsing the target syntax sugar that the user has customized and entered in the path of the page. The driver reads the target data through the target interface corresponding to the target data type information, and sends the target data to the client through the target interface.
7. A device for virtually acquiring data, characterized in that, Applied to the client side, including: The syntactic sugar acquisition unit is used to acquire the target syntactic sugar that the user has defined in the path of the preset page; The syntactic sugar parsing unit is used to parse the target syntactic sugar to obtain target data type information; The request instruction generation unit is used to generate a virtual interface request instruction using the target data type information as the interface input parameter. A request instruction sending unit is used to send the virtual interface request instruction to the server so that the server responds to the virtual interface request instruction and returns data on the preset page that matches the target data type information in the virtual interface request instruction. The request instruction sending subunit includes: The target interface determination unit is used to determine the target interface in the server that matches the target data type information in the virtual interface request instruction. The target interface instruction sending unit is used to send the virtual interface request instruction to the target interface in the server, so that the server responds to the virtual interface request instruction and returns data on the preset page through the target interface that matches the target data type information in the virtual interface request instruction.
8. A device for virtually acquiring data, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of the method for virtually acquiring data as described in any one of claims 1-5 or 6.
9. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for virtually acquiring data as described in any one of claims 1-5 or 6.
Citation Information
Patent Citations
Query method and device
CN107122418A
Data query method and device, electronic equipment and machine readable storage medium
CN113094387A