Service request processing method and device, electronic equipment and storage medium
By using parameter reference information in the service request processing to extract reference parameters from the historical response results, the limitations of application scenarios caused by fixed business request parameters in the prior art are solved, and a more flexible and secure service request processing is achieved.
Patent Information
- Application Number
- CN202311565048.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-22
- Publication Date
- 2025-05-23
AI Technical Summary
The fixed parameter setting method of business requests in the prior art leads to limitations in application scenarios and cannot meet more flexible and adaptable needs.
By determining the parameter reference information carried by the service request to be executed, including the source request identification and source field information, the target historical response result is matched from the response result set, the field content is extracted as reference parameters, and the service request is updated to achieve more flexible processing.
It improves the dynamicity and flexibility of business requests, enhances the adaptability to application scenarios of using functions and sub-functions, and improves the security of business requests.
Smart Images

Figure CN120030249A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet communication technology, and in particular to a service request processing method, device, electronic device and storage medium. Background Art
[0002] With the development of Internet communication technology, various Internet products emerge in an endless stream, which can provide users with rich usage functions. The provision of usage functions often relies on the support of business requests, such as obtaining data for the implementation of usage functions through business requests. In related technologies, a business request is often relied on to obtain data for the implementation of a certain usage function or a sub-function of a certain usage function, and the business request obtains data with preset fixed parameters. Such a business request setting method has limitations, and will also cause limitations on the application scenarios of related usage functions or related sub-functions. Therefore, it is necessary to provide a more flexible and adaptable business request processing solution. Summary of the invention
[0003] In order to solve at least one of the above-mentioned technical problems, the present application provides a service request processing method, device, electronic device and storage medium:
[0004] According to a first aspect of the present application, a service request processing method is provided, the method comprising:
[0005] For a first service request to be executed, determining parameter reference information carried by the first service request, the parameter reference information including a source request identifier and source field information indicating a reference parameter;
[0006] Determine a target historical response result that matches the source request identifier from the response result set, the target historical response result is a response result of a target historical service request, the response result set includes respective response results of at least two preset historical service requests, and the target historical service request is any one of the at least two preset historical service requests;
[0007] Extracting corresponding field content from the target historical response result based on the source field information, and determining the field content as the reference parameter;
[0008] The first service request is updated using the reference parameter to obtain a second service request, and the second service request is executed.
[0009] According to a second aspect of the present application, a service request processing device is provided, the device comprising:
[0010] A determination module: configured to determine, for a first service request to be executed, parameter reference information carried by the first service request, wherein the parameter reference information includes a source request identifier and source field information indicating a reference parameter;
[0011] A matching module: used to determine a target historical response result that matches the source request identifier from a response result set, wherein the target historical response result is a response result of a target historical service request, wherein the response result set includes respective response results of at least two preset historical service requests, and the target historical service request is any one of the at least two preset historical service requests;
[0012] Extraction module: used for extracting corresponding field content from the target historical response result based on the source field information, and determining the field content as the reference parameter;
[0013] Update module: used to update the first service request using the reference parameter, obtain the second service request, and execute the second service request.
[0014] According to the third aspect of the present application, an electronic device is provided, comprising at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the at least one processor to implement the service request processing method as described in the first aspect.
[0015] According to the fourth aspect of the present application, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the business request processing method as described in the first aspect.
[0016] According to a fifth aspect of the present application, a computer program product is provided, which includes at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the service request processing method as described in the first aspect.
[0017] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
[0018] Implementing this application has the following beneficial effects:
[0019] The present application provides a more flexible and adaptable business request processing solution. In the present application, based on the parameter reference information carried by the current business request, the reference parameters can be obtained from the response result of the previous request, and then the reference parameters can be used to update the current business request. In this way, the request parameters in the business request are more dynamic, and the business request itself is more flexible. Compared with the support of business requests for related use functions or related sub-functions in related technologies, the business request processing solution provided by the present application is more conducive to the adaptability of application scenarios of related use functions or related sub-functions. At the same time, the determination of the request parameters in the current business request is based on the parameter reference information and the response result of the previous request is used as the data source, which can also improve the security of the current business request.
[0020] Other features and aspects of the present application will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A schematic diagram of an application environment according to an embodiment of the present application is shown;
[0023] Figure 2 A schematic diagram showing a process flow of a method for processing a service request according to an embodiment of the present application;
[0024] Figure 3 A schematic diagram showing a process of determining a target historical response result from a response result set according to an embodiment of the present application;
[0025] Figure 4 A schematic diagram showing a flow chart of applying a response result according to an embodiment of the present application to a page processing scenario;
[0026] Figure 5 A flow chart of a method for processing a service request according to an embodiment of the present application is also shown;
[0027] Figure 6 A schematic diagram showing a flow chart of determining whether to stop processing a first service request according to an embodiment of the present application;
[0028] Figure 7 A flow chart of a method for processing a service request according to an embodiment of the present application is also shown;
[0029] Figure 8 A schematic diagram of an interface for setting a service request according to an embodiment of the present application is shown;
[0030] Fig. 9 A schematic diagram of an interface for setting a service request according to an embodiment of the present application is also shown;
[0031] Fig.10 A schematic diagram of an interface for setting a service request according to an embodiment of the present application is also shown;
[0032] Fig.11 A schematic diagram of an interface for setting a current service request in a test according to an embodiment of the present application is shown;
[0033] Figure 12-13 A schematic diagram of an interface showing a response result of a historical service request in a test according to an embodiment of the present application;
[0034] Fig.14 A schematic diagram showing an interface flow of a response result of a current service request in a test according to an embodiment of the present application;
[0035] Fig.15 A device block diagram according to an embodiment of the present application is shown;
[0036] Fig.16 A schematic diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0040] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0041] The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
[0042] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0043] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.
[0044] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0045] RayData Web: A visual editing tool. RayData Web provides a visual panel for content expression and data display. It can have multiple pages, each containing different content. You can arrange the content of the page by adding components, accessing data for components, adding linkage events to components, etc., so that multiple pages can be displayed according to a certain logic. Among them, the component is the smallest visual element and cannot be further disassembled. It can include charts, texts, scenes, models, etc.
[0046] See also Figure 1 , Figure 1 A schematic diagram of an application environment according to an embodiment of the present application is shown, and the application environment may include a terminal 10 and a server 20. The terminal 10 and the server 20 may be directly or indirectly connected via wired or wireless communication. The target object (such as a target user) sends a first business request to be executed to the server 20 via the terminal 10. The server 20 receives the first business request and determines the parameter reference information carried by the first business request, the parameter reference information includes a source request identifier and source field information indicating the reference parameter; then, a target historical response result matching the source request identifier is determined from the response result set, the target historical response result is a response result of the target historical business request, the response result set includes the response results of at least two preset historical business requests, and the target historical business request is any one of the at least two preset historical business requests; furthermore, based on the source field information, the corresponding field content is extracted from the target historical response result, and the field content is determined as a reference parameter; finally, the reference parameter is used to update the first business request to obtain a second business request, and the second business request is executed. It should be noted that Figure 1 Just an example.
[0047] The terminal 10 may be a physical device such as a smart phone, a computer (such as a desktop computer, a tablet computer, a laptop computer), an augmented reality (AR) / virtual reality (VR) device, a digital assistant, an intelligent voice interaction device (such as an intelligent speaker), an intelligent wearable device, an intelligent home appliance, a vehicle-mounted terminal, etc. The operating system of the terminal 10 may be an Android system (Android system), an iOS system (a mobile operating system developed by Apple), a Linux system (an operating system), a Microsoft Windows system (Microsoft Windows operating system), etc. The terminal 10 may be installed with a client, such as a video client, a browser client, an information flow client, a travel client, a visual editing client, etc.
[0048] The server end 20 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server may include a network communication unit, a processor, a memory, and the like.
[0049] In practical applications, the service request processing method provided in the embodiment of the present application can be used in an intelligent traffic system (ITS). An intelligent traffic system, also known as an intelligent transportation system, is an effective and comprehensive application of advanced science and technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) to transportation, service control and vehicle manufacturing, strengthening the connection between vehicles, roads and users, thereby forming a comprehensive transportation system that ensures safety, improves efficiency, improves the environment and saves energy.
[0050] The electronic device that processes the first service request by the service request processing method provided in the embodiment of the present application may also be the above-mentioned terminal 10. Specifically, the service request processing may be implemented by a visual editing client installed in the terminal 10.
[0051] It should be noted that for business requests that are associated with user information, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0052] Figure 2 A flow chart of a method for processing a service request according to an embodiment of the present application is shown as follows: Figure 2 As shown, the service request processing method can be executed by an electronic device, which can be a terminal or a server, and the method includes:
[0053] S201: for a first service request to be executed, determining parameter reference information carried by the first service request, the parameter reference information including a source request identifier and source field information indicating a reference parameter;
[0054] In an embodiment of the present application, for a first service request to be executed, the electronic device determines the parameter reference information carried by the first service request. The first service request may be generated by the electronic device; the first service request may also be generated by other devices and sent to the electronic device. The first service request is in a pending execution state at this time. The first service request may be executed by the electronic device, at which point the electronic device performs preparatory work on the first service request before execution; the first service request may also be executed by other devices, at which point the electronic device performs preparatory work on the first service request before execution, and after the preparation work is completed, the electronic device sends the second service request corresponding to the first service request to the other device.
[0055] The parameter reference information is used to provide a basis for obtaining the reference parameters. The parameter reference information includes a source request identifier and source field information indicating the reference parameters. The source request identifier and source field information are positioning anchors in the acquisition basis, and can be used to implement the positioning of the reference parameters. It can be understood that the existence of the parameter reference information indicates that there are still reference parameters that need to be determined for the first business request, and the first business request cannot be executed yet. The preparatory work performed by the electronic device on the first business request before execution can determine whether the first business request carries parameter reference information; if it is determined that the first business request carries parameter reference information, the electronic device needs to obtain the reference parameters based on the parameter reference information, and then update the first business request to complete the preparatory work.
[0056] S202: Determine a target historical response result that matches the source request identifier from a response result set, where the target historical response result is a response result of a target historical service request, where the response result set includes respective response results of at least two preset historical service requests, and the target historical service request is any one of the at least two preset historical service requests;
[0057] In an embodiment of the present application, the electronic device determines the target historical response result that matches the source request identifier from the response result set. The aforementioned parameter reference information provides a basis for obtaining the reference parameter, and the response result set provides a data source for obtaining the reference parameter. The electronic device can determine the reference parameter from the response result set according to the parameter reference information.
[0058] The response result set includes the response results of at least two preset historical business requests. The time of obtaining the response result of each preset historical business request is earlier than the execution time of the first business request. Accordingly, the execution time of each preset historical business request is earlier than the execution time of the first business request. Since the electronic device is performing preparatory work for the execution of the first business request at this time, the first business request has not been executed yet, then it should be understood that the preset historical business request is a business request that is executed before the first business request. The execution time of each of the at least two preset historical business requests may be different. There may also be at least two requests with the same execution time in at least two preset historical business requests.
[0059] With the source request identifier as the first matching parameter, the target historical response result is determined from the response result set. It can be understood that the target historical response result is the response result of the target historical business request. The request identifier of the target historical business request matches the source request identifier. Accordingly, the maintenance of the response result set can be in the request identifier dimension, each response result corresponds to a business request, and each business request corresponds to a request identifier. In actual applications, a business request and its response result can appear as a set element in the response result set. In addition, for electronic devices, the response result set can be saved locally to improve the convenience of maintenance and application. Of course, the response result set can also be saved by other devices.
[0060] The target historical business request is any one of at least two preset historical business requests. If there is a difference in the execution time of at least two preset historical business requests, the target historical business request can be the request whose execution time is closest to the current time among the at least two preset historical business requests, or can be the request whose execution time is farthest from the current time among the at least two preset historical business requests. Exemplarily, at least two preset historical business requests and the first business request are a request chain, and the requests in the request chain are executed in sequence. If the request chain is represented by request 1-request 2-request 3-request 4 in order of execution, requests 1-3 are three preset historical business requests, and request 4 is the first business request. The target historical business request can be request 1 which is executed first, request 3 which is executed last, or request 2.
[0061] S203: extracting corresponding field content from the target historical response result based on the source field information, and determining the field content as the reference parameter;
[0062] In an embodiment of the present application, the electronic device extracts the corresponding field content from the target historical response result based on the source field information, and determines the field content as the reference parameter. After determining the target historical response result, the source field information is used as the second matching parameter to extract the corresponding field content from the target response result as the reference parameter. It can be understood that the target historical response result includes at least one field, and the field includes a field name and a field value. The source field information here can indicate the field name, and the field content can indicate the field value.
[0063] S204: Use the reference parameter to update the first service request to obtain a second service request, and execute the second service request.
[0064] In an embodiment of the present application, the electronic device updates the first business request using reference parameters, obtains the second business request, and executes the second business request. The reference parameters can be used as new content to implement the update of the first business request, and the reference parameters can also be used as replacement content to implement the update of the first business request. Thus, the electronic device completes the preparations before executing the first business request, and the second business request can be executed. The request parameters in the first business request are not fixed parameters, but depend on the reference parameters provided by the response results of the target historical business request, which ensures the dynamic nature of the request parameters in the first business request and the security of the first business request, because the return of the response results requires the execution of multiple requests. Such a setting method for the first business request is also more flexible. The request parameters in the current business request can come from the response results of other business requests that have been executed recently, and can also guarantee the timeliness of the request parameters in the current business request to a certain extent, thereby improving the timeliness of the current business request.
[0065] In conjunction with the example of the request chain in step S202, it should be noted that the first service request processed by the service request processing method provided by the embodiment of the present application can be any request in a request chain except the first request executed. The parameter reference information carried by the first service request is not limited to one.
[0066] The embodiments of the present application will be described in detail below.
[0067] As a possible implementation, for the aforementioned step S204, the second business request is used to call a business interface to obtain business data. After executing the second business request, the method may further include the following steps: first, receiving the target business data sent by the provider of the business interface, and determining that the target business data is a response result of the second business request; then, updating the response result set based on the response result of the second business request.
[0068] The first service request is executed to obtain service data, but due to the existence of parameter reference information, the first service request still has reference parameters that need to be determined, and the first service request cannot be executed. After the parameter reference information obtains the reference parameters and uses the reference parameters to update the first service request to obtain the second service request, the second service request can be executed, and the second service request is also executed to obtain service data. The second service request can obtain service data by calling the service interface.
[0069] The electronic device executes the second service request to obtain service data from the provider of the service interface by calling the service interface request. The provider of the service interface returns the target service data to the electronic device, and the electronic device determines the target service data as the response result of the second service request. If the response result set is stored locally, the electronic device can add the response result of the second service request to the response result set to update the response result set. If the response result set is stored by other devices, the electronic device can send an update request carrying the response result of the second service request to other devices, so that other devices add the response result of the second service request to the response result set to update the response result set. In addition, the maintenance of the response result set can be in the dimension of the request identifier. When the request identifier of the first service request is consistent with the request identifier of the second service request, the request identifier corresponding to the response result of the second service request can be the request identifier of the second service request. When the request identifier of the first service request is inconsistent with the request identifier of the second service request, the request identifier corresponding to the response result of the second service request can be the request identifier of the first service request. Of course, the service request and its response result can appear in the response result set as a set element. For example, the response results of the first service request and the second service request are taken as a set element; the response results of the first service request, the second service request, and the second service request are taken as a set element.
[0070] If the business request processing method provided in the embodiment of the present application is applied to the first platform, a visual editing function is provided to the user. The user can build a second platform with the help of the first platform, and the second platform can be a platform that provides services in more vertical fields (such as the field of smart transportation). The provider of the above-mentioned business interface can be a third-party platform (such as a third-party platform that provides real-time weather data). The second platform can also provide business intelligence, reporting, etc., which require data analysis and visual display platforms.
[0071] Here, the processing method for the response result of the current business request and the updating method for the response result set are provided. After each business request is executed and the response result is obtained, the response result will be used to update the current response result set. In this way, effective maintenance of the response result set can be achieved. Timely response result processing is also conducive to more accurate and effective preparation for the execution of subsequent business requests.
[0072] As a possible implementation, for the aforementioned step S204, the parameter reference information is located at the position to be replaced of the reference parameter in the first business request, and the position to be replaced is any position in the request address area, request header area, and request body area of the first business request. The use of the reference parameter to update the first business request to obtain the second business request may include the following steps: using the reference parameter to replace the parameter reference information in the first business request to obtain the second business request.
[0073] Compared with the parameter reference information only existing in the first business request, the parameter reference information is located in the position to be replaced of the referenced parameter in the first business request, which can reduce the amount of information of the parameter reference information in the applicable position of the referenced parameter, and can also implement more accurate replacement guidance for the referenced parameter, while also reducing the amount of data in the second business request. The position to be replaced of the referenced parameter can be any position in the request address area, request header area, and request body area of the first business request. This also provides support for the parameter reference information to exist in more diverse positions in the first business request. For example. The parameter reference information exists in position A in the first business request, and the subsequent referenced parameter replaces the parameter reference information, so that the referenced parameter exists in position A in the first business request.
[0074] As a possible implementation, please refer to Figure 6 As shown in the left figure, the first business request carries at least two of the parameter reference information, and the identification set is composed of the source request identifications respectively included in the at least two of the parameter reference information. The method may also include the following steps: when there is a first type of identification in the identification set, stopping the processing flow for the first business request, and there is no response result matching the first type of identification in the response result set.
[0075] Exemplarily, the first business request carries three parameter reference information, namely parameter reference information 1-3. Parameter reference information 1 includes source request identifier 1, which indicates request 1. Parameter reference information 2 includes source request identifier 2, which indicates request 2. Parameter reference information 3 includes source request identifier 3, which indicates request 3. If the response result set does not contain a response result for request 2, that is, source request identifier 2 is a first-class identifier, then it means that the response result for request 2 has not been returned normally. The failure to return the response result for request 2 also means that the first business request cannot obtain the corresponding reference parameter based on parameter reference information 2. In this case, the processing flow for the first business request can be stopped, and the preparatory work for the execution of the first business request will no longer be continued. This is conducive to the orderliness of the preparatory work for the execution of the first business request, can avoid obtaining business requests that cannot be executed, and can also reduce resource waste.
[0076] In combination with the above example, the response result set needs to contain the response results of requests 1-3 respectively, and the processing flow for the first service request can continue. In addition, at least two parameter reference information can indicate the same source request identifier, but different parameter reference information each includes different source field information.
[0077] As a possible implementation, for the aforementioned step S204, Figure 3 , Figure 6 As shown in the figure on the right side of , the first service request carries at least two of the parameter reference information, the at least two of the parameter reference information indicate the same position to be replaced in the first service request, the identification set is composed of the source request identifications respectively included in the at least two of the parameter reference information, and the target historical response result matching the source request identification is determined from the response result set, including:
[0078] S301: when there is at least one second-category identifier in the identifier set, determining a target identifier from the at least one second-category identifier according to a first preset rule, and there is a response result matching the second-category identifier in the response result set;
[0079] S302: Determine that the response result corresponding to the target identifier is the target historical response result.
[0080] Exemplarily, the first service request carries two parameter reference information, namely parameter reference information 1 and 2. Parameter reference information 1 includes source request identifier 1, which indicates request 1. Parameter reference information 2 includes source request identifier 2, which indicates request 2. If the response result set contains the response result of request 1 and / or the response result of request 2, that is, source request identifiers 1 and 2 are second-class identifiers, then it means that the response result of request 1 and / or the response result of request 2 are returned normally. Taking the response result set containing the response result of request 1 and the response result of request 2 as an example, the response result of request 1 and the response result of request 2 can both be used as the data source for obtaining the reference parameter. The target identifier can be determined from the two second-class identifiers according to the first preset rule, such as selecting the request identifier with a higher preset priority as the target identifier, and selecting the request identifier of the service request with an earlier response result return time as the target identifier. Correspondingly, the response result corresponding to the target identifier is the target historical response result. If it is determined that the source request identifier 2 is the target identifier, then the response result of request 2 is the target historical response result, so that the reference parameter obtained from the response result of request 2 will exist in the position to be replaced to obtain the second business request. Correspondingly, if the response result set does not contain the response result of request 1 and the response result of request 2, it means that the response result of request 1 and the response result of request 2 have not been returned normally, and it also means that the first business request cannot obtain the corresponding reference parameter based on parameter reference information 1 or parameter reference information 2. In this case, the processing flow for the first business request can be stopped, and the preparation work before execution of the first business request will no longer be continued. Of course, at least two parameter reference information can indicate the same source request identifier, but different parameter reference information each includes different source field information.
[0081] At least two parameter reference information indicating the application of the same position to be replaced in the first service request are provided here, which can further improve the dynamics of the request parameters in the first service request.
[0082] As a possible implementation, for the aforementioned step S204, Figure 4 As shown, the at least two preset historical business requests and the first business request form a request chain, the request chain is used to request to obtain the filling data of the page component, the second business request is used to call the business interface to obtain business data, and after executing the second business request, the method further includes:
[0083] S401: receiving target service data sent by the provider of the service interface;
[0084] S402: Update component configuration data of the target page according to the target business data.
[0085] At least two preset historical business requests and the first business request can be constituent elements of a request chain, which is used to request to obtain the fill data of the page component. The application of the request chain in the page processing scenario is provided here. The target page includes at least one component. The response result of the last executed business request in the request chain can provide support for the update of the component configuration data. The parameter reference information supports the dynamic nature of the request parameters in the last executed business request, improves the dynamic nature of the component configuration data, and thus improves the dynamic performance of the target page in visualization.
[0086] Exemplarily, the requests in the request chain are executed in sequence. If the request chain is represented by request 1-request 2-request 3-request 4 in order of execution, requests 1-3 are three preset historical business requests, and request 4 is the first business request. Due to the existence of parameter reference information, there are still reference parameters that need to be determined for the first business request, and the first business request cannot be executed yet. After the reference parameters are obtained from the parameter reference information and the reference parameters are used to update the first business request to obtain the second business request, the second business request can be executed. After the second business request is executed and a response result is obtained, the execution of the requests in the request chain is completed. The response result of the second business request (that is, the above-mentioned target business data) can be used as an updated data source for component configuration data. Of course, the response results of requests 1-3 can also be used as an updated data source for component configuration data.
[0087] The target page can be a service page in the field of smart transportation, such as a display page of a display screen in a subway station. The display content provided by the display page to passengers may involve real-time weather information, current and subsequent train information, emergency notifications, etc. The display content related to real-time weather information may correspond to a component of the display page, and the above request chain is used to request to obtain the fill data of the component. If the above target business data is the latest weather data obtained from a third-party platform that provides real-time weather data, the target business data will be used as fill data to update the component configuration data of the component. The component configuration data may include static configuration data and dynamic configuration data. Among them, static data is data that will not change with the fill data, such as the binding relationship between the component and the page area in the display page. Dynamic configuration data is data that will change with the fill data, such as the correspondence between the style of the component and the weather data indicated by the fill data. When the weather data indicated by the fill data indicates heavy snow, the style of the component is that the snowflakes fall with a large density.
[0088] Furthermore, after the component configuration data of the target page is updated according to the target business data, the following steps may be included: starting the execution task for the request chain at a preset time point, and the interval between the start time points of two adjacent execution tasks is determined based on a second preset rule. Considering the timeliness requirements of the visual content in the page processing scenario, the execution of the request chain can be carried out continuously, which is beneficial to the timeliness of the component content in the target page. The multiple intervals determined based on the second preset rule may be the same, for example, an execution task for the request chain is started once every hour. The multiple intervals determined based on the second preset rule may be different, for example, the multiple intervals in the daytime range are the same, the multiple intervals in the nighttime range are the same, and the interval indicated in the daytime range is smaller than the interval indicated in the nighttime range.
[0089] The service request processing method provided in the embodiment of the present application can be applied to a platform that provides a visual editing function, such as RayData Web. The processing of API requests will be described in detail below. Figure 8-11 As shown, users can set service requests through the interface. The interface shows the "pre-request" switch, which is turned off by default (see Figure 8 ). Turn on this switch (see Fig. 9 , Fig. 9 The add icon is shown, which can be used to start the process of adding a pre-request. Multiple preset API requests can be used as candidate sources for pre-requests. After that, you can add a pre-request for the business request (see Fig.10 , 11 ), you can add multiple pre-requests to a business request. The expected execution time of the pre-request is earlier than the expected execution time of the business request. The response result of the pre-request will be used as the data source for obtaining the reference parameter in the business request. Fig.11 It also shows whether to check or not. If you check, then if the response result of the previous request is not returned normally, the execution of the request chain will be interrupted and the subsequent request will not be made. If you do not check, then no matter whether the response result of the previous request is returned normally, it will not affect the subsequent request.
[0090] The example provided here involves requests 1-3. The above business request is request 3, and its predecessor requests are request 1 and request 2. Fig.14 In the figure, preAPI_1 represents request 1 and preAPI_2 represents request 2. At the same time, for request 2, its predecessor is request 1, which can be referred to Fig.13 preAPI_1 represents request 1. For the convenience of description, the following uses the latter request to refer to request 2 and request 3 that require parameter reference information to be filled in.
[0091] The parameter reference information can be filled in the position to be replaced in the subsequent request reference parameter, please refer to Fig.13 , 14 . The request address area for subsequent requests (corresponding to Figure 12-14 URL in the request header area, request body area (corresponding to Figure 12-14 Body parameters in the request) can be referenced through parameter reference information. Parameter reference information is filled in the subsequent request in a specific format, that is, ${prefix request name.$.content to be referenced}.
[0092] Figure 7 Shows the reference logic of parameters between three requests. Figure 7 The following is an introduction to the filling and application of parameter reference information in the example:
[0093] 1) Switch on the "Pre-Request" switch; add the first pre-request and name it preAPI_1; select the request method (such as POST, GET); enter the URL address, request header and Body parameters of the first pre-request; click Fig.12 Click the test button to view the response result of the first pre-request. In the response result, the field content in data needs to be referenced in the subsequent request. The field value corresponding to randomKey should be used as the request parameter of the second pre-request, and the field value corresponding to token should be used as the request parameter of the business request.
[0094] 2) Add a second pre-request and name it preAPI_2; select the request method; enter the URL address, request header, and Body parameters of the second pre-request, and fill the field value corresponding to randomKey in preAPI_1 into the Body parameter in the format of ${preAPI_1.$.data.randomKey}; click Fig.13 Click the test button to view the response result of the second preceding request. In the response result, the field content in result needs to be referenced in the subsequent request.
[0095] 3) Fill in the relevant parameters of the business request, including the request method, URL address, request header and Body parameters. Fig.14 As shown, fill the field value corresponding to token in the response result of the first pre-request into the relevant fields of the request header in the format of ${preAPI_1.$.data.token}, and add a bearer in front for back-end encryption processing. In this way, the content of the relevant fields in the request header is not a fixed value, but refers to the content of the response result of the first pre-request. Fill the field value corresponding to spaceCode in the response result of the second pre-request into the relevant parameters of the URL address in the format of ${preAPI_2.$.data.spaceCode}. Click Fig.14 Click the test button to view the response result of the business pre-request.
[0096] In practical applications, for electronic devices that execute the service request processing method provided in the embodiments of the present application, the operating hardware environment is: CPU: p4 or above, memory: 256M or above. Operating software system: Windows, Mac, Linux and other browser systems that can be run. For the processing of an API request, the Fetch / XMLHttpRequest method provided by JavaScript can be used to call the service interface by passing in the address and parameters to be requested to obtain the response result. The execution of each API request can be handled by a thread.
[0097] For maintenance of requests and response results, please refer to Figure 5 After the serialized requests are set up, the request-related information of each request (such as URL, request method, request header, and request body) can be saved in the request information storage in the object dimension. For the execution of serialized requests, the request information storage can be traversed by objects. When traversing to an object, the request-related information of the current API request can be filtered first. If there is a specified character identifier (${prefix request name.$.content to be quoted}), the character identifier is regexed to obtain the prefix request name and the content to be quoted; then the prefix request corresponding to the prefix request name is searched in the request information storage; then the value corresponding to the content to be quoted is obtained from the response result of the prefix request; then the character identifier is replaced with this value, and then the API request is made through the Fetch / XMLHttpRequest method. The response result of the current API request will also be saved in the object corresponding to the current API request in the request information storage, which is convenient for character identifier search and replacement of subsequent requests.
[0098] It can be seen from the technical solutions provided by the above embodiments of the present application that the embodiments of the present application provide a more flexible and adaptable business request processing solution. In the embodiments of the present application, reference parameters can be obtained from the response results of historical business requests based on the parameter reference information carried by the current business request, and then the current business request can be updated using the reference parameters to achieve dynamic parameter entry. In this way, the request parameters in the business request are more dynamic, and the business request itself is more flexible. Compared with the support of business requests for related use functions or related sub-functions in related technologies, the business request processing solution provided by the present application is more conducive to the adaptability of application scenarios of related use functions or related sub-functions. At the same time, the determination of the request parameters in the current business request is based on the parameter reference information and the response results of the historical business request are used as the data source, which can also improve the security of the current business request.
[0099] The present application also provides a service request processing device, such as Fig.15 As shown, the service request processing device 150 includes:
[0100] Determining module 1501: for determining, for a first service request to be executed, parameter reference information carried by the first service request, the parameter reference information including a source request identifier and source field information indicating a reference parameter;
[0101] Matching module 1502: used to determine a target historical response result that matches the source request identifier from a response result set, wherein the target historical response result is a response result of a target historical service request, wherein the response result set includes respective response results of at least two preset historical service requests, and the target historical service request is any one of the at least two preset historical service requests;
[0102] Extraction module 1503: used to extract corresponding field content from the target historical response result based on the source field information, and determine the field content as the reference parameter;
[0103] Update module 1504: used to update the first service request using the reference parameter, obtain a second service request, and execute the second service request.
[0104] In one embodiment, the device also includes a set update module, which is used to: when the second business request is used to call a business interface to obtain business data, after executing the second business request, receive target business data sent by the provider of the business interface, and determine that the target business data is a response result of the second business request; update the response result set based on the response result of the second business request.
[0105] In one embodiment, the parameter reference information is located at a position to be replaced of the reference parameter in the first business request, and the position to be replaced is any position in a request address area, a request header area, and a request body area of the first business request. Using the reference parameter to update the first business request to obtain a second business request includes: using the reference parameter to replace the parameter reference information in the first business request to obtain the second business request.
[0106] In one embodiment, the first business request carries at least two of the parameter reference information, and the identification set is composed of the source request identifications respectively included in the at least two of the parameter reference information. The device also includes a processing flow stopping module, and the processing flow stopping module is used to stop the processing flow for the first business request when there is a first type of identification in the identification set, and there is no response result matching the first type of identification in the response result set.
[0107] In one embodiment, the first business request carries at least two of the parameter reference information, the at least two of the parameter reference information indicate the same position to be replaced in the first business request, the identification set is composed of the source request identification included in each of the at least two of the parameter reference information, and the determining of the target historical response result that matches the source request identification from the response result set includes: when there is at least one second-category identification in the identification set, determining the target identification from the at least one second-category identification according to a first preset rule, and there is a response result that matches the second-category identification in the response result set; and determining that the response result corresponding to the target identification is the target historical response result.
[0108] In one embodiment, the at least two preset historical business requests and the first business request are a request chain, the request chain is used to request to obtain the fill data of the page component, the second business request is used to call the business interface to obtain business data, and the device also includes a component configuration data update module, the component configuration data update module: is used to receive the target business data sent by the provider of the business interface after executing the second business request; and update the component configuration data of the target page according to the target business data.
[0109] Furthermore, the device also includes an execution task starting module, which is used to start the execution task for the request chain at a preset time point after the component configuration data of the target page is updated according to the target business data, and the interval between the start time points of two adjacent execution tasks is determined based on a second preset rule.
[0110] It should be noted that the device and method embodiments in the device embodiment are based on the same inventive concept.
[0111] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0112] The embodiment of the present application also provides a computer-readable storage medium, wherein at least one instruction or at least one program is stored in the computer-readable storage medium, and the at least one instruction or at least one program is loaded and executed by a processor to implement the above method. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0113] An embodiment of the present application also provides an electronic device, which includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the at least one processor to implement the above method.
[0114] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0115] Fig.16 A block diagram of an electronic device according to an embodiment of the present application is shown. Fig.16 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0116] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0117] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.
[0118] The present application may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying at least one instruction or at least one program for causing a processor to implement various aspects of the present application.
[0119] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0120] At least one instruction or at least one program described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives at least one instruction or at least one program from the network, and forwards the at least one instruction or at least one program for storage in a computer-readable storage medium in each computing / processing device.
[0121] At least one instruction or at least one program for performing the operation of the present application can be an assembly instruction, an instruction set architecture (ISA) instruction, a machine instruction, a machine-related instruction, a microcode, a firmware instruction, a state setting data, or a source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C +, etc., and conventional procedural programming languages such as "C" language or similar programming languages. At least one instruction or at least one program can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by utilizing the status information of at least one instruction or at least one program to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute at least one instruction or at least one program, thereby realizing various aspects of the present application.
[0122] Various aspects of the present application are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by at least one instruction or at least one program.
[0123] The at least one instruction or at least one program can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. The at least one instruction or at least one program can also be stored in a computer-readable storage medium, and these instructions enable the computer, programmable data processing device and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0124] At least one instruction or at least one program may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are executed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0125] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present application. In this regard, each square frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the above-mentioned module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the standard function in the square frame can also occur in a sequence different from the standard in the accompanying drawings. For example, two continuous square frames can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square frame in the block diagram and / or flow chart, and the combination of the square frames in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0126] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for processing a business request, It is characterized in that The method comprises: For a first service request to be executed, determining parameter reference information carried by the first service request, the parameter reference information including a source request identifier and source field information indicating a reference parameter; Determine a target historical response result that matches the source request identifier from the response result set, the target historical response result is a response result of a target historical service request, the response result set includes respective response results of at least two preset historical service requests, and the target historical service request is any one of the at least two preset historical service requests; Extracting corresponding field content from the target historical response result based on the source field information, and determining the field content as the reference parameter; The first service request is updated using the reference parameter to obtain a second service request, and the second service request is executed.
2. The method according to claim 1, It is characterized in that The second service request is used to call a service interface to obtain service data. After executing the second service request, the method further includes: Receiving target service data sent by a provider of the service interface, and determining that the target service data is a response result of the second service request; The response result set is updated based on the response result of the second service request.
3. The method according to claim 1, It is characterized in that The parameter reference information is located at a position to be replaced of the reference parameter in the first service request, the position to be replaced is any position in a request address area, a request header area, and a request body area of the first service request, and the updating of the first service request by using the reference parameter to obtain a second service request includes: The parameter reference information in the first service request is replaced by the reference parameter to obtain the second service request.
4. The method according to any one of claims 1 to 3, It is characterized in that The first service request carries at least two pieces of the parameter reference information, the identification set is composed of the source request identifications respectively included in the at least two pieces of the parameter reference information, and the method further includes: When the identifier set includes a first type of identifier, the processing flow for the first service request is stopped, and the response result set includes no response result matching the first type of identifier.
5. The method according to claim 1 or 2, It is characterized in that The first service request carries at least two of the parameter reference information, the at least two of the parameter reference information indicate the same position to be replaced in the first service request, the identifier set is composed of the source request identifiers respectively included in the at least two of the parameter reference information, and determining the target historical response result matching the source request identifier from the response result set includes: In the case where there is at least one second-category identifier in the identifier set, determining a target identifier from the at least one second-category identifier according to a first preset rule, and there is a response result matching the second-category identifier in the response result set; Determine that the response result corresponding to the target identifier is the target historical response result.
6. The method according to claim 1, It is characterized in that The at least two preset historical business requests and the first business request form a request chain, the request chain is used to request to obtain filling data of the page component, the second business request is used to call a business interface to obtain business data, and after executing the second business request, the method further includes: Receiving target service data sent by the provider of the service interface; The component configuration data of the target page is updated according to the target business data.
7. The method according to claim 6, It is characterized in that After the component configuration data of the target page is updated according to the target business data, the method includes: The execution task for the request chain is started at a preset time point, and the interval between the start time points of two adjacent execution tasks is determined based on a second preset rule.
8. A service request processing device, It is characterized in that The device comprises: A determination module: configured to determine, for a first service request to be executed, parameter reference information carried by the first service request, wherein the parameter reference information includes a source request identifier and source field information indicating a reference parameter; A matching module: used to determine a target historical response result that matches the source request identifier from a response result set, wherein the target historical response result is a response result of a target historical service request, wherein the response result set includes respective response results of at least two preset historical service requests, and the target historical service request is any one of the at least two preset historical service requests; Extraction module: used for extracting corresponding field content from the target historical response result based on the source field information, and determining the field content as the reference parameter; Update module: used to update the first service request using the reference parameter, obtain the second service request, and execute the second service request.
9. An electronic device, It is characterized in that The electronic device includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the at least one processor to implement the service request processing method as described in any one of claims 1-7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the service request processing method according to any one of claims 1 to 7.