Data request method, device, equipment and medium

By analyzing the dependencies of form fields, the data is requested on demand is solved, and the problem of unnecessary data transmission in network applications is optimized, and the server-side computing load is improved and the user experience is improved.

CN118394510BActive Publication Date: 2024-11-19和创(北京)科技股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410485605.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-22
Publication Date
2024-11-19
Estimated Expiration
2044-04-22

AI Technical Summary

Technical Problem

In network applications, form pages need to obtain a large amount of data to fill the page, but most of the data does not need to be used on the current page, resulting in increased computing burden on the server side and unnecessary data transmission, resulting in waste of resources.

Method used

By analyzing the dependencies of form fields, extracting dependency expressions, analyzing the dependencies of each field, obtaining the dependency calculation results, and splicing the request parameters according to the results, sending them to the server on demand to realize the on-demand request of data.

Benefits of technology

Optimize the computing load and data transmission volume on the server side, improve the performance and user experience of network applications, and reduce resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394510B_ABST
    Figure CN118394510B_ABST
Patent Text Reader

Abstract

The present invention provides a data request method, device, equipment and medium, which relates to the field of data request, wherein the data request method comprises: parsing the configuration information of the current object, extracting the dependency expression therefrom; analyzing the dependency of each field in the dependency expression, obtaining the dependency calculation result; splicing the request parameters according to the dependency calculation result as required, and sending the spliced ​​request parameters to the server. The present invention achieves the purpose of optimizing the server-side computing load and reducing the data transmission volume by parsing the dependency of the fields and requesting data on demand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of data request technology, and in particular to a data request method, device, equipment and system. Background Art

[0002] In network applications, the data required for page display on the client is limited, but the complete data involved in the page is relatively large. In the prior art, when processing form pages in network applications, a large amount of data is usually required to fill the page. However, most of this data may not be needed in the current page, which increases the computing burden on the server and causes unnecessary data transmission, resulting in a waste of resources. Summary of the invention

[0003] The present invention provides a data request method, device, equipment and system, aiming to realize on-demand request of data by parsing the dependency relationship of form fields, thereby reducing the amount of calculation and data transmission on the server side.

[0004] An embodiment of the present invention provides a data request method, including:

[0005] S1. Parse the configuration information of the current object and extract the dependency expression from it;

[0006] S2. Analyze the dependency relationship of each field in the dependency relationship expression and obtain the dependency calculation result;

[0007] S3. According to the dependency calculation results, the request parameters are spliced ​​as required, and the spliced ​​request parameters are sent to the server.

[0008] An embodiment of the present invention provides a data request device, including:

[0009] The data parsing module is used to parse the configuration information of the current object and extract the dependency expression from it;

[0010] The dependency calculation module is used to analyze the dependency of each field in the dependency expression and obtain the dependency calculation result;

[0011] The data request module is used to splice the request parameters as required according to the dependency calculation results and send the spliced ​​request parameters to the server.

[0012] An embodiment of the present invention further provides an electronic device, including:

[0013] processor; and,

[0014] A memory arranged to store computer executable instructions, which when executed cause the processor to perform the steps of the above data request method.

[0015] An embodiment of the present invention further provides a storage medium for storing computer executable instructions, wherein the computer executable instructions implement the steps of the above data request method when executed.

[0016] The present invention has the following beneficial effects:

[0017] The present invention provides a data request method, which achieves the purpose of optimizing the server-side computing load and reducing the amount of data transmission by parsing field dependencies and requesting data on demand. This method is of great significance for improving the performance of network applications and user experience. It should be noted that although the present invention mainly focuses on the dependency calculation of form fields, its core ideas and methods can also be applied to other scenarios that need to process complex data dependencies, such as data processing, data analysis and other fields. Therefore, the present invention has broad application prospects and potential commercial value. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate one or more embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0019] Figure 1 is a flow chart of a data request method according to an embodiment of the present invention;

[0020] Figure 2 Schematic diagram of a data request device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.

[0022] Method Embodiment

[0023] The embodiment of the present invention provides a data request method. Figure 1 is a flow chart of a data request method according to an embodiment of the present invention. Figure 1As shown, the data request method of the embodiment of the present invention specifically includes:

[0024] S1. Parse the configuration information of the current object and extract the dependency expression from it; S1 specifically includes:

[0025] The dependency structure of the current object is parsed by a data parser, and the data dependency of the object type is separated in the dependency structure by a dependency calculator;

[0026] According to the dependency structure and the data dependency of the object type, the dependency relationship itself is transferred to the dependent field to obtain the dependency field expression, and the dependency field expression is merged into the dependency structure to obtain the dependency relationship expression.

[0027] S2. Analyze the dependency of each field in the dependency expression to obtain a dependency calculation result; the analyzing the dependency of each field in the dependency expression specifically includes:

[0028] Transfer the dependency expressions from the inner layer to the outer layer.

[0029] The operation of transferring the dependency expression from the inner layer to the outer layer specifically includes:

[0030] Establishing a node set according to the data dependency of the object type, wherein the node set is represented in the form of a bidirectional set table, wherein the tail node of each node in the node set stores the dependent node of the current node, and the head node stores the dependent node of the current node;

[0031] Traverse the bidirectional set table to obtain a dependent field array, in which the dependent field is in front and the dependent field is in the back;

[0032] The dependency relationship is completed according to the dependency field expression and the dependency field array to obtain a dependency calculation result.

[0033] S3. According to the dependency calculation results, the request parameters are spliced ​​as required, and the spliced ​​request parameters are sent to the server.

[0034] Let's use a specific scenario to illustrate:

[0035] A complex scenario with nested cross-dependencies is given for calculation. The specific example is: A=Ba, B=Cb, C=Dc, E=Be, address=A.address, where address is value type data, and the remaining A, B, C, and E are object type data. According to step S1 of the embodiment of the present invention, the dependency expression is obtained, which specifically includes:

[0036] 1. Create a single object data processing unit for data analysis, calculation and parameter assembly of a single object. Through the data parser, parse the dependency structure of the object to be calculated, recorded as originA;

[0037] originA={"address":{"name":"address","fields":[["A","address"]]},

[0038] "B":{"name":"B","fields":[["C","b"]]},

[0039] "A":{"name":"A","fields":[["B","a"]]},

[0040] "C":{"name":"C","fields":[["D","c"]]},

[0041] "E":{"name":"E","fields":[["B","e"]]}}

[0042] 2. Use the dependency calculator to separate the object type data dependency from originA, recorded as depend;

[0043] depend={"B":[["C","b"]],

[0044] "A":[["B","a"]],

[0045] "C":[["D","c"]],

[0046] "E":[["B","e"]]}

[0047] 3. According to originA and depend, pass its own dependency to the dependent field and get the result, which is recorded as appendField;

[0048] appendField={"A":{"name":"A","fields":[["B","a","address"]]},

[0049] "C":{"name":"C","fields":[["D","c","b"]]},

[0050] "B":{"name":"B","fields":[["C","b","a"],["C","b","e"]]}}

[0051] Merge appendField into the object's dependency structure originA, and the result is as follows:

[0052] originA={"address":{"name":"address","fields":[["A","address"]]},

[0053] "B":{"name":"B","fields":[["C","b"],["C","b","a"],["C","b","e"]]},

[0054] "A":{"name":"A","fields":[["B","a"],["B","a","address"]]},

[0055] "C":{"name":"C","fields":[["D","c"],["D","c","b"]]},

[0056] "E":{"name":"E","fields":[["B","e"]]}}

[0057] Afterwards, according to step S2 of the embodiment of the present invention, the dependency of each field in the dependency expression is analyzed to obtain the dependency calculation result, which specifically includes:

[0058] The inner layer dependencies are passed to the outer layer to ensure that each layer has complete dependencies. The specific implementation method is: create a two-way set table data type, each node contains 3 member variables, which are the identifier of the current node, the set head pointing to the head node, and the set tail pointing to the tail node. Create a two-way set table. The creation steps are as follows:

[0059] (1) Create a node set based on depend, using key as the identifier, with the head node and tail node being empty.

[0060] (2) The dependent node is in the tail of the dependent node, and the dependent node is in the head of the dependent node, creating a bidirectional set table.

[0061] (3) Maintain a head node set recorded as headNodeMap, in which the head of each node is empty.

[0062] (4) Create an empty array arr, take a node from the generated bidirectional set table headNodeMap each time and record it as node A, put it in arr, and delete node A from the bidirectional set table. During the deletion process, traverse each entry in the tail of node A, delete node A in the head of each entry, if the head is empty at this time, add it to the headNodeMap, and then set the tail of node A to empty. The final arr is an array with dependent fields in the front and dependent fields in the back. In this example, arr = ['A', 'E', 'B', 'C'].

[0063] (5) Complete the dependency relationship based on appendField and arr. Specific implementation steps: traverse arr, for each entry, if it is included in the key of appendField, take out the corresponding value value = appendField [key], and pass its own dependency to the dependent field from the inside to the outside according to value and depend, and merge it into originA. The result is as follows:

[0064] originA={"address":{"name":"address","fields":[["A","address"]]},

[0065] "B":{"name":"B","fields":[["C","b"],["C","b","a"],["C","b","e"],["C","b","a","address"]]},

[0066] "A":{"name":"A","fields":[["B","a"],["B","a","address"]]},

[0067] "C":{"name":"C","fields":[["D","c"],["D","c","b"],["D","c","b","a"],["D","c","b","e"],["D","c","b","a","address"]]},

[0068] "E":{"name":"E","fields":[["B","e"]]}}

[0069] According to the embodiment of the present invention, step S3 splices the request parameters as required based on the dependency calculation result, and sends the spliced ​​request parameters to the server, specifically including: using a parameter assembler, according to the final originA, assembling the parameters and passing them to the server through the request;

[0070] params=[{"name":"A","subFields":[{"name":"address"}]},

[0071] {"name":"C","subFields":[{"name":"b","subFields":[{"name":"a","subFields":[{"name":"address"}]},{"name":"e"}]}]},

[0072] {"name":"B","subFields":[{"name":"a","subFields":[{"name":"address"}]},{"name":"e"}]},

[0073] {"name":"D","subFields":[{"name":"c","subFields":[{"name":"b","subFields":[{"name":"a","subFields":[{"name":"address"}]},{"name":"e"}]}]}]}]

[0074] After receiving the parameters, the server only returns the fields specified by the parameters, thereby reducing server-side calculations and data transmission.

[0075] A simpler scenario, for example: two objects can be created on the form page, named: main object, sub-object A. Here, the main object is the first level, and sub-object A is the second level. There are two levels in total, so it is called a two-level form. The same applies to multi-level forms. The main object contains two fields, named main field 1 and main field 2; the value of main field 1 is an object, assuming: main field 1 = {'A':{'B':{'C':{'M':{'x':2, 'N':...}, 'D':{'E':{'F':{'G':{......}}}}}}}}, the value of main field 2 is an object, which is equal to B in A in main field 1, recorded as main field 2 = main field 1.AB (the same below); sub-object A contains three fields, named: sub-A field 1, sub-A field 2, sub-A field 3; its The value of sub-field A 1 is an object. Assume that: sub-field A 1 = main object.main field 2, sub-field A 2 = sub-field A 1.CD, sub-field A 3 = main object.main field 2.CMx; when clicking on the main field 1 of the main object of the new page of this form, it is necessary to obtain the corresponding data from the server. According to the data request method provided by the embodiment of the present invention, each piece of data only needs to include {'A':{'B':{'C':{'M':{'x','N'},'D'}}}}, without including deeper data such as E, F, G, H, I...... The specific operation steps are as follows:

[0076] First, get two objects: the main object and the sub-object A.

[0077] 1. According to the depth-first algorithm, first get the dependency result of sub-object A on the main object:

[0078] {"Sub-A Field 2":{"name":"Sub-A Field 2","fields":[["Sub-A Field 1","C","D"]]},"Sub-A Field 1":{"name":"Sub-A Field 1","fields":[["Main Object","Main Field 2"],["Main Object","Main Field 2","C","D"]]}}

[0079] Filter out the dependencies on the master and remove the "master object" in the dependency value to get

[0080] subDep={"Sub-object A_Sub-A field 1":{"name":"Sub-object A_Sub-A field 1","fields":[["Main field 2"],["Main field 2","C","D"]]}}

[0081] 2. Then separate the data dependency of the object type from the main object, and record the dependency result of the main object itself as masterDep. Merge subDep into masterDep, and use the merged masterDep to pass its own dependency to the dependent field, and then pass the inner layer dependency to the outer layer, so as to ensure that each layer has a complete dependency relationship. At this point, the calculation result of the two-level form field dependency is obtained.

[0082] In summary, the data parser, dependency calculator and parameter assembler can be integrated in the client application. When implemented on the client side, the field dependency can be parsed and calculated in real time, and the request parameters can be generated; when implemented on the server side, the dependency information sent by the client can be received and the corresponding data can be returned. In addition, the present invention can be further combined with a cache mechanism to store the requested data in the cache so that it can be directly obtained in subsequent requests, further improving the efficiency of data acquisition.

[0083] In the prior art, when processing a form page in a network application, a large amount of data is usually required to fill the page. However, most of this data may not be needed in the current page, which leads to an increase in the computing burden on the server side and unnecessary data transmission. The present invention solves the above problem by introducing a calculation method of multi-level form field dependency, realizing on-demand data request based on the dependency relationship of page fields.

[0084] The present invention provides a data request method, which is based on the calculation method of multi-level form field dependencies, and requests data on demand by parsing field dependencies, thereby achieving the purpose of optimizing server-side computing load and reducing data transmission volume. This method is of great significance for improving the performance of network applications and user experience. It should be noted that although the present invention mainly focuses on the dependency calculation of form fields, its core ideas and methods can also be applied to other scenarios that need to process complex data dependencies, such as data processing, data analysis and other fields. Therefore, the present invention has broad application prospects and potential commercial value.

[0085] Device Example 1

[0086] An embodiment of the present invention provides a data request device. Figure 2 is a schematic diagram of a data request device according to an embodiment of the present invention. Figure 2 As shown, the data requesting device of the embodiment of the present invention includes:

[0087] The data parsing module 20 is used to parse the configuration information of the current object and extract the dependency expressions from it. The data parser parses the configuration information of the current object and extracts the expressions used to calculate the dependency. These expressions describe the dependency between the form fields and are the key to subsequent calculations.

[0088] The data analysis module 20 is specifically used for:

[0089] The dependency structure of the current object is parsed by a data parser, and the data dependency of the object type is separated in the dependency structure by a dependency calculator;

[0090] According to the dependency structure and the data dependency of the object type, the dependency relationship itself is transferred to the dependent field to obtain the dependency field expression, and the dependency field expression is merged into the dependency structure to obtain the dependency relationship expression.

[0091] The dependency calculation module 22 is used to analyze the dependency of each field in the dependency expression and obtain the dependency calculation result; the dependency calculation module 22 performs calculations based on the parsed expression. It analyzes the dependency of each field and determines which fields' data need to be obtained from the server. The dependency calculation module 22 makes full use of the dependency between fields and avoids unnecessary data requests. The dependency calculation module 22 is specifically used to: transfer the dependency expression from the inner layer to the outer layer.

[0092] The dependency calculation module 22 is further used for:

[0093] Establishing a node set according to the data dependency of the object type, wherein the node set is represented in the form of a bidirectional set table, wherein the tail node of each node in the node set stores the dependent node of the current node, and the head node stores the dependent node of the current node;

[0094] Traverse the bidirectional set table to obtain a dependent field array, in which the dependent field is in front and the dependent field is in the back;

[0095] The dependency relationship is completed according to the dependency field expression and the dependency field array to obtain a dependency calculation result.

[0096] The data request module 24 is used to splice the request parameters according to the dependency calculation results as required, and send the spliced ​​request parameters to the server. After receiving the parameters, the server only returns the fields specified by the parameters, thereby reducing the server-side calculation and data transmission volume.

[0097] The present invention provides a data request device, which requests data on demand by parsing field dependencies, thereby achieving the purpose of optimizing server-side computing load and reducing data transmission volume. This approach is of great significance for improving the performance of network applications and user experience. It should be noted that although the present invention mainly focuses on the dependency calculation of form fields, its core ideas and methods can also be applied to other scenarios that need to process complex data dependencies, such as data processing, data analysis and other fields. Therefore, the present invention has broad application prospects and potential commercial value.

[0098] Device Example 2

[0099] According to an embodiment of the present invention, an electronic device is provided, including:

[0100] processor; and,

[0101] A memory is arranged to store computer executable instructions, which when executed cause the processor to perform the steps of the above method embodiments.

[0102] Device Example 3

[0103] According to an embodiment of the present invention, a storage medium is provided for storing computer executable instructions, and the computer executable instructions, when executed, implement the steps described in the above method embodiment.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data request method, characterized in that: include: S1. Parse the configuration information of the current object and extract the dependency expression from it; S2. Analyze the dependency relationship of each field in the dependency relationship expression to obtain the dependency calculation result; S3. splice the request parameters as required according to the dependency calculation results, and send the spliced ​​request parameters to the server; The S1 specifically includes: The dependency structure of the current object is parsed by a data parser, and the data dependency of the object type is separated in the dependency structure by a dependency calculator; According to the dependency structure and the data dependency of the object type, the dependency relationship is transferred to the dependent field to obtain a dependency field expression, and the dependency field expression is merged into the dependency structure to obtain a dependency relationship expression; The analyzing the dependency relationship of each field in the dependency relationship expression specifically includes: Transfer the dependency expressions from the inner layer to the outer layer; The operation of transferring the dependency expression from the inner layer to the outer layer specifically includes: Establishing a node set according to the data dependency of the object type, wherein the node set is represented in the form of a bidirectional set table, wherein the tail node of each node in the node set stores the dependent node of the current node, and the head node stores the dependent node of the current node; Traverse the bidirectional set table to obtain a dependent field array, in which the dependent field is in front and the dependent field is in the back; The dependency relationship is completed according to the dependency field expression and the dependency field array to obtain a dependency calculation result.

2. A data request device, characterized in that: include: The data parsing module is used to parse the configuration information of the current object and extract the dependency expression from it; A dependency calculation module, used to analyze the dependency relationship of each field in the dependency relationship expression and obtain the dependency calculation result; A data request module is used to splice request parameters as required based on the dependency calculation results and send the spliced ​​request parameters to the server; The data analysis module is specifically used for: The dependency structure of the current object is parsed by a data parser, and the data dependency of the object type is separated in the dependency structure by a dependency calculator; According to the dependency structure and the data dependency of the object type, the dependency relationship is transferred to the dependent field to obtain a dependency field expression, and the dependency field expression is merged into the dependency structure to obtain a dependency relationship expression; The dependency calculation module is specifically used to: transfer the dependency expression from the inner layer to the outer layer; The dependency calculation module is further used for: Establishing a node set according to the data dependency of the object type, wherein the node set is represented in the form of a bidirectional set table, wherein the tail node of each node in the node set stores the dependent node of the current node, and the head node stores the dependent node of the current node; Traverse the bidirectional set table to obtain a dependent field array, in which the dependent field is in front and the dependent field is in the back; The dependency relationship is completed according to the dependency field expression and the dependency field array to obtain a dependency calculation result.

3. An electronic device, comprising: processor; as well as, A memory arranged to store computer executable instructions, which when executed cause the processor to perform the steps of the data request method as claimed in any one of claims 1.

4. A storage medium for storing computer executable instructions, wherein the computer executable instructions, when executed, implement the steps of the data request method as claimed in any one of claims 1.