A UE-based network data request interaction management method and system
Through table configuration and modular processing, the problem of high complexity of network requests in the UE engine is solved, the network request process is simplified, efficiency is improved, and development cycle is reduced.
Patent Information
- Application Number
- CN202310071359.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-17
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2043-01-17
AI Technical Summary
In the development of existing UE engines, the network request interface addresses and parameters are numerous and complicated, and the verification method is uncertain, making it difficult to call, debug and manage network requests, and have high coupling, which increases the development cycle.
The request address, parameters, verification method and communication type are managed in table configuration, and network request decoupling is performed through Http, Socket and Mqtt modules, and interface configuration tables are established and cache parameter configuration tables are cached to simplify the network request process.
It improves the efficiency of network request usage, reduces docking and debugging time, reduces the development cycle of project functions, and realizes efficient network data request management.
Smart Images

Figure CN116319302B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic information technology, and in particular to a UE-based network data request interaction management method and system. Background Art
[0002] In the development of the UE engine, as business functions increase, when connecting to system service interfaces or device communications, there are multiple interface addresses, multiple request parameters, multiple signature verification methods, and multiple communication types.
[0003] For example, prior art 201210130996.9 describes an engine development method, wherein a file pre-establishes an interface standard, and a plug-in has an interface that complies with the interface standard; the plug-in is stored in the engine's directory; the engine loads the plug-in into memory; the engine's information is registered with the server; and the server calls the plug-in based on the information to execute the task requested by the client. The present invention provides an engine development device, comprising: a storage module for storing the plug-in in the engine's directory; a loading module for the engine to load the plug-in into memory; a registration module for registering the engine's information with the server; and a calling module for the server to call the plug-in based on the information to execute the task requested by the client.
[0004] The configuration and use of the file engine's network data request method are cumbersome, and signature verification methods and communication types are missing. During the iterative development process, coupling is high, usage efficiency is low, and docking and debugging time is long, which increases the development cycle of project functions.
[0005] Moreover, when network requests are frequently used in existing UE engine development, the interface addresses and parameters are numerous and complex, the signature verification method is uncertain, and the communication type is missing, which leads to problems such as difficulty in calling, debugging and managing network requests. Summary of the Invention
[0006] The present invention provides a UE-based network data request interaction management method, which adopts a table configuration method to manage the request address, request parameters, signature verification method, communication type, etc. and perform network request decoupling processing. This solves the problem that when network requests are frequently used in UE engine development, the interface addresses and parameters are numerous and complex, and the signature verification method is uncertain, which makes network requests difficult to call, debug, and manage.
[0007] The UE-based network data request interaction management method includes:
[0008] Step 1: Create an interface configuration table and define the table ID.
[0009] Step 2: In response to the network data request, the request management module parses the interface configuration table according to the table ID and determines the network data request method; if it is GET / POST, the Http module is executed;
[0010] Step 3: Encapsulate the request package according to the interface configuration table parsed by the request management module, then use the UE engine Http component to initiate a network request and listen to the returned network data;
[0011] Step 4: Encapsulate the request address into the interface configuration table, parse the request parameters and read the cached parameter values, concatenate the parameters into the request address, use the UE engine Socket component to initiate a network request, and listen to the returned network data.
[0012] Step 5. Encapsulate the message topic address into the interface configuration table, parse the request parameters and read the cached parameter values, concatenate the parameters into the topic address, subscribe to the topic using the Mqtt third-party library, and listen to the returned network data.
[0013] It should be further explained that in step 1, the interface configuration table established includes: interface address, request parameters, signature verification method, and communication type.
[0014] It should be further explained that in step 1, the interface address, request method, request parameters, table ID that needs to be requested again after the request is completed, signature verification method, and request content type are also defined in the interface configuration table.
[0015] It should be further explained that in step 2, the Http module is executed to determine whether data needs to be cached;
[0016] If data needs to be cached, the data structure is monitored in the returned data according to the parsing path rules;
[0017] Check whether the parameter names in the parsing conditions and parsing rules exist in the current path;
[0018] If the parsed parameter name exists, read the parameter value from the cache and determine whether the parsed parameter value is equal to the cached parameter value or whether the parsed parameter value is equal to the numerical value;
[0019] If they are equal, the current parsed parameter values are cached under the currently configured table ID and alias, and the request data is returned to the callback listener, and the request is deleted from the request manager.
[0020] It should be further explained that in step 2, if the Http module fails to execute, an error code is returned.
[0021] If the Http module returns that the request cache parameter value is missing, the parameter name of the missing parameter value is used to search the required interface configuration table Id in the cache parameter configuration table, and the network request is continued to be initiated according to the interface configuration table Id, and added to the first place of the request manager. After the request is successful, this request is deleted from the request manager, and requests are continued to be initiated sequentially from the request manager.
[0022] It should be further explained that if the execution fails multiple times or the Http module error code is other error codes, the request will be deleted from the request manager and the error code will be returned to the callback listener.
[0023] It should be further explained that, in step 3, encapsulating the request package includes: assembling the Http request body and the Http request header;
[0024] Assemble the HTTP request body based on the request method, request parameters, and request content type;
[0025] Assemble the HTTP request header according to the signature verification method.
[0026] The present invention also provides a network data request interaction management system based on UE, the system includes: a data configuration module, a request management module, an Http module, a Socket module and an Mqtt module;
[0027] Data configuration module, used to establish interface configuration table and define table ID;
[0028] The request management module is used to parse the interface configuration table according to the table ID and determine the network data request method;
[0029] If it is GET / POST, the Http module is executed;
[0030] The Http module encapsulates the request package according to the interface configuration table parsed by the request management module, then uses the UE engine Http component to initiate a network request and listens for the returned network data.
[0031] The socket module is used to encapsulate the request address into the interface configuration table, parse the request parameters and read the cached parameter values, concatenate the parameters to the request address, use the UE engine socket component to initiate the network request, and listen for the returned network data.
[0032] The MQTT module is used to encapsulate the message topic address into the interface configuration table, parse the request parameters and read the cached parameter values, splice the parameters into the topic address, subscribe to the topic using the MQTT third-party library, and listen to the returned network data.
[0033] It can be seen from the above technical solutions that the present invention has the following advantages:
[0034] The network data request interaction management method provided by the present invention solves the problems of existing network requests in existing UE engines, such as complex usage, high coupling, and lack of signature verification methods and communication types. The UE-based network data request interaction management method proposed by the present invention effectively improves the problems of the existing technology through simple configuration and integration of multiple network request methods, improves usage efficiency, reduces docking and debugging time, and effectively shortens the development cycle of project functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for the description. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0036] Figure 1 A flowchart of a method for managing network data request interaction based on a UE;
[0037] Figure 2 The present invention is a flow chart of an embodiment of a method for managing network data request interaction based on a UE. DETAILED DESCRIPTION
[0038] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0039] See also Figures 1 to 2 The figure shows a flow chart of a UE-based network data request interaction management method in a specific embodiment, wherein the method of the present invention is executed by a data configuration module, a request management module, an Http module, a Socket module and an Mqtt module.
[0040] Among them, the method first configures the interface address, request parameters, signature verification method, communication type, etc., and establishes an interface configuration data table. The table fields include table ID (interface name), interface address, request method (GET / POST / SOCKET / MQTT), request parameters (multiple parameters are separated by commas), table ID that needs to be requested again after the request is completed, signature verification method (No Auth / API Key / Basic Auth / Bearer Token / Custom), and request content type (Json / Form-Data / form-urlencoded). Secondly, it is necessary to cache the configured request parameters from the data returned by other interfaces. The name of the cache parameter configuration table is established. The table fields include table ID (field name to be stored), interface configuration table ID, alias (fields can be stored as other names, multiple are separated by commas), parsing path (parsing path of data returned by the interface, the path rule is "field name / field name / ..."), and parsing condition (condition matched under the parsing path, the parsing rule is "parsing parameter name = [cache parameter name / value]"), as shown in Tables 1 and 2.
[0041] Table 1: Interface configuration table
[0042] Interface Configuration Table Form Id Interface address Request method (GET / POST / SOCKET / MQTT) Request parameters (multiple parameters are separated by commas) Request form Id again Signature verification method (No Auth / API Key / Basic Auth / Beaxex Token / Custom) Request content type (JSON / Form-Data / form-urlencoded)
[0043] Table 2: Cache parameter configuration table
[0044] Cache parameter configuration table Table Id (parameter name) Interface configuration table Id (interface name) Aliases (separate multiple names with commas) Parsing path (path rule is "field name / field name / ...") Parsing conditions (parsing path matching conditions, the rule is "parsing parameter name = [cache parameter name / value]")
[0045] The request management module sets the request manager. When the business logic needs to initiate a network data request, the management module parses the configuration module data according to the table ID and determines the request method.
[0046] If it is GET / POST, it is an Http request, add the Http request manager, and start executing the Http module.
[0047] The Http module is executed successfully and determines whether data needs to be cached based on the interface configuration table Id configured with cache parameters.
[0048] If caching is required, monitor whether the data structure matches the parsing path rules in the returned data.
[0049] If the path and data structure match, the parsing condition is checked. The "=" and "[]" in the parsing rule are checked to see if the parsing parameter name on the left side of the "=" exists in the current path.
[0050] If the parsed parameter name exists, read the cached parameter value of "[]" in the cache, and determine whether the parsed parameter value is equal to the cached parameter value or whether the parsed parameter value is equal to the numerical value. If they are equal, cache the current parsed parameter value to the currently configured table Id and alias, and return the request data to the callback listener, and delete the request from the request manager.
[0051] If the Http module fails to execute, the module returns an error code. If the module returns a missing request cache parameter value, the cache parameter configuration table is searched for the required interface configuration table ID using the parameter name of the missing parameter value. A network request is then initiated based on this interface configuration table ID and added to the top of the request manager. If the request succeeds, the request is deleted from the request manager and requests are continued from the request manager. If multiple executions fail or the Http module error code is another error code, the request is deleted from the request manager and the error code is returned to the callback listener.
[0052] In the embodiment of the present invention, if it is SOCKET, it is a Socket request, and the Socket module starts to be executed. The logic after the module is executed is the same as the above logic.
[0053] If it is MQTT, it is an Mqtt request and the Mqtt module starts to execute. The logic after executing the module is the same as the above logic.
[0054] The Http module of the present invention encapsulates the request package body according to the configuration data parsed by the request management module, first determines the request mode, assembles the Http request body according to the request mode, request parameters, and request content type, and returns a request cache parameter value missing error code if the monitored cache request parameter is empty. Secondly, the Http request header is assembled according to the signature verification method, the UE engine Http component is used to initiate a network request, and monitors and receives the returned network data.
[0055] The Socket module encapsulates the request address according to the configuration data parsed by the request management module, parses the request parameters and reads the cached parameter values, splices the parameters to the request address, uses the UE engine Socket component to initiate a network request, and listens for the returned network data.
[0056] The MQTT module encapsulates the message topic address based on the configuration data parsed by the request management module, parses the request parameters and reads the cached parameter values, splices the parameters to the topic address, uses the MQTT third-party library to subscribe to the topic, and listens for the returned network data.
[0057] The above-mentioned UE-based network data request interaction management method solves the problems of existing network requests in existing UE engines, such as complex usage, high coupling, lack of signature verification methods and communication types. The UE-based network data request interaction management method proposed in the present invention effectively improves these problems through simple configuration and integration of multiple network request methods, improves usage efficiency, reduces docking and debugging time, and effectively shortens the development cycle of project functions.
[0058] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0059] The following is an embodiment of a UE-based network data request interaction management system provided by an embodiment of the present disclosure. This system and the UE network data request interaction management method of the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the UE-based network data request interaction management system, please refer to the embodiment of the above-mentioned UE network data request interaction management method.
[0060] Data configuration module, used to establish interface configuration table and define table ID;
[0061] The request management module is used to parse the interface configuration table according to the table ID and determine the network data request method;
[0062] If it is GET / POST, the Http module is executed;
[0063] The Http module encapsulates the request package according to the interface configuration table parsed by the request management module, then uses the UE engine Http component to initiate a network request and listens for the returned network data.
[0064] The socket module is used to encapsulate the request address into the interface configuration table, parse the request parameters and read the cached parameter values, concatenate the parameters to the request address, use the UE engine socket component to initiate the network request, and listen for the returned network data.
[0065] The MQTT module is used to encapsulate the message topic address into the interface configuration table, parse the request parameters and read the cached parameter values, splice the parameters into the topic address, subscribe to the topic using the MQTT third-party library, and listen to the returned network data.
[0066] The present invention aggregates and configures interface addresses, request parameters, signature verification methods, communication types, and the like, creating an interface configuration data table for easy user access and effective development efficiency. It also efficiently collects, stores, and processes interface configuration table data and cache parameter configuration table data, using a multidimensional space to describe the entire development process. This improves operational efficiency and reduces docking and debugging time, thereby enabling timely and scientific supervision, management, and control of the entire system development and use process.
[0067] The units and algorithm steps of each example described in the embodiments disclosed in the UE-based network data request interaction management method and system of the present invention can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0068] In the flowchart of the UE-based network data request interaction management method, the possible implementation architecture, functions and operations of the device, method and computer program product according to various embodiments of the present disclosure are illustrated. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0069] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.
[0070] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for managing network data request interaction based on UE, characterized in that: Methods include: Step 1: Create an interface configuration table and define the table ID. Step 2: In response to the network data request, the request management module parses the interface configuration table according to the table ID and determines the network data request method; if it is GET / POST, the Http module is executed; Step 3: Encapsulate the request package according to the interface configuration table parsed by the request management module, then use the UE engine Http component to initiate a network request and listen to the returned network data; Step 4: Encapsulate the request address into the interface configuration table, parse the request parameters and read the cached parameter values, concatenate the parameters into the request address, use the UE engine Socket component to initiate a network request, and listen to the returned network data. Step 5. Encapsulate the message topic address into the interface configuration table, parse the request parameters and read the cached parameter values, concatenate the parameters into the topic address, subscribe to the topic using the MQTT third-party library, and listen to the returned network data. In step 2, the Http module is executed to determine whether data needs to be cached; If data needs to be cached, the data structure is monitored in the returned data according to the parsing path rules; Check whether the parameter names in the parsing conditions and parsing rules exist in the current path; If the parsed parameter name exists, read the parameter value from the cache and determine whether the parsed parameter value is equal to the cached parameter value or whether the parsed parameter value is equal to the numerical value; If they are equal, the current parsed parameter values are cached under the currently configured table ID and alias, and the request data is returned to the callback listener, and the request is deleted from the request manager.
2. The UE-based network data request interaction management method according to claim 1, characterized in that: In step 1, the interface configuration table established includes: interface address, request parameters, signature verification method, and communication type.
3. The UE-based network data request interaction management method according to claim 2, characterized in that: In step 1, the interface address, request method, request parameters, table ID that needs to be requested again after the request is completed, signature verification method, and request content type are also defined in the interface configuration table.
4. The UE-based network data request interaction management method according to claim 1, characterized in that: In step 2, if the Http module fails to execute, an error code is returned.
5. The UE-based network data request interaction management method according to claim 1, characterized in that: If the Http module returns that the request cache parameter value is missing, the parameter name of the missing parameter value is used to search the required interface configuration table Id in the cache parameter configuration table, and the network request is continued to be initiated according to the interface configuration table Id, and added to the first place of the request manager. After the request is successful, this request is deleted from the request manager, and requests are continued to be initiated sequentially from the request manager.
6. The UE-based network data request interaction management method according to claim 5, characterized in that: If the execution fails multiple times or the Http module error code is other error codes, the request will be deleted from the request manager and the error code will be returned to the callback listener.
7. The UE-based network data request interaction management method according to claim 1, characterized in that: In step 3, encapsulating the request package includes: assembling the Http request body and the Http request header; Assemble the HTTP request body based on the request method, request parameters, and request content type; Assemble the HTTP request header according to the signature verification method.
8. A UE-based network data request interaction management system, characterized in that: The system adopts the UE-based network data request interaction management method according to any one of claims 1 to 7; The system includes: data configuration module, request management module, Http module, Socket module and Mqtt module; Data configuration module, used to establish interface configuration table and define table ID; The request management module is used to parse the interface configuration table according to the table ID and determine the network data request method; If it is GET / POST, the Http module is executed; The Http module encapsulates the request package according to the interface configuration table parsed by the request management module, then uses the UE engine Http component to initiate a network request and listens for the returned network data. The socket module is used to encapsulate the request address into the interface configuration table, parse the request parameters and read the cached parameter values, concatenate the parameters to the request address, use the UE engine socket component to initiate the network request, and listen for the returned network data. The MQTT module is used to encapsulate the message topic address into the interface configuration table, parse the request parameters and read the cached parameter values, splice the parameters into the topic address, subscribe to the topic using the MQTT third-party library, and listen to the returned network data.
Citation Information
Patent Citations
Engine development method and device
CN103377046A
Systems and methods for database proxy request switching
CN103403707A
Automatic interface testing system and method based on Unittest and Jenkins tools
CN112306861A