CN115242799B - Data reporting method, device, equipment, storage medium and program product - Google Patents

Data reporting method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN115242799B
CN115242799B CN202210864007.2A CN202210864007A CN115242799B CN 115242799 B CN115242799 B CN 115242799B CN 202210864007 A CN202210864007 A CN 202210864007A CN 115242799 B CN115242799 B CN 115242799B
Authority
CN
China
Prior art keywords
data
service
reporting
instruction
server
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.)
Active
Application number
CN202210864007.2A
Other languages
Chinese (zh)
Other versions
CN115242799A (en
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.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202210864007.2A priority Critical patent/CN115242799B/en
Publication of CN115242799A publication Critical patent/CN115242799A/en
Application granted granted Critical
Publication of CN115242799B publication Critical patent/CN115242799B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data reporting method, a device, equipment, a storage medium and a program product, when the method is applied to a business front end, the method can comprise the following steps: monitoring a client page which enters the service front end according to a global reporting instruction which is preset at the service front end, wherein the reporting instruction is an instruction generated based on a front end frame; when the report instruction is monitored to be triggered, collecting service data corresponding to the triggered report instruction in the client page; storing the business data in a state management component of a front end framework; determining a reporting interval; and reading data from the state management component according to the reporting interval, and reporting the read data to a server. The reporting instruction is combined with the state management component to report the data based on the characteristics of the front end framework, so that the influence on the system performance caused by frequent reporting of the data is avoided.

Description

Data reporting method, device, equipment, storage medium and program product
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data reporting method, a data reporting apparatus, an electronic device, a computer readable storage medium, and a computer program product.
Background
In either the B/S or C/S architecture, the front end may need to report a large amount of data to the back end server for functional and programming reasons. In the related art, generally, after the front end triggers the reporting operation, the reported data is directly written into the back end database. In this case, if the data is reported frequently, the performance of the system is greatly affected, and the performance bottleneck of the database is easily formed in the peak period of the business transaction.
Disclosure of Invention
The application provides a data reporting method, a device, equipment, a storage medium and a program product, which are used for solving the problem that the performance of a server is affected due to frequent reporting of data in the related technology.
According to a first aspect of the present application, there is provided a data reporting method, where the method is applied to a service front end, and the method includes:
Monitoring a client page which enters the service front end according to a global reporting instruction which is preset at the service front end, wherein the reporting instruction is an instruction generated based on a front end frame;
When the report instruction is monitored to be triggered, collecting service data corresponding to the triggered report instruction in the client page;
storing the business data in a state management component of a front end framework;
Determining a reporting interval;
and reading data from the state management component according to the reporting interval, and reporting the read data to a server.
According to a second aspect of the present application, there is provided a data reporting method, the method being applied to a server, the method comprising:
Receiving service data reported by a service front end, wherein the service data is data read by the service front end from a state management component of a front end frame, the data in the state management component is data corresponding to a triggered reporting instruction when the reporting instruction is triggered after monitoring an incoming client page based on a preset global reporting instruction of the service front end;
Storing the service data into a cache file;
Determining a database write-in time;
and when the database writing time arrives, writing the business data in the cache file into the database.
According to a third aspect of the present application, there is provided a data reporting apparatus, the apparatus being applied to a service front end, the apparatus comprising:
the monitoring module is used for monitoring a client page which is entered by the service front end according to a global reporting instruction which is preset at the service front end, wherein the reporting instruction is an instruction generated based on a front end frame;
the service data acquisition module is used for acquiring service data corresponding to the triggered reporting instruction in the client page when the reporting instruction is triggered;
the front-end business data storage module is used for storing the business data in a state management component of the front-end framework;
the reporting interval determining module is used for determining the reporting interval;
and the data reporting module is used for reading data from the state management component according to the reporting interval and reporting the read data to a server.
According to a fourth aspect of the present application, there is provided a data reporting apparatus, the apparatus being applied to a server, the apparatus comprising:
The system comprises a service data receiving module, a service data sending module and a service data receiving module, wherein the service data receiving module is used for receiving service data reported by a service front end, the service data is data read by the service front end from a state management component of a front end frame, the data in the state management component is data corresponding to a triggered reporting instruction when the reporting instruction is triggered after monitoring an incoming client page based on a preset global reporting instruction of the service front end;
the file writing module is used for storing the service data into a cache file;
The writing time determining module is used for determining the writing time of the database;
And the database writing module is used for writing the business data in the cache file into the database when the database writing time arrives.
According to a fifth aspect of the present application, there is provided an electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of the first or second aspect described above.
According to a sixth aspect of the present application there is provided a computer readable storage medium storing computer instructions for causing a processor to perform the method of the first or second aspect described above.
According to a seventh aspect of the present application there is provided a computer program product comprising computer executable instructions which when executed are adapted to carry out the method of the first or second aspect described above.
In this embodiment, based on the language characteristic of the front end frame of the service front end, a global reporting instruction is preset on the service front end, after the service front end enters a client page, the client page is monitored based on each reporting instruction, and when it is monitored that a reporting instruction is triggered, service data corresponding to the triggered reporting instruction is collected in the client page, so that a triggering mechanism of data reporting is simplified. The traffic data is then stored in a state management component of the front end framework. And then determining a reporting interval, and reading data from the state management component according to the reporting interval and reporting the data to the server. The reporting instruction is combined with the state management component to realize the reporting of the data based on the characteristics of the front end frame, so that the influence on the system performance caused by frequent reporting of the data is avoided, and the operation pressure of the server is effectively reduced.
In addition, for the server, after the server receives the service data, the service data is written into the cache file, and after the database writing time is determined, the data in the cache file is written into the database, so that the increase of the server pressure caused by writing the database during the service peak period is avoided, and the pressure of the database server is relieved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an embodiment of a data reporting method according to a first embodiment of the present application;
fig. 2 is a flowchart of an embodiment of a data reporting method according to a second embodiment of the present application;
Fig. 3 is a block diagram of a data reporting device according to a third embodiment of the present application;
fig. 4 is a block diagram of a data reporting device according to a fourth embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In addition, it should be noted that, in the following embodiments of the present application, the data acquisition, storage, use, processing, etc. all conform to relevant regulations of national laws and regulations.
Example 1
Fig. 1 is a flowchart of an embodiment of a data reporting method according to the first embodiment of the present application, where the embodiment may be applied to a service front end, and the characteristics of a front end frame are utilized to collect and report data, so as to optimize a data reporting flow, improve the efficiency of data reporting, and not affect the system performance during a peak period of data reporting.
Illustratively, the front-end framework may include a VUE framework, where VUE is a set of progressive JavaScript frameworks used to build a user interface. The VUE is designed to be applied layer by layer from bottom to top, and the core library of the VUE only focuses on the view layer, which is not only easy to handle, but also facilitates integration with third party libraries or existing items. On the other hand, VUE is also fully capable of providing drivers for complex Single Page Applications (SPAs) when used in conjunction with modern toolchains and various supporting class libraries.
The embodiment can be applied to a data reporting device, and the data reporting device can be deployed on fixed equipment, mobile equipment, wearable equipment and other equipment.
As shown in fig. 1, the present embodiment may include the following steps:
and 110, monitoring a client page which is entered by the service front end according to a global reporting instruction which is preset at the service front end.
In this embodiment, the report instruction is an instruction generated based on the front end framework. Specifically, based on the characteristics of the front end framework, a reporting instruction applicable to the global can be customized in the service front end in advance, and one or more reporting instructions can be used as an entry for triggering the data reporting action by the service front end. The report instruction may be applicable to all client pages opened in the front end. When the service front end enters the client page, the reporting instruction set on the service front end can act on the client page and is used for monitoring the client page.
The client page may originate from one system or may originate from multiple systems, which is not limited in this embodiment.
And 120, collecting service data corresponding to the triggered reporting instruction in the client page when the reporting instruction is triggered.
Illustratively, the report instruction may be a VUE frame-based state instruction (also referred to as a v-state instruction), each having a bound action type and an event tag for listening for a corresponding action and event. When a user triggers an action corresponding to the action type in the currently opened client page, a corresponding state instruction is triggered, and then data acquisition and reporting of a corresponding event tag are triggered. The action types may include, for example, a page browsing action, a click button action, and the like. For example, a button (button) label is bound with a state instruction, when a user clicks the button of the currently opened client page, the state instruction monitors the clicking action, and then data acquisition is triggered to acquire relevant data of an event triggered by the action.
In one embodiment, step 120 may further comprise the steps of:
step 120-1, when a state instruction is triggered, acquiring timestamp information of the trigger, and acquiring an action type and an event tag bound with the state instruction.
When a user performs an action of setting a state instruction in a client page, the state instruction is triggered, and at this time, the time stamp information triggered by the state instruction, and the action type and the event tag bound by the state instruction are acquired as part of the acquired data.
And step 120-2, acquiring user data and a page path of the client page.
When the state instruction is triggered, user data of a user logging in to the current client page may also be obtained, which may include, for example, user login information, such as a user identification. In addition, a page path of the current client page can be obtained, and the page path is used for identifying which page the current client page belongs to. Of course, other information of the current client page, such as page identification, may be obtained in addition to the page path.
And step 120-3, organizing the user data, the page path, the timestamp information, the bound action type and the event label into service data.
The collected user data, page paths, time stamp information, action types, event labels and the like can be used as service data for reporting.
Of course, the service data is not limited to the above data, and other service data may be collected according to actual service requirements, for example, the page access amount PV (PageView) and the number of independent access users UV (UniqueVisitor) may be calculated according to the data collected for a period of time.
And step 130, storing the service data in a state management component of the front-end framework.
In this embodiment, the collected service data is not directly sent to the server of the back end, but is first stored in a state management component of the front end framework, where the state management component is used to store the state data of the entire application.
Unlike conventional sessionstorage and localstorage, which are used for caching, the state management component is provided by the front end framework and is located in the system memory, so that data can be more conveniently shared among the components, and service data stored in the state management component can be used for reporting the data and can be used for other places and scenes (such as displaying of the data) in the system, so that redundant storage of the data is reduced. Further, if the service data stored by the state management component is updated, the updated data can be automatically applied to each element of the calling service data only by updating the data in the state management component, so that more efficient data updating is realized.
In one embodiment, the state management component may include a buffer queue, which may be a FIFO (First Input First Output, first-in first-out) queue, and step 130 may further include the steps of:
Creating a business object and inserting the business object into the cache queue; and writing the service data into the service object.
Specifically, when service data needs to be stored in the cache queue, a service object may be first created, the service object is inserted into the tail of the cache queue, and then the service data collected in real time is written into the service object.
And 140, determining a reporting interval.
For the service data in the buffer queue, the service data is not reported to the server in real time, but the reporting interval is determined according to the running condition of the current system, and then the data is reported according to the reporting interval.
In one embodiment, step 140 may further comprise the steps of:
and acquiring load information of a server, and determining a reporting interval according to the load information, wherein the load information is positively correlated with the reporting interval.
That is, the greater the server load, the greater the interval between two reports.
In one embodiment, a calculation opportunity of the reporting interval may be: and monitoring the load information of the server, and determining a reporting interval according to the load information when the load information changes.
When the method is realized, a monitoring program can be set to monitor the load of the server in real time, the difference between the current monitored load and the load obtained last time is calculated, if the difference is smaller than a set difference threshold value, the load information is judged to be unchanged, otherwise, if the difference is larger than or equal to the set difference threshold value, the load information is judged to be changed. If the load information changes, the reporting interval can be determined according to the current monitored load information.
In another embodiment, the calculation timing of another reporting interval may be: and periodically acquiring the load information of the server, and determining a reporting interval according to the acquired load information.
Compared with the previous embodiment, the present embodiment does not need to determine whether the load changes, but sets an acquisition period of the load information, acquires the load information of the server when the period arrives, and determines the reporting interval according to the acquired load information.
In one embodiment, the load information of the server may be obtained as follows: and determining the average service response time of the server in a set time period, and taking the average service response time as the load information.
When the method is realized, the primary service response time of the server is a time interval from a time stamp of a service request sent by the client to a time stamp of response information of the server received by the client, and the average service response time in a set time period is a ratio of the sum of time intervals corresponding to each service request in the set time to the number of service requests. Wherein the set time period may be the last week, the last day, and the like.
After obtaining the average service response time of the server in the set time period, the average service response time can be used as load information, and the running pressure condition of the server can be monitored in real time through the service response time.
In an embodiment, the step of determining the reporting interval according to the load information may further include the following steps:
and matching the load information in a pre-generated load data table to obtain a reporting interval corresponding to the load information.
The load data table may record association relationships between a plurality of load intervals and corresponding reporting intervals. After the load information of the server is obtained, the load information can be matched in the load data table to determine a load interval hit by the load information, and then the reporting interval associated with the hit load interval is used as the current reporting interval.
The running pressure of the server is processed in a layering way by setting a plurality of load intervals, wherein a smaller load interval represents that the running pressure of the server is smaller and the response time is shorter, and the associated reporting interval can be set to be larger; and a larger load interval indicates that the operating pressure of the server is larger and the response time is longer, the associated reporting interval can be set smaller. Reporting of data may even be stopped if the load information of the server is too large. Therefore, the increase of the pressure of the server caused by reporting data in the business peak period can be avoided, and the pressure of the server in the business peak period is reduced.
The load interval may be represented in a response time interval, for example, the reporting interval may be 30s if the response time of the server is less than 1s, 60s if the response time of the server is greater than 1s but less than 10s, and the reporting is suspended if the response time of the server is greater than 10 s.
And step 150, reading data from the state management component according to the reporting interval, and reporting the read data to a server.
After the reporting interval is determined, the data can be read from the cache queue of the state management component according to the reporting interval, and the read data is reported to the server.
In one embodiment, since the reported data may include sensitive data or data that needs to be kept secret, in order to prevent data leakage and improve data security, the read data may be encrypted before the data is reported to the server.
In practice, the read data may generate a data packet according to a set format, and then encrypt the data packet and report the encrypted data packet to the backend server.
The present embodiment does not limit the encryption algorithm of the above encryption.
In this embodiment, based on the language characteristic of the front end frame of the service front end, a global reporting instruction is preset on the service front end, after the service front end enters a client page, the client page is monitored based on each reporting instruction, and when it is monitored that a reporting instruction is triggered, service data corresponding to the triggered reporting instruction is collected in the client page, so that a triggering mechanism of data reporting is simplified. The traffic data is then stored in a state management component of the front end framework. And then determining a reporting interval, and reading data from the state management component according to the reporting interval and reporting the data to the server. The reporting instruction is combined with the state management component to realize the reporting of the data based on the characteristics of the front end frame, so that the influence on the system performance caused by frequent reporting of the data is avoided, and the operation pressure of the server is effectively reduced.
Example two
Fig. 2 is a flowchart of an embodiment of a data reporting method according to a second embodiment of the present application, where the embodiment may be applied to a server, and a processing procedure after the server receives reported data is described. As shown in fig. 2, the steps may be included as follows:
and 210, receiving service data reported by a service front end.
The service data are data read from a state management component of a front end framework by a service front end, the data in the state management component are data corresponding to a triggered reporting instruction when the reporting instruction is triggered after the monitoring of an incoming client page is carried out on the basis of a preset global reporting instruction by the service front end.
If the service data received by the server is an encrypted data message, the data message may be decrypted first to extract the corresponding service data.
And 220, storing the service data into a cache file.
In this step, after the server obtains the service data, the service data is not written into the database in real time, but is first written into a cache file for caching, where the cache file may include a text file such as txt, for example. This is because if data is written to the database in real time, additional pressure is built up on the database server, and the data in the data reporting portion is relatively less time-efficient and can therefore be written to the server's cache file first.
At step 230, a database write opportunity is determined.
For the data in the cache file, the data in the cache file is not written into the database in real time, but the writing time of the database is determined first, and the data in the cache file is written into the database when the writing time arrives.
In one embodiment, step 230 may further comprise the steps of:
Determining a business peak period; and selecting a database writing time in a time period except the business peak period.
The method for determining the peak period of the service is not limited to the server, for example, the peak period of the service may be determined according to the service response time of the server, or the peak period of the service may be determined according to the occupancy rate of the CPU, or the peak period of the service may be determined according to the number of requests received by the server or the number of requests to be processed by the server, or even some or all of the above factors may be combined to determine the peak period of the service.
During peak business hours, the server does not write the data of the cache file into the database. And the data in the cache file is written to the database during off-peak business hours.
While during off-peak hours, the database write timing may be determined as follows, the present embodiment is not limited to the following: and acquiring the load information of the server in each period of the non-business peak period, and determining the period with the minimum load information as the writing time of the database. Or selecting the latest time interval from the time intervals of the non-business peak time to be used as the writing time of the database. Or may randomly choose a time as the database write opportunity.
And step 240, when the database writing time arrives, writing the business data in the cache file into the database.
Specifically, after the writing time of the database is determined, when the writing time of the database arrives, the business data in the cache file can be written into the database in batches. When the method is implemented, the business data in the cache file can be written into the database in a mode of periodical batch running in the non-business peak period.
In one embodiment, after the business data in the cache file is written to the database, the business data is deleted in the cache file.
In this embodiment, for the server, after receiving the service data, the service data is written into the cache file, and after determining that the database is written into the time slot, the data in the cache file is written into the database, so that the increase of the server pressure caused by writing the database during the service peak period is avoided, the pressure of the database server is further relieved, and the performance of the server is improved.
Example III
Fig. 3 is a block diagram of an embodiment of a data reporting device according to a third embodiment of the present application, where the device may be applied to a service front end, and may include the following modules:
The monitoring module 310 is configured to monitor a client page entered by the service front end according to a global reporting instruction set in advance at the service front end, where the reporting instruction is an instruction generated based on a front end frame;
the service data acquisition module 320 is configured to acquire service data corresponding to the triggered reporting instruction in the client page when the reporting instruction is triggered;
A front-end service data storage module 330 for storing the service data in a status management component of the front-end framework;
a reporting interval determining module 340, configured to determine a reporting interval;
And the data reporting module 350 is configured to read data from the state management component according to the reporting interval, and report the read data to a server.
In one embodiment, the front end frame of the service front end is a VUE frame, and the report instruction includes a state instruction, where the state instruction has a bound action type and an event tag; the service data collection module 320 is specifically configured to:
When a state instruction is triggered, acquiring time stamp information of the trigger, and acquiring an action type and an event tag which are bound with the state instruction;
Acquiring user data and a page path of the client page;
and organizing the user data, the page path, the timestamp information, the bound action type and the event tag into service data.
In one embodiment, the state management component includes a cache queue; the front-end service data storage module 330 is specifically configured to:
Creating a business object and inserting the business object into the cache queue;
And writing the service data into the service object.
In one embodiment, the reporting interval determining module 340 may further include the following modules:
The load information acquisition module is used for acquiring the load information of the server;
and the interval determining module is used for determining a reporting interval according to the load information, wherein the load information is positively correlated with the reporting interval.
In one embodiment, the load information obtaining module is specifically configured to:
and determining the average service response time of the server in a set time period, and taking the average service response time as the load information.
In one embodiment, the interval determination module is specifically configured to:
And matching the load information in a pre-generated load data table to obtain reporting intervals corresponding to the load information, wherein the load data table records a plurality of load intervals and association relations of the corresponding reporting intervals.
In another embodiment, the interval determination module is specifically configured to:
Monitoring load information of the server, and determining a reporting interval according to the load information when the load information changes;
Or alternatively
And periodically acquiring the load information of the server, and determining a reporting interval according to the acquired load information.
In one embodiment, the apparatus may further comprise the following modules:
And the encryption module is used for encrypting the read data before reporting the read data to the server.
The data reporting device provided by the embodiment of the application can execute the data reporting method in the first embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a block diagram of an embodiment of a data reporting device according to a fourth embodiment of the present application, where the device may be applied to a server, and may include the following modules:
The service data receiving module 410 is configured to receive service data reported by a service front end, where the service data is data read by the service front end from a state management component of a front end frame, and the data in the state management component is data corresponding to a triggered reporting instruction when the reporting instruction is triggered after the service front end monitors an incoming client page based on a preset global reporting instruction;
A file writing module 420, configured to store the service data into a cache file;
a write timing determination module 430, configured to determine a database write timing;
And the database writing module 440 is configured to write the service data in the cache file into a database when the database writing time arrives.
In one embodiment, the write clock determination module 430 includes:
Determining a business peak period;
and selecting a database writing time in a time period except the business peak period.
In one embodiment, the apparatus may further comprise the following modules:
and the data deleting module is used for deleting the service data in the cache file after the service data in the cache file is written into the database.
The data reporting device provided by the embodiment of the application can execute the data reporting method in the second embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the method of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the methods described in embodiment one or embodiment two.
In some embodiments, the method described in embodiment one or embodiment two may be implemented as a computer program, which is tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method described in the first or second embodiment described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method described in embodiment one or embodiment two in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present application, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present application are achieved, and the present application is not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.

Claims (15)

1. The data reporting method is characterized by being applied to a service front end, and comprises the following steps:
Monitoring a client page which is entered by the service front end according to a global reporting instruction which is preset at the service front end; the report instruction is an instruction generated based on a front end framework, and comprises a state instruction, an action type bound by the state instruction and an event tag; the front end frame is a VUE frame;
When the state instruction is triggered, acquiring triggered time stamp information, and acquiring an action type and an event tag bound with the state instruction;
Acquiring user data and a page path of the client page;
Organizing the user data, the page path, the timestamp information, the bound action type and the event tag into service data;
storing the business data in a state management component of the front end framework;
Determining a reporting interval;
and reading data from the state management component according to the reporting interval, and reporting the read data to a server.
2. The method of claim 1, wherein the state management component comprises a cache queue; the storing the service data in the state management component includes:
Creating a business object and inserting the business object into the cache queue;
And writing the service data into the service object.
3. The method of claim 1, wherein the determining the reporting interval comprises:
load information of the server is obtained, and the reporting interval is determined according to the load information; wherein, the load information is positively correlated with the reporting interval.
4. A method according to claim 3, wherein said obtaining load information of said server comprises:
and determining the average service response time of the server in a set time period, and taking the average service response time as the load information.
5. A method according to claim 3, wherein said determining said reporting interval from said load information comprises:
matching the load information in a pre-generated load data table to obtain a reporting interval corresponding to the load information; the load data table records association relations of a plurality of load intervals and corresponding reporting intervals.
6. A method according to claim 3, wherein the obtaining load information of the server and determining the reporting interval according to the load information comprise:
Monitoring load information of the server, and determining the reporting interval according to the load information when the load information changes;
Or alternatively
And periodically acquiring load information of the server, and determining the reporting interval according to the acquired load information.
7. The method of claim 1, wherein prior to said reporting said read data to a server, the method further comprises:
Encrypting the read data.
8. The data reporting method is characterized by being applied to a server, and comprises the following steps:
receiving service data reported by a service front end; the service data are data read from a state management component of a front end framework by the front end of the service; the front end frame is a VUE frame;
Storing the service data into a cache file;
Determining a database write-in time;
when the database writing time arrives, writing the business data in the cache file into a database;
The data in the state management component is stored through the operation of the service front end:
monitoring a client page entered by the service front end according to a global reporting instruction preset at the service front end by the service front end; the report instruction is an instruction generated based on the front end framework, and comprises a state instruction, an action type bound by the state instruction and an event tag;
Acquiring trigger time stamp information and action types and event labels bound with the state instruction when the state instruction is triggered through the service front end;
Acquiring user data and a page path of the client page through the service front end;
Organizing the user data, the page path, the timestamp information, the bound action type and the event tag into the service data through the service front end;
and storing the service data in a state management component of the front-end framework through the service front-end.
9. The method of claim 8, wherein the determining a database write opportunity comprises:
Determining a business peak period;
and selecting the writing time of the database in the time period except the business peak period.
10. The method according to claim 8 or 9, wherein after said writing the service data in the cache file into a database, the method further comprises:
And deleting the service data in the cache file.
11. A data reporting device, wherein the device is applied to a service front end, the device comprising:
The monitoring module is used for monitoring a client page which is entered by the service front end according to a global reporting instruction which is preset at the service front end; the report instruction is an instruction generated based on a front end framework, and comprises a state instruction, an action type bound by the state instruction and an event tag; the front end frame is a VUE frame;
The business data acquisition module is used for:
When the state instruction is triggered, acquiring triggered time stamp information, and acquiring an action type and an event tag bound with the state instruction;
Acquiring user data and a page path of the client page;
Organizing the user data, the page path, the timestamp information, the bound action type and the event tag into service data;
The front-end business data storage module is used for storing the business data in the state management component of the front-end framework;
the reporting interval determining module is used for determining the reporting interval;
And the data reporting module is used for reading data from the state management component according to the reporting interval and reporting the read data to a server.
12. A data reporting device, wherein the device is applied to a server, and the device comprises:
the service data receiving module is used for receiving service data reported by the service front end; the service data are data read from a state management component of a front end framework by the front end of the service; the front end frame is a VUE frame; the file writing module is used for storing the service data into a cache file;
The writing time determining module is used for determining the writing time of the database;
The database writing module is used for writing the business data in the cache file into the database when the database writing time arrives;
The data in the state management component is stored through the operation of the service front end:
monitoring a client page entered by the service front end according to a global reporting instruction preset at the service front end by the service front end; the report instruction is an instruction generated based on the front end framework, and comprises a state instruction, an action type bound by the state instruction and an event tag;
Acquiring trigger time stamp information and action types and event labels bound with the state instruction when the state instruction is triggered through the service front end;
Acquiring user data and a page path of the client page through the service front end;
Organizing the user data, the page path, the timestamp information, the bound action type and the event tag into the service data through the service front end;
and storing the service data in a state management component of the front-end framework through the service front-end.
13. An electronic device, the electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program for execution by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-10.
14. A computer readable storage medium storing computer instructions for causing a processor to perform the method of any one of claims 1-10.
15. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1-10 when executed.
CN202210864007.2A 2022-07-21 2022-07-21 Data reporting method, device, equipment, storage medium and program product Active CN115242799B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210864007.2A CN115242799B (en) 2022-07-21 2022-07-21 Data reporting method, device, equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210864007.2A CN115242799B (en) 2022-07-21 2022-07-21 Data reporting method, device, equipment, storage medium and program product

Publications (2)

Publication Number Publication Date
CN115242799A CN115242799A (en) 2022-10-25
CN115242799B true CN115242799B (en) 2024-04-26

Family

ID=83674912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210864007.2A Active CN115242799B (en) 2022-07-21 2022-07-21 Data reporting method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN115242799B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105610915A (en) * 2015-12-15 2016-05-25 深圳市慧动创想科技有限公司 Data reporting method and system
CN109408105A (en) * 2018-09-25 2019-03-01 腾讯科技(武汉)有限公司 Acquisition method, device, computing device and the storage medium of user behavior data
CN109885793A (en) * 2019-01-18 2019-06-14 中国平安人寿保险股份有限公司 Page data acquisition method and device, electronic equipment, storage medium
CN111046317A (en) * 2019-12-27 2020-04-21 北京奇艺世纪科技有限公司 Page data acquisition method, device, equipment and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10178646B2 (en) * 2017-04-12 2019-01-08 Cisco Technology, Inc. System and method to facilitate slice management in a network environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105610915A (en) * 2015-12-15 2016-05-25 深圳市慧动创想科技有限公司 Data reporting method and system
CN109408105A (en) * 2018-09-25 2019-03-01 腾讯科技(武汉)有限公司 Acquisition method, device, computing device and the storage medium of user behavior data
CN109885793A (en) * 2019-01-18 2019-06-14 中国平安人寿保险股份有限公司 Page data acquisition method and device, electronic equipment, storage medium
CN111046317A (en) * 2019-12-27 2020-04-21 北京奇艺世纪科技有限公司 Page data acquisition method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN115242799A (en) 2022-10-25

Similar Documents

Publication Publication Date Title
US20210184947A1 (en) Automatic capture of detailed analysis information based on remote server analysis
CN111124819B (en) Method and device for full link monitoring
CN110347716B (en) Log data processing method, device, terminal equipment and storage medium
EP4099170B1 (en) Method and apparatus of auditing log, electronic device, and medium
CN112162965B (en) Log data processing method, device, computer equipment and storage medium
CN106815254B (en) Data processing method and device
CN111400361A (en) Data real-time storage method and device, computer equipment and storage medium
US10775751B2 (en) Automatic generation of regular expression based on log line data
CN111800292B (en) Early warning method and device based on historical flow, computer equipment and storage medium
CN114461792A (en) Alarm event correlation method, device, electronic equipment, medium and program product
CN112948223A (en) Method and device for monitoring operation condition
CN113595886A (en) Instant messaging message processing method and device, electronic equipment and storage medium
CN113312321A (en) Abnormal monitoring method for traffic and related equipment
CN109614380A (en) Log processing method, system, computer equipment and readable medium
CN113760982A (en) Data processing method and device
CN112860762A (en) Method and apparatus for detecting time period overlap
CN115242799B (en) Data reporting method, device, equipment, storage medium and program product
CN110633165B (en) Fault processing method, device, system server and computer readable storage medium
US9910737B2 (en) Implementing change data capture by interpreting published events as a database recovery log
CN111552613A (en) Thread timeout processing method and device and electronic equipment
CN111198805A (en) Abnormity monitoring method and device
CN115543416A (en) Configuration updating method and device, electronic equipment and storage medium
CN112910855B (en) Sample message processing method and device
CN114117289A (en) Browser operation data acquisition method and device and electronic equipment
CN113760589A (en) Service fusing method and device based on real-time stream processing framework

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
GR01 Patent grant
GR01 Patent grant