CN117749780A - Service data reporting method and related equipment - Google Patents

Service data reporting method and related equipment Download PDF

Info

Publication number
CN117749780A
CN117749780A CN202311797330.3A CN202311797330A CN117749780A CN 117749780 A CN117749780 A CN 117749780A CN 202311797330 A CN202311797330 A CN 202311797330A CN 117749780 A CN117749780 A CN 117749780A
Authority
CN
China
Prior art keywords
data
method name
service
response
message queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311797330.3A
Other languages
Chinese (zh)
Inventor
王鹏飞
邱明明
郭泽渊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202311797330.3A priority Critical patent/CN117749780A/en
Publication of CN117749780A publication Critical patent/CN117749780A/en
Pending legal-status Critical Current

Links

Landscapes

  • Telephonic Communication Services (AREA)

Abstract

The disclosure provides a service data reporting method and related equipment, and relates to the technical field of big data processing. Acquiring request information of a terminal for service data, and acquiring response information after a service interface executes the request information; identifying a method name executed by a service interface in response information, wherein the response information comprises at least one method name and response data corresponding to the at least one method name; if a method name exists in the preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to the server, so that the server provides the first data for the terminal to inquire. The method and the device for reporting the service data after the service request method is executed solve the problems that the whole code is difficult to maintain and modify due to the fact that the running water reporting code, the message queue connection and the code for sending the message are required to be implanted in the service operation flow.

Description

Service data reporting method and related equipment
Technical Field
The disclosure relates to the technical field of big data processing, in particular to a service data reporting method and related equipment.
Background
With the development of economy, internet technology is continuously iterated, and more industries are moved from offline to online. For example, in the financial field, forms of remote account opening, remote credit, remote card opening, remote financial management, and the like are presented. Meanwhile, as the mode of handling business through the Internet is convenient for the common people, the business handling efficiency is improved, and the online and online financial activities can be continued and more frequent. However, when the internet of things service is handled, the user sometimes calls the phone of the customer service staff to conduct corresponding complaints due to failure of service opening, and the customer service staff can find out the research staff to check the log.
In the related technology, in order to save time, an activation flow is developed, and customer service personnel and operators can trace user operation logs in an operation background through the activation flow, so that the reason of service opening failure of the user is positioned. However, the service running log is reported, the code reported by running water is manually implanted at the inlet and the outlet of the service code by a researcher, and the code reported by running water, the code for connecting a message queue and sending a message are also implanted in the service running process, so that the coupling degree of the newly added code and the service code is high, and the whole code is difficult to maintain and modify.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure provides a service data reporting method and related equipment, which at least overcome the problem of high code coupling degree in the related technology to a certain extent.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to one aspect of the present disclosure, there is provided a service data reporting method, which is characterized by comprising: acquiring request information of a terminal for service data, and acquiring response information after a service interface executes the request information; identifying a method name executed by a service interface in the response information, wherein the response information comprises at least one method name and response data corresponding to the at least one method name; if a method name exists in a preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to a server, so that the server provides the first data for the terminal to inquire.
In some embodiments, the obtaining the first data according to the method name and the response data corresponding to the method name includes: and according to preset configuration information, performing target data format conversion on the method name and the corresponding response data thereof to obtain first data.
In some embodiments, the preset configuration information includes one or more of the following information: the key value is in the data format; an extensible markup language format; parameter names or null formats to be acquired; data serialization format.
In some embodiments, the performing the target data format conversion on the method name and the corresponding response data according to the preset configuration information to obtain the first data includes: and configuring the method name as a key according to preset configuration information, and configuring response data corresponding to the method name as a value to obtain a key value pair as first data.
In some embodiments, the method further comprises: generating a target component, wherein the target component is used for executing the method name for identifying the service interface execution in the response information when the target component is called; if a method name exists in a preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to a server.
In some embodiments, the method further comprises: and configuring a calling mode of the target component, wherein the calling mode is used for calling the target component after the response information is obtained.
In some embodiments, the method further comprises: if a plurality of method names exist in a preset configuration file, a plurality of first data are obtained according to each method name and response data corresponding to each method name, and the plurality of first data are sent to a message queue; and sending the first data stored in the message queue to a server, so that the server provides the first data for the terminal to inquire.
According to another aspect of the present disclosure, there is also provided a service data reporting apparatus, including: the response information determining module is used for acquiring the request information of the terminal for the service data, and obtaining response information after the service interface executes the request information; the method name identification module is used for identifying the method names executed by the service interfaces in the response information, wherein the response information comprises one or more method names and corresponding response data; the message queue sending module is used for sending a method name and corresponding response data to the message queue if the method name exists in a preset configuration file; and the server sending module is used for sending the first data stored in the message queue to a server, so that the server provides the data stored in the message queue for the terminal to inquire.
According to another aspect of the present disclosure, there is also provided an electronic device including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the traffic data reporting method of any one of the above via execution of the executable instructions.
According to another aspect of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the service data reporting method of any one of the above.
According to another aspect of the present disclosure, there is also provided a computer program product, including a computer program, which when executed by a processor implements the service data reporting method of any one of the above.
According to the service data reporting method provided by the embodiment of the disclosure, request information of a terminal for service data is obtained, and response information is obtained after a service interface executes the request information; identifying a method name executed by a service interface in response information, wherein the response information comprises at least one method name and response data corresponding to the at least one method name; if a method name exists in the preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to the server, so that the server provides the first data for the terminal to inquire. The method and the device for reporting the service data after the service request method is executed solve the problems that the whole code is difficult to maintain and modify due to the fact that the running water reporting code, the message queue connection and the code for sending the message are required to be implanted in the service operation flow.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
Fig. 1 is a schematic diagram illustrating a structure of a service data reporting system according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a method for reporting service data in an embodiment of the disclosure;
fig. 3 is a flowchart illustrating a specific example of a service data reporting method in an embodiment of the disclosure;
fig. 4 is a flowchart illustrating another specific example of a service data reporting method in an embodiment of the disclosure;
fig. 5 is a flowchart illustrating another specific example of a service data reporting method in an embodiment of the disclosure;
fig. 6 shows a schematic diagram of a service data reporting device in an embodiment of the disclosure;
FIG. 7 illustrates a block diagram of a computer device in an embodiment of the present disclosure;
fig. 8 shows a schematic diagram of a computer-readable storage medium in an embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
For ease of understanding, before describing embodiments of the present disclosure, several terms referred to in the embodiments of the present disclosure are first explained as follows:
HTTP: hypertext Transfer Protocol, hypertext transfer protocol;
HTTP request: HTTP Request, a Request message from a client to a server, comprising: in the first line of the message, a request method for the resource, an identifier of the resource and a protocol used;
URL: uniform Resource Locator, uniform resource locator system;
java: a portal object-oriented programming language;
c language: a process-oriented, abstract generic programming language;
cookie: data stored on the user's local terminal, information temporarily or permanently stored by the user's client computer;
AOP: aspect Oriented Programming, the main operation object is the section, which is the operation to be executed before, during, after the return value and after the exception of the method;
message queues: the Message Queue has wide application in a distributed system, and meets the requirements of asynchronism, decoupling and the like;
the Web: world Wide Web, a global Wide area network, also known as the World Wide Web;
Form: the form is used for filling information into a visitor in a Web page, so that client information can be acquired, and the Web page has an interactive function;
SDK: software Development Kit, a software development kit, is a collection of development tools used by software engineers to build application software for a particular software package, software framework, hardware platform, operating system, etc.
The following detailed description of embodiments of the present disclosure refers to the accompanying drawings.
Fig. 1 shows a schematic diagram of an exemplary application system architecture to which a service data reporting method according to an embodiment of the present disclosure may be applied. As shown in fig. 1, the system architecture may include a terminal device 101, a network 102, and a server 103.
The medium used by the network 102 to provide a communication link between the terminal device 101 and the server 103 may be a wired network or a wireless network.
Alternatively, the wireless network or wired network described above uses standard communication techniques and/or protocols. The network is typically the Internet, but may be any network including, but not limited to, a local area network (Local Area Network, LAN), metropolitan area network (Metropolitan Area Network, MAN), wide area network (Wide Area Network, WAN), mobile, wired or wireless network, private network, or any combination of virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including HyperText Mark-up Language (HTML), extensible markup Language (Extensible MarkupLanguage, XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as secure sockets layer (Secure Socket Layer, SSL), transport layer security (Transport Layer Security, TLS), virtual private network (Virtual Private Network, VPN), internet security protocol (Internet Protocol Security, IPSec), etc. In other embodiments, custom and/or dedicated data communication techniques may also be used in place of or in addition to the data communication techniques described above.
The terminal device 101 may be a variety of electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, smart speakers, smart watches, wearable devices, augmented reality devices, virtual reality devices, and the like.
In one example, a terminal device obtains request information of a user side for service data, and response information is obtained after a service interface executes the request information; identifying a method name executed by a service interface in response information, wherein the response information comprises at least one method name and response data corresponding to the at least one method name; if a method name exists in the preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to the server, so that the server provides the first data for the terminal to inquire.
Alternatively, the clients of the applications installed in different terminal devices 101 are the same or clients of the same type of application based on different operating systems. The specific form of the application client may also be different based on the different terminal platforms, for example, the application client may be a mobile phone client, a PC client, etc.
The server 103 may be a server providing various services, such as a background management server providing support for devices operated by the user with the terminal apparatus 101. The background management server can analyze and process the received data such as the request and the like, and feed back the processing result to the terminal equipment.
Optionally, the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like.
Those skilled in the art will appreciate that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative, and that any number of terminal devices, networks, and servers may be provided as desired. The embodiments of the present disclosure are not limited in this regard.
Under the system architecture, the embodiment of the disclosure provides a service data reporting method, which can be executed by any electronic device with computing processing capability.
In some embodiments, the service data reporting method provided in the embodiments of the present disclosure may be executed by a terminal device of the above system architecture; in other embodiments, the service data reporting method provided in the embodiments of the present disclosure may be executed by a server in the system architecture described above; in other embodiments, the service data reporting method provided in the embodiments of the present disclosure may be implemented by a terminal device and a server in the system architecture in an interactive manner.
Fig. 2 shows a flowchart of a service data reporting method in an embodiment of the present disclosure, and as shown in fig. 2, the service data reporting method provided in the embodiment of the present disclosure includes the following steps:
s202, acquiring request information of a terminal for service data, and obtaining response information after the service interface executes the request information.
It should be noted that, the service data may be data describing a user when handling a service on a network, for example, data generated when the user opens a service product. The request information may be an interface request, for example, HTTP request information, for example, a user requests to open a service, and the user side sends a request for opening the service to the server, that is, when the user clicks to access a certain ue address, links, or submits a Form, the browser sends request data to the server. Specifically, the request information may be a request message, including: the method comprises four parts of a request line, a request head, an empty line and a request text, wherein the request line part comprises a request method, a request address and an HTTP version; the request header portion includes the domain name address of the request sending server, the request body content length, the encoding format of the request body, user agent information (telling the server who is sending the request), etc., and the request body portion includes JSON data. The interface may be a software class interface, which refers to a type of reference defining an agreement, such as an interface in Java, an interface in C language, an object oriented interface, etc. The response information may be a response message. Wherein, the response message is composed of: the state line comprises an HTTP version number, a response state code and a response state code description; the response header comprises server information, time for creating a response message, coding format of returned content and Cookie information; the response body includes interface response data.
S204, identifying a method name executed by the service interface in the response information, wherein the response information comprises at least one method name and response data corresponding to the at least one method name.
It should be noted that the method name may be an actual name of the method, for example, the method is a code block with a function, the code block is placed in a bracket separately { }, and a name is given to the code block, and this name is the name of the method.
S206, if a method name exists in the preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to the message queue.
It should be noted that the preset configuration file may be a set including one or more method names, for example, the method names of the data that needs to be saved in the pipeline are stored in the preset configuration file. The first data may include a method name and response data corresponding to the method name. The message may be data transferred between applications, such as data containing embedded objects or text strings. The message queue may be a communication mode between applications (application programs and application programs), and the message may be returned immediately after being sent, so that the message system ensures reliable delivery of the message. Message queues are typical: the method has the advantages that the producer and the consumer model are adopted, the producer continuously produces the message in the message queue, and the consumer continuously obtains the message from the queue, because the production and the consumption of the message are asynchronous, only the sending and the receiving of the message are concerned, the invasion of business logic is avoided, and the decoupling of the producer and the consumer can be realized. The message queue can be applied to decoupling, asynchronization, peak clipping and other scenes.
In one example, the first data is obtained and executed in the association container according to a method name and response data corresponding to the method name. For example, the request is entered into the set of associated containers, the response results, and the in-process important data are placed into the set of associated containers, and the request is named Req, the response results are named Res, and the in-process data are named DetalMap. The association container may be a dictionary (association dictionary), for example, a MAP dictionary, where the purpose of the dictionary is to perform format conversion on the method name and the corresponding data according to preset information, so as to obtain the first data.
In another example, if a plurality of method names exist in the preset configuration file, a plurality of first data are obtained according to each method name and response data corresponding to each method name, and the plurality of first data are sent to the message queue; and sending the first data stored in the message queue to the server, so that the server provides the first data for the terminal to inquire. By configuring a plurality of method names in the configuration file, a plurality of pieces of data can be efficiently processed.
And S208, the first data stored in the message queue is sent to the server, so that the server provides the first data for the terminal to inquire.
For example, after receiving a message (corresponding to the first data) sent by the message queue, the server stores the data in a database or a search engine; the operator can dynamically query the data in the database (corresponding to the first data) through the interface. The search engine can be an elastomer search for distributed full text retrieval; the database may be any data storage middleware in a Clickhouse database, an Hbase database, a monglodb database, a MySQL database, a TiDB database, and in one example, to save storage cost, the first data is stored in the Clickhouse database with data compression characteristics.
After the service request method is executed, the service data reporting is executed, and the problem that the whole code is difficult to maintain and modify due to the fact that a running water reporting code, a message queue connection code and a message sending code are needed to be implanted in a service operation flow is solved.
In an embodiment of the present disclosure, as shown in fig. 3, in the service data reporting method provided in the embodiment of the present disclosure, the first data is obtained through the following steps, so that accurate parameter information can be obtained, and dynamic value of a reporting field is achieved:
S302, according to preset configuration information, performing target data format conversion on a method name and corresponding response data to obtain first data.
In one example, the preset configuration information includes one or more of the following: key-value to data format (JSON); extensible markup language format (XML); parameter names or null formats (Properties) to be collected; data serialization format (YML). The format of the standard JSON (JSON string) is: the format of Key Value, key is a Key, value is a Value, say, { Key ": "Value", which may be a common string, number, boolean variable, array, JSON object. The configuration of the response to the plurality of types of data can be performed through the plurality of configuration information.
In a specific example, the configuration (corresponding to the preset configuration information) adopts a JSON format, and the data Key format is a class name, the method name, the data Value format is a JSON format, and the method mainly comprises the following fields:
enabled: whether this component is enabled, true indicates enabled, false indicates off;
ActChannel: activating a channel, filling in a fixed value, and dynamically taking a value from a request input parameter according to JSONPath grammar;
ActStep: an activation step, generally configured as a method name, for identifying a current running process of the user;
PIN: the unique user identifier can be dynamically valued from the request input parameters according to the JSONPath grammar;
ActCode: responding to the Code identification, dynamically taking a value from the request input parameters according to JSONPath grammar, and identifying whether the user request is successful or failed currently;
failnfo: responding to the result prompt information, and dynamically taking values from the request input parameters according to the JSONPath grammar;
ext2: an extension field which can dynamically take value from the request input parameters according to the JSONPath grammar;
SeqNo: the serial number can be dynamically valued from the request input parameters according to the JSONPath grammar and is used for connecting the requests of users in series to form a visualized call link.
Note that JSONPath syntax is a method of extracting part of the content of a given JSON document.
Analyzing the data reported by the streaming, and putting all the data into MAP data according to the configuration, wherein the streaming report mainly adopts a JSON format common to the industry, and the data fields and meanings in the streaming format (corresponding to the first data) comprise:
ActCode: responding to the code value;
PIN: a user unique identifier;
SeqNo: serial number;
ActChannel: a channel;
ActStep: a step or node;
failnfo: prompting information;
production type: a product type;
ext2: an extension field identification;
DetailMap: first information to be reported (other detailed information), JSON object format;
DetailJson: second information to be reported (other detailed information), JSON string format.
In an embodiment of the present disclosure, as shown in fig. 4, the method for reporting service data provided in the embodiment of the present disclosure performs target data format conversion through the following steps, so that the read-write performance of data can be improved, and specific values in the data can be accessed quickly:
s402, configuring a method name as a key and configuring response data corresponding to the method name as a value according to preset configuration information, and obtaining a key value pair as first data.
In one embodiment of the present disclosure, as shown in fig. 5, the service data reporting method provided in the embodiment of the present disclosure generates a target component, encapsulates a method for generating first data, and packages the first data into a reusable component, so that coupling of service codes and storage cost of service flowing water can be reduced, and cost reduction and efficiency improvement are achieved:
s502, generating a target component, wherein the target component is used for executing a method name executed by a service interface in the identification response information when the target component is called; if a method name exists in the preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to the server.
The method and the device package public capacity (service data reporting method) into reusable components (corresponding to the target components), and reduce the coupling of service codes and the storage cost of service flow water through the capacity, thereby realizing cost reduction and efficiency improvement.
After the service request method is executed, the encapsulated target assembly is called, the data to be acquired is determined according to the preset configuration file, the data to be acquired is sent to the server to be provided for the terminal to inquire, and the problem that the whole code is difficult to maintain and modify due to the fact that a running water reporting code, a message queue connection and a message sending code are needed to be implanted in a service operation flow is solved.
In a specific example, a calling mode of the target component is configured, and the calling mode is used for calling the target component after the response information is obtained. By configuring the call of the target component, the service data reporting can be ensured after the service is responded, so that one interface only sends one piece of running water (service data reporting), and the consumption of storage resources is reduced.
In one embodiment of the present disclosure, first, is the implementation of the component SDK: intercepting an application outermost interface by utilizing an AOP section programming technology, wherein the interceptor has the lowest priority, so that the last execution is ensured after the logic processing of the application interface is completed; after the service interface is executed, identifying the name of the method executed by the current request interface (equivalent to the service interface), judging whether the name exists in the configuration, and if so, continuing to execute the next flow; putting important data in the request input, the response result and the process into a MAP dictionary set, naming the request input as Req, naming the response result as Res, and naming the data in the process as DetailMap; the data in the map dictionary set is submitted to a thread queue for asynchronous reporting in a multithreading mode, and the process comprises the following steps: according to the interface method name loading configuration, the configuration mode is JSON format, the data reporting value field is configured by adopting JSON path grammar, and the dynamic value of the reporting field can be realized by using the mode; analyzing the data reported by the streaming water according to the configuration, and completely putting the data into MAP data; data in the MAP is sent to a message queue. Wherein, the execution completion includes: interface request, business logic processing and interface response, wherein the completion of execution is indicated after the interface response is obtained, namely, the completion of the execution of the request method is requested. Interception of the tangent plane programming technique includes: executing after the execution of the request method is finished, and putting data in and out of an execution interface and in the process of parameter outputting into a MAP dictionary; loading configuration from a memory; dynamically analyzing data according to the configuration and the request data; and sending the message. Then, application access: before a user accesses, a component SDK package provided by a running platform is introduced into an engineering, and the configuration of AOP section (configuration center service for pushing configuration information) interception is added into a configuration file of the engineering, and an initialization method in the SDK package is automatically invoked in the application starting process, wherein the initialization method comprises configuration initialization and message queue sender initialization. Finally, the flow treatment: after receiving the message sent by the message queue, the server side stores the data into an elastic search; the operator can dynamically query the data in the elastiscearch through the interface. For example, the embodiment operation flow may include the following steps: referencing a component SDK; starting an application; loading configuration; initializing a component; a user initiates a request; the business processing is started; the business processing is completed; automatically assembling running water; reporting the running water; running water and warehousing; and (5) carrying out flow query.
It should be noted that, in the technical solution of the present disclosure, the acquiring, storing, using, processing, etc. of data all conform to relevant regulations of national laws and regulations, and various types of data such as personal identity data, operation data, behavior data, etc. relevant to individuals, clients, crowds, etc. acquired in the embodiments of the present disclosure have been authorized.
Based on the same inventive concept, the embodiments of the present disclosure further provide a service data reporting device, as described in the following embodiments. Since the principle of solving the problem of the embodiment of the device is similar to that of the embodiment of the method, the implementation of the embodiment of the device can be referred to the implementation of the embodiment of the method, and the repetition is omitted.
Fig. 6 shows a schematic diagram of a service data reporting device in an embodiment of the present disclosure, where, as shown in fig. 6, the device includes: the response information determination module 61, the method name identification module 62, the message queue transmission module 63, the server transmission module 64, the component generation module 65 and the component calling module 66.
The response information determining module 61 is configured to obtain request information of the terminal for service data, and obtain response information after the service interface executes the request information;
The method name identifying module 62 is configured to identify a method name executed by the service interface in response information, where the response information includes one or more method names and corresponding response data thereof;
a message queue sending module 63, configured to send a method name and corresponding response data to the message queue if the method name exists in the preset configuration file;
the server sending module 64 is configured to send the first data stored in the message queue to the server, so that the server provides the data stored in the message queue to the terminal for querying.
In one example of the present disclosure, the server sending module 64 is further configured to: and according to preset configuration information, performing target data format conversion on a method name and corresponding response data thereof to obtain first data.
In an example of the present disclosure, the configuration information preset in the message queue sending module 63 includes one or more of the following information: the key value is in the data format; an extensible markup language format; parameter names or null formats to be acquired; data serialization format.
In one example of the present disclosure, the server sending module 64 is further configured to: and configuring the method name as a key according to preset configuration information, and configuring response data corresponding to the method name as a value to obtain a key value pair as first data.
In an example of the present disclosure, the service data reporting apparatus further includes a component generating module 65: the method comprises the steps of generating a target component, wherein the method is used for executing a method name executed by a service interface in identification response information when the target component is called; if a method name exists in the preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to the server.
In one example of the present disclosure, the service data reporting apparatus further includes a component calling module 66: the method is used for configuring a calling mode of the target component, and the calling mode is used for calling the target component after the response information is obtained.
In an example of the present disclosure, the service data reporting apparatus is further configured to: if a plurality of method names exist in a preset configuration file, a plurality of first data are obtained according to each method name and response data corresponding to each method name, and the plurality of first data are sent to a message queue; and sending the first data stored in the message queue to the server, so that the server provides the first data for the terminal to inquire.
Here, the response information determining module 61, the method name identifying module 62, the message queue sending module 63 and the server sending module 64 correspond to S202 to S208 in the method embodiment, and the foregoing modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in the foregoing method embodiment. It should be noted that the modules described above may be implemented as part of an apparatus in a computer system, such as a set of computer-executable instructions.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 700 according to such an embodiment of the present disclosure is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is merely an example and should not be construed to limit the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 7, the electronic device 700 is embodied in the form of a general purpose computing device. Components of electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one memory unit 720, and a bus 730 connecting the different system components, including the memory unit 720 and the processing unit 710.
Wherein the storage unit stores program code that is executable by the processing unit 710 such that the processing unit 710 performs steps according to various exemplary embodiments of the present disclosure described in the above-described "exemplary methods" section of the present specification.
For example, the processing unit 710 may perform the following steps of the method embodiment described above: acquiring request information of a terminal for service data, and acquiring response information after the service interface executes the request information; identifying a method name executed by a service interface in response information, wherein the response information comprises at least one method name and response data corresponding to the at least one method name; if a method name exists in the preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to the server, so that the server provides the first data for the terminal to inquire.
For example, the processing unit 710 may perform the following steps of the method embodiment described above: and according to preset configuration information, performing target data format conversion on a method name and corresponding response data thereof to obtain first data.
For example, the processing unit 710 may perform the following steps of the method embodiment described above: and configuring the method name as a key according to preset configuration information, and configuring response data corresponding to the method name as a value to obtain a key value pair as first data.
For example, the processing unit 710 may perform the following steps of the method embodiment described above: generating a target component, wherein the target component is used for executing a method name executed by a service interface in the identification response information when the target component is called; if a method name exists in the preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to the server.
For example, the processing unit 710 may perform the following steps of the method embodiment described above: and configuring a calling mode of the target component, wherein the calling mode is used for calling the target component after the response information is obtained.
For example, the processing unit 710 may perform the following steps of the method embodiment described above: if a plurality of method names exist in a preset configuration file, a plurality of first data are obtained according to each method name and response data corresponding to each method name, and the plurality of first data are sent to a message queue;
and sending the first data stored in the message queue to the server, so that the server provides the first data for the terminal to inquire.
The memory unit 720 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 7201 and/or cache memory 7202, and may further include Read Only Memory (ROM) 7203.
The storage unit 720 may also include a program/utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 730 may be a bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 740 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 700, and/or any device (e.g., router, modem, etc.) that enables the electronic device 700 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 750. Also, electronic device 700 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 over bus 730. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 700, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In particular, according to embodiments of the present disclosure, the process described above with reference to the flowcharts may be implemented as a computer program product comprising: and the computer program realizes the service data reporting method when being executed by the processor.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium, which may be a readable signal medium or a readable storage medium, is also provided. Fig. 8 illustrates a schematic diagram of a computer-readable storage medium in an embodiment of the present disclosure, where a program product capable of implementing the method of the present disclosure is stored on the computer-readable storage medium 800 as illustrated in fig. 8. In some possible implementations, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the disclosure as described in the "exemplary methods" section of this specification, when the program product is run on the terminal device.
More specific examples of the computer readable storage medium in the present disclosure may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In this disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Alternatively, the program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In particular implementations, the program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the description of the above embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. The service data reporting method is characterized by comprising the following steps:
acquiring request information of a terminal for service data, and acquiring response information after a service interface executes the request information;
identifying a method name executed by a service interface in the response information, wherein the response information comprises at least one method name and response data corresponding to the at least one method name;
if a method name exists in a preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue;
and sending the first data stored in the message queue to a server, so that the server provides the first data for the terminal to inquire.
2. The method for reporting service data according to claim 1, wherein the obtaining the first data according to the method name and the response data corresponding to the method name includes:
and according to preset configuration information, performing target data format conversion on the method name and the corresponding response data thereof to obtain first data.
3. The service data reporting method according to claim 2, wherein the preset configuration information includes one or more of the following information: the key value is in the data format; an extensible markup language format; parameter names or null formats to be acquired; data serialization format.
4. The method for reporting service data according to claim 2, wherein the performing target data format conversion on the method name and the corresponding response data according to the preset configuration information to obtain the first data includes:
and configuring the method name as a key according to preset configuration information, and configuring response data corresponding to the method name as a value to obtain a key value pair as first data.
5. The service data reporting method according to any one of claims 1 to 4, wherein the method further comprises:
Generating a target component, wherein the target component is used for executing the method name for identifying the service interface execution in the response information when the target component is called; if a method name exists in a preset configuration file, obtaining first data according to the method name and response data corresponding to the method name, and sending the first data to a message queue; and sending the first data stored in the message queue to a server.
6. The method for reporting service data according to claim 5, further comprising:
and configuring a calling mode of the target component, wherein the calling mode is used for calling the target component after the response information is obtained.
7. The service data reporting method of claim 1, wherein the method further comprises:
if a plurality of method names exist in a preset configuration file, a plurality of first data are obtained according to each method name and response data corresponding to each method name, and the plurality of first data are sent to a message queue;
and sending the first data stored in the message queue to a server, so that the server provides the first data for the terminal to inquire.
8. The utility model provides a service data reporting device which characterized in that includes:
the response information determining module is used for acquiring the request information of the terminal for the service data, and obtaining response information after the service interface executes the request information;
the method name identification module is used for identifying the method names executed by the service interfaces in the response information, wherein the response information comprises one or more method names and corresponding response data;
the message queue sending module is used for sending a method name and corresponding response data to the message queue if the method name exists in a preset configuration file;
and the server sending module is used for sending the first data stored in the message queue to a server, so that the server provides the data stored in the message queue for the terminal to inquire.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the traffic data reporting method of any one of claims 1 to 7 via execution of the executable instructions.
10. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the traffic data reporting method of any one of claims 1 to 7.
CN202311797330.3A 2023-12-25 2023-12-25 Service data reporting method and related equipment Pending CN117749780A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311797330.3A CN117749780A (en) 2023-12-25 2023-12-25 Service data reporting method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311797330.3A CN117749780A (en) 2023-12-25 2023-12-25 Service data reporting method and related equipment

Publications (1)

Publication Number Publication Date
CN117749780A true CN117749780A (en) 2024-03-22

Family

ID=90256548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311797330.3A Pending CN117749780A (en) 2023-12-25 2023-12-25 Service data reporting method and related equipment

Country Status (1)

Country Link
CN (1) CN117749780A (en)

Similar Documents

Publication Publication Date Title
US9363195B2 (en) Configuring cloud resources
US9122510B2 (en) Querying and managing computing resources in a networked computing environment
CN111600909A (en) Data processing method, device, protocol conversion equipment and storage medium
CN111722947A (en) Service calling method and system
CN110858202A (en) Method and device for generating where clause in database query statement
CN110109983B (en) Method and device for operating Redis database
CN112035270A (en) Interface adaptation method, system, device, computer readable medium and electronic equipment
US8555239B1 (en) Mainframe-based web service development accelerator
CN113641354A (en) Service data processing method and device, electronic equipment and storage medium
CN110764769B (en) Method and device for processing user request
CN115374207A (en) Service processing method and device, electronic equipment and computer readable storage medium
CN114780361A (en) Log generation method, device, computer system and readable storage medium
CN117749780A (en) Service data reporting method and related equipment
CN113515306B (en) System transplanting method and device
US8479175B1 (en) Mainframe-based web service development accelerator
CN114219643A (en) Transaction calling method, device, equipment and storage medium
CN113742235A (en) Method and device for checking codes
CN113973139A (en) Message processing method and device
CN113779018A (en) Data processing method and device
CN112416865A (en) File processing method and device based on big data
CN112711566B (en) Cross-service modification data sharing use method, system, equipment and storage medium
US20230088655A1 (en) Automatic non-code test suite generation from api specification
CN115344330A (en) Data transmission method and device, application processing method and device, and electronic device
CN117591982A (en) Verification method, system, device, equipment and storage medium
CN117762590A (en) Execution method, system and device of computing task and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination