WO2021082859A1 - 一种数据处理方法及装置 - Google Patents
一种数据处理方法及装置 Download PDFInfo
- Publication number
- WO2021082859A1 WO2021082859A1 PCT/CN2020/119040 CN2020119040W WO2021082859A1 WO 2021082859 A1 WO2021082859 A1 WO 2021082859A1 CN 2020119040 W CN2020119040 W CN 2020119040W WO 2021082859 A1 WO2021082859 A1 WO 2021082859A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- browser
- collection
- cache
- event
- events
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Definitions
- the present invention relates to the technical field of financial technology (Fintech), in particular to a data processing method and device.
- the financial technology field usually has a variety of applications, and users can apply for financial services on these applications, such as payment services, loan services, or insurance services.
- the application when a user triggers a buried event on an application, the application generates a collection event based on the buried event and reports the collected event to the collection server.
- the collection event may not be successfully reported to the collection server.
- the application in order to improve the collection success rate of the collection event, the application can also buffer the collection event to a certain location first , And then report the buffered collection event again after the fault is repaired.
- the existing browser caching technology actually exists as a software configuration item attached to the terminal device. Generally, it is fixedly set according to the browser version when the terminal device leaves the factory. A terminal device can only use the default settings for the Dedicated browser caching mechanism for terminal devices. The existing browser caching technology cannot actually be applied to terminal devices with browsers of different versions.
- the present invention provides a data processing method to solve the technical problem that the existing browser caching technology can only support a dedicated browser version, which causes the collection event cached by the application program to be garbled or the collection event cannot be cached.
- the present invention provides a data processing method, which is suitable for a data processing device, and includes: the data processing device first determines the collection event to be cached, and then based on the preset browser and browser caching mechanism.
- the mapping relationship determines the cache mechanism of the target browser that matches the browser, and uses the cache mechanism of the target browser to cache the collection events to be cached.
- the collection events to be buffered may include collection events that are not successfully reported to the collection server among multiple collection events.
- the multiple collection events are detected after the user triggers the first preset operation on the browser and executes the first preset operation. Suppose it is generated when the corresponding task is operated, and each collection event is used to record the event of executing each subtask in the task.
- the data processing device in this solution can support multiple browser caching mechanisms at the same time. In this way, after acquiring the collection event to be cached, the data processing device can use the target caching mechanism matching the browser to cache the collection event to be cached. In order to ensure the accuracy of the collection event to be cached, this method helps to solve the problem of garbled or unable to cache collection events caused by only setting a default browser caching mechanism in the prior art. The accuracy of the cached collection events.
- the data processing device determines the target browser caching mechanism that matches the browser, including: the data processing device obtains the configuration file of the browser, and if the configuration file of the browser contains the window.localStorage object, it is determined
- the localhost caching mechanism is an alternative browser caching mechanism. If the configuration file of the browser contains any one or more of the window.indexedDB object, window.IDBTransaction object, and window.IDBKeyRange object, the indexDB caching mechanism is determined to be a backup Select the browser caching mechanism.
- the WebSQL caching mechanism is determined to be an alternative browser caching mechanism; if there are multiple alternative browser caching mechanisms, browse from multiple alternatives Among the browser caching mechanisms, the browser caching mechanism with the highest priority is selected as the target browser caching mechanism.
- the above design pre-sets the priority of multiple browser caching mechanisms. When there are multiple alternative browser caching mechanisms, by using the browser caching mechanism with the highest priority to perform the caching operation, the efficiency of caching can be improved. In addition, the priority of multiple browser caching mechanisms in this manner can be set according to design requirements, so that the needs of users can be more satisfied.
- the data processing device determines the target browser caching mechanism that matches the browser, including: the data processing device obtains the configuration file of the browser, and detects whether the configuration file of the browser contains the window.localStorage object, If it exists, the local host caching mechanism is determined to be the target browser caching mechanism. If it does not exist, check whether the configuration file of the browser contains any one or more of the system browser database object, window.IDBTransaction object, and window.IDBKeyRange object. If it does, determine the indexDB caching mechanism as the target browse If it does not include the browser cache mechanism, then check whether the browser’s configuration file contains the window.openDatabase object. If it does, it will determine that the WebSQL cache mechanism is the target browser’s cache mechanism.
- this method determines the caching mechanism supported by the browser by querying the configuration file, which can accurately match the appropriate target caching mechanism.
- this method can directly determine the browser caching mechanism as the target browser caching mechanism when the object corresponding to a certain browser caching mechanism is detected, without Then perform the operation of detecting the objects of other browsers' caching mechanisms, so that the operation is relatively simple, the efficiency is high, and the flexibility is strong.
- the data processing device may also determine that there is no user-specified target browser caching mechanism. In this way, this method supports the user to specify the browser caching mechanism, so that the actual needs of the user can be more satisfied, the actual scene is met, and the user experience is improved. Moreover, first matching the user-specified caching mechanism and then configuring the configuration file to determine the caching mechanism can accurately match the target caching mechanism on the basis of ensuring the user's needs, which is more flexible.
- the data processing device uses the cache mechanism of the target browser to cache the collection events, including: the data processing device uses a preset compression algorithm to compress the multiple collection events to be cached, and obtains the corresponding data of the multiple collection events to be cached. String cache, and cache string data corresponding to multiple collection events to be cached in the storage space corresponding to the cache mechanism of the target browser. In this way, all the collected events to be buffered can be compressed into a string buffer through a single compression process, so that the buffering of the collected data to be buffered can be completed with a small number of operations, and the occupation of the buffered collected data can be reduced. This reduces the number of subsequent retransmissions and improves the retransmission efficiency.
- the data processing device uses a preset compression algorithm to compress the multiple collection events to be buffered, and obtains the string buffer corresponding to the multiple collection events to be buffered, including: for each collection event to be buffered , The data processing device first extracts the value of the collection event under each feature from the collection event, and then generates the feature vector corresponding to the feature according to the value of the multiple collection events to be cached under each feature, and finally The feature vector corresponding to the feature is combined to obtain the string cache corresponding to the multiple collection events to be cached.
- this method supports storing multiple collection events to be cached in the form of key-value pairs (i.e. string cache). Compared with multiple collection events to be cached, the string cache can occupy a smaller amount of data. The compression effect is better.
- the data processing device uses the cache mechanism of the target browser to cache collection events, including: for any feature, use a preset compression algorithm to compress any collection event to be cached, and obtain each collection event to be cached.
- the string cache corresponding to the collection event is cached, and the string data corresponding to each collection event to be cached is cached and stored in the storage space corresponding to the cache mechanism of the target browser.
- the data processing device uses the cache mechanism of the target browser to cache the collection event to be cached, if it detects that the user triggers the second preset operation on the browser, it executes the second preset operation corresponding to the Generate multiple collection events during the task, create the first queue, and determine whether the string cache is stored in the storage space corresponding to the cache mechanism of the target browser. If so, first store the string cache in the first queue, and then store multiple items The collection events are sequentially stored in the first queue. In this case, multiple collection events are located after the string buffer. If not, the multiple collection events are sequentially stored in the first queue. In this way, when the collected data is retransmitted, the data processing device can sequentially report the collected data stored in the first queue to the collection server.
- the present invention provides a data processing device, which includes:
- the determination module is used to determine the collection event to be buffered.
- the collection events to be buffered may include collection events that are not successfully reported to the collection server among multiple collection events.
- the multiple collection events are detected after the user triggers the first preset operation on the browser and executes the first preset operation. Generated when the corresponding task is operated, and each collection event is used to record the event of each subtask in the execution of the task.
- the cache module is used to determine the target browser cache mechanism matching the browser based on the preset mapping relationship between the browser and the browser cache mechanism, and use the target browser cache mechanism to cache the collection events to be cached.
- the determining module is specifically used to: obtain the configuration file of the browser. If the configuration file of the browser contains the window.localStorage object, determine that the localhost caching mechanism is an alternative browser caching mechanism; if the browser If the configuration file contains any one or more of the window.indexedDB object, window.IDBTransaction object, and window.IDBKeyRange object, the indexDB caching mechanism is determined to be an alternative browser caching mechanism; if the browser’s configuration file contains window.openDatabase object, the WebSQL caching mechanism is determined to be an alternative browser caching mechanism; if there are multiple alternative browser caching mechanisms, the browser caching mechanism with the highest priority is selected from the multiple alternative browser caching mechanisms as Target browser caching mechanism.
- the determining module is specifically used to: after obtaining the configuration file of the browser, detect whether the configuration file of the browser contains the window.localStorage object, and if so, determine that the local host cache mechanism is the cache mechanism of the target browser ; If not, check whether the configuration file of the browser contains any one or more of the system browser database object, window.IDBTransaction object, and window.IDBKeyRange object. If so, determine that the indexDB cache mechanism is the target browser Cache mechanism, if not, check whether the browser’s configuration file contains the window.openDatabase object, if yes, determine that the WebSQL cache mechanism is the target browser’s cache mechanism, if not, determine that there is no target browser that matches the browser Caching mechanism.
- the determining module before the determining module obtains the configuration file of the browser, it is also used to determine that there is no user-specified target browser caching mechanism.
- the cache module is specifically used to: compress the multiple collection events to be cached using a preset compression algorithm, obtain the string buffer corresponding to the multiple collection events to be cached, and combine the multiple collection events to be cached
- the string data corresponding to the event is cached and stored in the storage space corresponding to the cache mechanism of the target browser.
- the cache module is specifically used to: for each collection event to be cached, extract the value of the collection event under each feature from the collection event; for any feature, according to the feature to be cached Based on the values of the multiple collection events in the feature, the feature vector corresponding to the feature is generated. In this way, according to the feature vector corresponding to each feature, the string buffer corresponding to the multiple collection events to be cached is obtained by combining.
- the buffer module is specifically used to compress any collection event to be buffered using a preset compression algorithm, obtain a string buffer corresponding to each collection event to be buffered, and store each collection event to be buffered
- the string data corresponding to the event is cached and stored in the storage space corresponding to the cache mechanism of the target browser.
- the device further includes a processing module.
- the caching module uses the target browser caching mechanism to cache the collection events to be cached
- the processing module is used to: after detecting that the user triggers the second preset operation on the browser, Multiple collection events are generated when the task corresponding to the second preset operation is executed; the first queue is created to determine whether the string cache is stored in the storage space corresponding to the cache mechanism of the target browser, and if so, the string cache is first stored in In the first queue, multiple collection events are sequentially stored in the first queue; multiple collection events are located after the string buffer; if not, multiple collection events are sequentially stored in the first queue; the first The collected data stored in the queue is reported to the collection server.
- the present invention provides a computing device, including at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit executes any of the above-mentioned first aspect Data processing method.
- the present invention provides a computer-readable storage medium that stores a computer program executable by a computing device.
- the program runs on the computing device, the computing device executes any data processing method in the first aspect.
- FIG. 1 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention
- FIG. 2 is an overall flowchart corresponding to a data collection method provided by an embodiment of the present invention
- FIG. 3 is a schematic flowchart corresponding to a data caching method provided by an embodiment of the present invention.
- FIG. 4 is a schematic diagram of a method for reporting collection events based on a cursor according to an embodiment of the present invention
- FIG. 5 is a schematic diagram of a method for reporting collected data based on a first-in first-out queue algorithm according to an embodiment of the present invention
- FIG. 6 is a schematic diagram of a method for determining a cache mechanism of a target browser according to an embodiment of the present invention
- FIG. 7 is a schematic diagram of the overall flow of a caching method provided by an embodiment of the present invention.
- FIG. 8 is a schematic diagram of the overall flow of another caching method provided by an embodiment of the present invention.
- FIG. 9 is a schematic diagram of the overall flow of a data retransmission method according to an embodiment of the present invention.
- FIG. 10 is a schematic diagram of the overall flow of another data retransmission method according to an embodiment of the present invention.
- FIG. 11 is a schematic structural diagram of a data processing device provided by an embodiment of the present invention.
- FIG. 12 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
- FIG. 13 is a schematic structural diagram of a back-end device provided by an embodiment of the present invention.
- Figure 1 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention.
- the system architecture may include a collection server (110) and client devices (such as client device 121, client device 122, and client devices). End device 123).
- client devices such as client device 121, client device 122, and client devices.
- End device 123 It should be understood that the present invention does not specifically limit the number of collection servers and the number of clients. For example, one collection server can be connected to only one client device, or can be connected to multiple client devices at the same time.
- the connection method is not limited to wired or wireless.
- the client device may refer to a server that provides an application program, and the application program is an application program with an embedded browser.
- At least one client device may be set in at least one business system, for example, the client device 121 is a client device set in a loan business system, the client device 122 is a client device set in an insurance business system, and the client device 123 is a client device set in an insurance business system. It is a client device set in the wealth management business system.
- the client device can detect the operation triggered by the user on the browser of the application and can provide the user with corresponding services.
- FIG. 2 is a schematic diagram of the overall process corresponding to a data collection method provided by an embodiment of the present invention, and the method includes:
- the client device 121 may sequentially generate the collection event 1 corresponding to the buried point event 1, the collection event 2 corresponding to the buried point event 2, and the collection event 3 corresponding to the buried point event 3. For example, when the client device 121 provides the Motodai application, if the user opens the Motodai product page of the Motodai application and triggers the "one-click loan" button on the page, the client device 121 can sequentially Query relevant information of users from multiple third-party platforms to determine whether loans can be provided to users.
- the client device 121 can first query the user’s personal information from the personal information maintenance platform. After the personal information query is passed, it can then query the user’s account opening information from the account opening information maintenance platform.
- the loan information maintenance platform queries the user’s loan qualification. If the personal information, account opening information, and loan qualification are all queried, the client device 121 can provide the user with a loan. If any of the personal information, account opening information, and loan qualification is not inquired, If passed, the client device 121 can reject the user's loan application. In this process, when performing the loan service corresponding to the "one-click loan", the client device will perform three subtasks of querying the user's personal information, querying the user's account opening information, and querying the user's loan qualifications.
- the burial event 1 instructs the client device 121 (or the user) to perform a personal query
- the buried event 2 instructs the client device 121 (or user) to perform the sub-task of querying the account opening information in the account opening information maintenance platform
- the buried event 3 instructs the client device 121 (or user) ) Perform the subtask of querying loan eligibility in the loan information maintenance platform.
- the client device 121 may sequentially generate the collection event 1 corresponding to the buried point event 1, the collection event 2 corresponding to the buried point event 2, and the collection event 3 corresponding to the buried point event 3.
- the execution interval of the three subtasks of querying the user’s personal information, querying the user’s account opening information, and querying the user’s loan eligibility is very short, possibly only a few milliseconds, so the client device 121 is executing In the process of loan business, it is equivalent to generating collection event 1, collection event 2 and collection event 3 in parallel.
- the client device 121 can transfer the collection event 1, the collection event 2, and the collection event 3 from the queue a 1 tail sequentially inserted into the queue a 1, assuming the queue capture event a 1 stored in the occupied queue a bit 0 to the position i-1, the capture event 1 can occupy queue a position I 1, capture event 2 may 1 in a holding queue position i + 1, capture event queue 3 can occupy a position of an i + 2.
- i can be an integer greater than or equal to zero.
- the client device 121 can also assign a unique identifier to the collection event.
- the unique identifier of the collection event can be set by those skilled in the art based on experience. For example, it can be set in an example. It is a combination of timestamp and random number, and the length is 16 bits.
- the content of each collection event may include, but is not limited to: application identification, user identification, collection event identification, device information, user information, and business information.
- the device information may include the device model, brand, system version, browser version, processor type, central processing unit (CPU) core number, etc.
- the user information may include the user's customer number or user The unique identification ID in the service, or may also include the user's name, gender, mobile phone number, habitual residence, etc.
- the service information may refer to the type of the buried event, the serial number of the service, etc., which is not specifically limited.
- the client device 121 is provided with a buried event.
- the client device 121 can generate a collection event ( For example, event k) is collected, and then the collection event k is placed in a queue, and the queue is used to store the collection event to be reported.
- the client device 121 can report the collection event k in the queue to the collection server 110.
- the collection event can be reported in sequence according to the sequence of the collection event in the queue.
- the collection event k can be reported again, or it can be reported according to the preset cycle.
- the client device 121 can obtain an unreported item from the queue a 1 every 2 minutes.
- the event is collected and reported to the collection server 110.
- the client device 121 may also first query whether there is a collection event being reported in the reporting process, and if it does not exist, it can directly report the collection event k to the collection server 110, if it exists, You can wait for the completion of the reporting of the collection event (for example, collection event h) being reported (that is, the response message sent by the collection server is received).
- the collection event k can be reported to the collection server 110; if it is determined that the reporting of the collection event h has failed, the number of times the collection event h has been reported to the collection server 110 can be queried If the number of reported times is greater than or equal to the preset number, it indicates that the current network is faulty. Therefore, all collection events h and other unreported collection events can be cached from queue a 1. If the reported number of times is less than the preset number, Then you can report the collection event h again, and after the reporting is completed, it is determined whether the collection event h is reported successfully, and the above steps are repeated.
- the client device 121 may remove a 1 queue.
- the client device 121 may sequentially generate the embedded point Collection event 4 corresponding to event 4, collection event 5 corresponding to buried point event 5, and collection event 6 corresponding to buried point event 6.
- the queue a 1 is deleted, there is no longer a queue for reporting collection events in the client device.
- the client device 121 can recreate a queue a 2 and collect events 4, 5, and 6 events collected in a 2 is stored in the queue. It is understandable that the client device 121 can also query to determine whether there is a buffered collection event before storing the collection event 4, the collection event 5, and the collection event 6 in the queue a 2. If there is a buffered collection event, may be buffered first capture event queue from the tail of a 2 a 2 is inserted in the queue, then the capture event 4, 5 and capture event capture event queue 6 is inserted from a 2 a 2 of the tail queue, based on the final The queue a 2 performs the reporting process. In this way, the client device 121 may first report the collection event that was not reported last time to the collection server 110, and then report the newly generated collection event this time to the collection server 110, thereby increasing the success rate of collection event collection.
- Figure 2 is only an exemplary and simple description, and the data collection methods listed are only for the convenience of explaining the solution, and do not constitute a limitation on the solution.
- the storage method of the collected data and the data to be cached The collected data can be set by those skilled in the art based on experience, or can also be set according to business needs, which is not specifically limited.
- FIG. 3 is a schematic flowchart of a data caching method provided by an embodiment of the present invention.
- the method is suitable for client devices, such as the client device 121 and the client device shown in FIG. The device 122 or the client device 123.
- the following takes the client 121 to execute the data caching method as an example for introduction.
- the method includes:
- Step 301 The client device determines the collection event to be buffered.
- the collection events to be buffered can be determined according to preset rules, which can be set by those skilled in the art based on experience, or can be specified by the user, or can be set according to business needs , Not limited.
- the preset rule may mean that the network traffic is less than the preset traffic.
- the client device 121 can monitor the changes in the network traffic in real time. Assuming traffic, it indicates that the current network is faulty. Therefore, the client device 121 can use all the collection events that have not been reported in the queue a 1 at this moment as collection events to be buffered.
- the preset rule may mean that the number of reported collection events is greater than the preset number.
- the preset number is 3, and the client device 121 is in the queue according to the collection event. in the order of a 1 reports the collected event queue is directed to a 1 in any of a capture event, if acquisition process of reporting article preset number of unsuccessful events reported to the collection server 110, the client device 121 The collection event and other unreported collection events in the queue a 1 can be regarded as collection events to be buffered.
- the client device determines a capture event from the queue is not reported in a variety of ways, the following describes two possible implementations, it can be appreciated, the event determining acquisition unreported manner also It can be set by the user according to business needs, which is not limited in the embodiment of the present invention:
- the client device 121 may preset a cursor, and the cursor is used to indicate the position of the collection event to be reported in the queue a 1.
- FIG. 4 is a schematic diagram of a method for reporting collection events based on a cursor provided by an embodiment of the present invention.
- a queue a 1 for reporting collection events has been set in the client device 121, and the queue a 1 includes a queue head and the tail, capture event can be inserted from the queue and a queue tail 1 sequentially queue a 1, queue a 1 sequentially stores a capture event 1, capture event 2 and capture event 3, capture event a holding queue a starting position 1, 0, Acquisition event 2 occupies position 1 of queue a 1 , and acquisition event 3 occupies position 2 of queue a 1.
- the cursor can indicate the initial position of queue a 1 in the initial state, that is, position 0.
- the client device 121 when the client device 121 reports the collection event for the first time, it can first obtain the collection event 1 stored in position 0 indicated by the cursor, and then The collection event 1 can be placed in the browser request queue, and the collection event 1 can be reported to the collection server 110 via the browser. If the client device 121 receives the first type response message (used to indicate that the collection event is successfully received) sent by the collection server 110, it means that the collection event 1 is successfully reported to the collection server 110, so the client device 121 can control the cursor from the queue a The direction of the head of the line 1 moves back one position to the direction of the tail of the line, so that the cursor is indicated at position 1 of the queue a 1.
- the first type response message used to indicate that the collection event is successfully received
- the client device 121 can store the collection event 2 in the position 1 indicated by the cursor. Report to the collection server 110. Further, when reporting the collection event 2, if the client device 121 receives the second type response message sent by the collection server 110 (used to indicate that no collection event is received within a set time period or an illegal format collection event is received), It means that the collection event 2 is not successfully reported to the collection server 110, so the client device 121 can report the collection event 2 repeatedly. If the preset number of times (for example, 3 times) is repeatedly reported, the second type response message sent by the collection server 110 is received.
- the preset number of times for example, 3 times
- the cursor by using the cursor to record the position of the collection event to be reported in the queue, the position of the collection event in the queue can not be changed, so that the client device does not need to move the collection event frequently to add a new collection event In the queue, it helps to reduce system performance loss.
- the cursor can also be used to easily obtain the location of the next collection event to be reported to improve the flexibility of data collection.
- the client device 121 can use the first-in first-out queue algorithm to report the collected data, and: every time the client device 121 successfully reports a collection event, the collection event is deleted from the queue a 1 and the other The collection events are moved forward one by one, so as to keep the elements in the queue a 1 continuously updated.
- FIG. 5 is a schematic diagram of an implementation method for reporting collected data based on a first-in first-out queue algorithm according to an embodiment of the present invention.
- the queue a 1 sequentially stores collection event 1, collection event 2, and collection event 3
- a capture event queue 1 occupies the initial position 01
- a capture event queue position 2 occupied by a 1
- a capture event queue occupancy 3 1 2 position
- the client device 121 may first obtain the collection event 1 stored in the position 0 of the queue a 1 , and then place the collection event 1 in the browser request queue, and report the collection event 1 to the collection server 110 via the browser.
- the client device 121 If the client device 121 receives the first type response message sent by the collection server 110, it means that the collection event 1 is successfully reported to the collection server 110, so the client device 121 can control the collection event 1 to be moved out of the queue from the head of the queue a 1 a 1 (or delete capture event 1), and sequentially controls capture event 2 and event 3 capture a forward position, so that the capture event queue 2 occupies a position of 01, a capture event queue positions occupied 3 1 1. Thus, each client device 121 reported a capture event are collected in the queue in the event of an initial position.
- the client device 121 when reporting the collection event 2, if the client device 121 receives the second type response message sent by the collection server 110, it means that the collection event 2 was not successfully reported to the collection server 110, so the client device 121 can repeat the preset The collection event 2 is reported the number of times (not as good as 3 times). If the second type of response message sent by the collection server 110 is received for 3 times of repeated reporting, it means that the collection event 2 has not been successfully reported to the collection server 110 in the 3 repeated reports. The current network is faulty, so the client device 121 can use the collection events in the queue a 1 that are not reported to the collection server 110 as collection events to be buffered.
- the collection events stored in the queue a 1 are all collection events that have not been reported to the collection server 110, that is, when a network failure is determined, the client device 121 may capture event queues are stored in a 1 a 1 in the queue buffer.
- the storage space occupied by the queue can be reduced, so that there is no need to re-expand the storage space for the queue when the collection events increase, which helps to improve the availability of the queue and Utilization rate of storage space.
- the position indicated by the cursor in queue a 1 can be transferred to queue a.
- the collection events between the end positions of 1 are taken as collection events to be buffered. If the collection event to be buffered is determined using the second implementation manner , all collection events stored in the queue a 1 can be taken as the collection events to be buffered.
- Step 302 The client device determines the target browser cache mechanism matching the browser based on the preset mapping relationship between the browser and the browser cache mechanism, and uses the target browser cache mechanism to cache the collection event.
- Example 1 Let the user specify the cache mechanism of the target browser by exposing the configuration.
- the client device 121 can pre-write a function to set the cache mechanism of the target browser, such as the waLog.using(protocol, database) function.
- the front-end or The backend directly exposes the waLog.using(protocol, database) function to the user.
- this function supports the user to input the first parameter protocol and the second parameter database.
- the first parameter protocol is used to prompt the user to specify the target browser caching mechanism.
- the optional values include but are not limited to any of localStorage, indexedDB and webSQL;
- the second parameter database is used to prompt for specifying the storage location of the collection event cached by the cache mechanism of the target browser.
- the function becomes: waLog.using(localStorage, test).
- waLog.using This shows that the user specifies to use the localStorage caching mechanism as the target browser's caching mechanism, and sets the collection events cached by the localStorage caching mechanism to be stored in a database named ‘test’.
- test a database named ‘test’.
- the caching mechanism is used as a caching mechanism of the target browser.
- the user can send a response message that the caching mechanism of the target browser does not exist.
- the browser caching mechanism can be specified by the user to meet the actual needs of the user, thereby more satisfying the actual scene, and the user experience is better.
- Example 2 According to the support of the browser, the cache mechanism of the target browser that matches the browser is automatically selected.
- the client device 121 may first obtain the configuration file of the browser from the application, and determine from the configuration file of the browser whether there are multiple The object corresponding to the browser cache mechanism. If the window.localStorage object exists in the browser configuration file, the localhost cache mechanism is determined as an alternative browser cache mechanism. If the browser configuration file contains the window.indexedDB object, For any one or more of the window.IDBTransaction object and window.IDBKeyRange object, the indexDB caching mechanism is used as an alternative browser caching mechanism. If the window.openDatabase object exists in the browser configuration file, WebSQL will be cached Mechanism as an alternative browser caching mechanism.
- the candidate browser cache object with the highest priority among the multiple candidate browser cache objects may be determined as the target browser cache object.
- the browser caching mechanism with the highest priority can be used to perform the caching operation, thereby improving the cache
- the priority of multiple browser caching mechanisms can be set as needed, which can better meet the needs of users.
- the client device 121 may also first obtain the configuration file of the browser from the application, and then detect whether the configuration file of the browser contains window.localStorage object, if it is, the local host caching mechanism can be determined as the target browser caching mechanism, if not, it can be detected whether the browser's configuration file contains the system browser database object, window.IDBTransaction object and window.IDBKeyRange Any one or any number of objects in the object, if it is, the indexDB caching mechanism can be used as the target browser’s caching mechanism, if not, it can be detected whether the browser’s configuration file contains the window.openDatabase object, if so, you can change
- the WebSQL cache mechanism is a cache mechanism of the target browser.
- the cache mechanism supported by the browser is determined by querying the configuration file, which can accurately match the appropriate target cache mechanism; and by setting the order of detecting browser objects in the configuration file, you can When a browser cache mechanism corresponds to an object, the browser cache mechanism is directly determined as the target browser cache mechanism, and there is no need to perform the operation of detecting objects of other browser cache mechanisms, so the operation is relatively simple, efficient and flexible Strong sex.
- Example 3 Combine implementation example 1 and example 2.
- the client device 121 may first determine whether there is a browser caching mechanism specified by the user according to the solution in Example 1. If it exists, the browser caching mechanism specified by the user is used as the target caching mechanism; if it does not exist, then the browser caching mechanism specified by the user is used as the target caching mechanism. Then automatically determine the target caching mechanism that matches the browser according to the scheme in Example 2.
- FIG. 6 is a schematic flowchart of a method for determining a cache mechanism of a target browser according to an embodiment of the present invention.
- the method can be applied to client devices, such as the client device 121 and the client device 122 in FIG. 1 Or client device 123.
- the method includes:
- step 601 the client device determines whether there is a browser caching mechanism specified by the user, if yes, execute step 602, and if not, execute step 603.
- the judgment method may be: the client device first calls the waLog.using(protocol, database) function to determine whether the first parameter protocol of the function is assigned a value, and if so, it is determined that there is a user-specified Browser caching mechanism, if not, it is determined that there is no browser caching mechanism specified by the user.
- step 602 the client device uses the browser caching mechanism specified by the user as the target browser caching mechanism, and executes step 610.
- the user can assign localStorage, indexedDB or webSQL to the first parameter protocol, thereby specifying any one of the localStorage caching mechanism, indexedDB caching mechanism, and webSQL caching mechanism.
- the localhost caching mechanism can be used as the target browser caching mechanism.
- the indexedDB caching mechanism can be used as the target browsing Browser caching mechanism.
- the browser caching mechanism specified by the user is the webSQL caching mechanism
- the webSQL caching mechanism can be used as the target browser caching mechanism.
- step 603 the client device determines whether the configuration file of the browser contains the window.localStorage object, if so, execute step 604, and if not, execute step 605.
- step 604 the client device uses the localhost caching mechanism as the target browser caching mechanism, and executes step 610.
- Step 605 The client device determines whether the configuration file of the browser contains any one or more of the window.indexedDB object, window.IDBTransaction object, and window.IDBKeyRange object. If yes, execute step 606, if not, then Go to step 607.
- step 606 the client device uses the indexDB caching mechanism as the target browser caching mechanism, and executes step 610.
- step 607 the client device determines whether the configuration file of the browser contains the window.openDatabase object, if yes, execute step 608, and if not, execute step 609.
- step 608 the client device uses the WebSQL caching mechanism as the target browser caching mechanism, and executes step 610.
- Step 609 The client device generates and sends an alarm message, and/or does not cache the collected events to be cached.
- step 610 the client device uses the cache mechanism of the target browser to cache the collected events to be cached.
- Example 3 by first determining whether the user specifies the target browser caching mechanism, and then determining the target browser caching mechanism according to the configuration file, the target caching mechanism can be accurately matched on the basis of ensuring the user's needs, and the flexibility is better.
- example 1, example 2, and example 3 integrate the localStroage caching mechanism, IndexDB caching mechanism, and WebSQL caching mechanism. These three caching mechanisms are all based on the W3C international standards. It is understandable that the embodiment of the present invention does not limit the application to only use these three browser caching mechanisms, and the user can also set the browser caching mechanism supported by the application according to business needs, which is not specifically limited.
- the client device can directly use the target browser caching mechanism to directly cache the collection events to be cached, or it can first compress the collection events to be cached, and then use the target browser caching mechanism Cache the compressed collection events to be cached.
- Two possible caching methods are described below by taking compressed collection events to be cached as an example:
- the client device can directly compress multiple collection events to be cached using a preset compression algorithm to obtain a string cache corresponding to the multiple collection events to be cached, and store the string data in the cache The storage space corresponding to the cache mechanism of the target browser.
- the preset compression algorithm can be set by those skilled in the art based on experience, and is not specifically limited.
- the client device can first extract the value of each collection event under each feature from each collection event to be cached, and then for any feature, according to the multiple collection events to be cached in the According to the value under the item feature, the feature vector corresponding to the item feature is generated. In this way, the client device can obtain the string cache corresponding to the multiple collection events to be cached according to the feature vector combination corresponding to each feature.
- the embodiment of the present invention refers to a string buffer obtained by buffering multiple collection events as a string buffer, and a string buffer obtained by buffering one collection event as a buffer event.
- Figure 7 is a schematic diagram of the process corresponding to cache mode 1.
- the client device 121 can send the collection event 1, the collection event 2 and collection event 3 are taken as collection events to be buffered.
- the extracted key can be used as a template to arrange the key and value.
- the extracted value is arranged behind the key key, so that the collection event 1, the collection event 2 and the collection event 3 are compressed into a string buffer.
- the localStorage mechanism can store the compressed string cache in the test database, and then report it to the collection server 110 again after the network is restored.
- the collection server 110 can decompress the string buffer using a decompression algorithm corresponding to the preset compression algorithm to obtain collection event 1, collection event 2, and collection event 3.
- acquisition event 1 For example, if the data format of acquisition event 1, acquisition event 2, and acquisition event 3 are:
- three keys can be extracted from collection event 1, collection event 2 and collection event 3. They are defined_name, defined_value, and deviceId, and the value of these three keys in event 1 is collected. (The value under the feature item) are h5, consumption, 4160c4, the values of the three keys in the collection event 2 are h6, account opening, and 4160c4, and the values of the three keys in the collection event 3 are h7 and statement. , 4160c4, so, using the preset compression algorithm to compress the string buffers obtained from collection event 1, collection event 2, and collection event 3 are:
- the format of the string buffer is a string data buffer, and this string data buffer contains all the data of the collection event 1, the collection event 2, and the collection event 3.
- all collected events to be buffered are compressed into a string buffer through a compression process, which can complete the buffering of collected data with fewer operations, and can reduce the space occupied by the buffered collected data. Reduce the number of subsequent retransmissions and improve the retransmission efficiency.
- the client device can use a preset compression algorithm to compress each collection event to be cached to obtain a string cache corresponding to each collection event to be cached, and can correspond to multiple collection events to be cached
- the multiple pieces of string data are cached and stored in the storage space corresponding to the cache mechanism of the target browser.
- the embodiment of the present invention refers to the string buffer corresponding to each collection event to be buffered as a buffer event.
- Figure 8 is a schematic diagram of the process corresponding to the second buffering method.
- the client device can first use the pre-setup for any of the collection event 1, the collection event 2, and the collection event 3.
- the compression algorithm extracts the key and value from the collection event, and then the extracted key can be ranked first in the array, and the extracted value can be placed behind the key as the value, thereby compressing the collection event It is a cached event.
- the localStorage mechanism can sequentially store the compressed multiple cache events in the test database, and then re-report to the collection server 110 in turn after waiting for the network to recover;
- the collection server 110 can use the decompression algorithm corresponding to the preset compression algorithm to decompress each cache event to obtain collection event 1, collection event 2, and collection event 3 respectively.
- the cache events obtained by compressing collection event 1, collection event 2 and collection event 3 using a preset compression algorithm are:
- the number of compressed collection events can be set by the user.
- the collection event 1 and the collection event can be set first. 2 Compress into a string buffer, and then compress the collection event 3 into a buffer event 3, or you can compress the collection event 1 into a buffer event 1, and then compress the collection event 2 and the collection event 3 into a string buffer, etc. ,
- the specific is not limited.
- the client embodiment of the present invention can delete the queue a 1 , thereby avoiding the queue a 1 from occupying memory space meaninglessly, and reducing the performance loss of the system.
- Data collection method illustrated based on FIG. 2 when a queue is removed after 1, when client device 121 detects that the user triggers a second predetermined operation, and generates a new acquisition event 4, 5 and capture event capture event 6, the The client device 121 can also first determine whether there is a queue that has been set up for reporting collection events.
- the client device 121 can create the queue a 2 and use it Queue a 2 stores collection event 4, collection event 5, and collection event 6.
- the collection event 5 and the collection event 6 in the queue a 2 you can first query whether the cache space corresponding to the cache mechanism of the target browser stores cache events, if so, you can first store the cache events in a 2 stored in the queue, then capture event 4, 5 and capture event capture events stored in the queue 6 a 2.
- Figure 9 is a schematic diagram of the overall flow of the data retransmission method corresponding to the acquisition event to be buffered using the buffering method one.
- the buffering method one is used to buffer the acquisition event 1, the acquisition event 2, and the acquisition event 3, a character string is obtained Buffer A, after storing string buffer A, collection event 4, collection event 5, and collection event 6 in queue a 2 , string buffer A can occupy position 0 of queue a 2 , and collection event 4 can occupy queue a 2 1 position, the position capture event queue can occupy 5 2 a 2, 6 can occupy the position capture event queue of a 2 3.
- the cursor may indicate a starting position in the queue 02, so the first client device 121 may store location 0 buffer A string is placed in the browser request queue, via a browser
- the device reports to the collection server 110.
- the client device 121 may indicate a cursor control, a 2 queue are sequentially transmitted in the queue position of a 2 Collect data; accordingly, if the second type of response message sent by the collection server 110 is received, it means that the string buffer A has not been successfully reported to the collection server 110. Therefore, the client device 121 can resend the string buffer A.
- the client device 121 can first compress the string buffer A, collection event 4, collection event 5, and collection event 6, and then compress the resulting characters
- the string cache or cache event is stored in the storage space corresponding to the cache mechanism of the target browser, and the queue a 2 can be deleted after the cache is successful.
- the cache mode is not limited to cache mode one and cache mode two.
- FIG. 10 is a schematic diagram of the data retransmission method corresponding to the acquisition event to be buffered using the second buffering method.
- the second buffering method is used to buffer the acquisition event 1
- the acquisition event 2 and the acquisition event 3 the buffer event 1 is obtained.
- the cache event 2 and buffering event 3 the cache event 1 can occupy queue a location 02
- the cache events 2 can occupy positions queue a 2 to 1
- cache events 3 can occupy positions queue a 2
- capture event 4 may occupy a queue position 2 of 3
- 5 capture event can occupy a queue position 2
- 6 can occupy the position capture event queue a 2 5.
- the cursor may indicate a starting position in the queue 02, so that the client device 121 may be stored in the first buffer location 0 event 1 is placed in the browser request queue, via a browser Report to the collection server 110.
- the client device 121 may indicate a cursor control, a 2 are sequentially transmitted in the queue buffer in the queue position of a 2 Event and collected data.
- the second type of response message sent by the collection server 110 it means that the buffer event 1 has not been successfully reported to the collection server 110. Therefore, the client device 121 can resend the buffer event 1.
- the client device 121 can compress the cache event 1, the cache event 2, the cache event 3, the collection event 4, the collection event 5, and the collection event 6, and then
- the cache mechanism of the target browser is used to store the string cache or cached event obtained by the cache in the storage space corresponding to the cache mechanism of the target browser, and the queue a 2 can be deleted after the cache is successful.
- the cache mode is not limited to cache mode one and cache mode two.
- the client device 121 may delete the string cache or cache event from the cache space corresponding to the cache mechanism of the target browser, thereby reducing the space occupied by the cache.
- the delete operation and the report operation can be executed in parallel, or the delete operation can be performed collectively after the report operation is completed. For example, every time a cache event is successfully reported, the cache event can be deleted from the cache space, or it can be waited in the queue. After the reported events are completed, the successfully reported cached events are deleted from the cache space.
- the specifics are not limited.
- an embodiment of the present invention also provides a data processing device, and the specific content of the device can be implemented with reference to the foregoing method.
- FIG. 11 is a data processing device provided by the present invention. As shown in FIG. 11, the device includes:
- the determining module 1101 is configured to determine the collection events to be buffered; the collection events to be buffered include collection events that are not successfully reported to the collection server among a plurality of collection events, and the plurality of collection events are the detection that the user triggers the browser Is generated when the task corresponding to the first preset operation is executed after the first preset operation, and each collection event is used to record the event of executing each subtask in the task;
- the caching module 1102 is configured to determine a target browser caching mechanism matching the browser based on a preset mapping relationship between the browser and the browser caching mechanism, and use the target browser caching mechanism to cache the waiting Cached collection events.
- the determining module 1101 is specifically configured to: obtain a configuration file of the browser, and if the configuration file of the browser contains a window.localStorage object, determine that the localhost caching mechanism is an alternative browser caching mechanism; If the configuration file of the browser contains any one or more of the window.indexedDB object, window.IDBTransaction object, and window.IDBKeyRange object, it is determined that the indexDB caching mechanism is an alternative browser caching mechanism; if said The configuration file of the browser contains the window.openDatabase object, the WebSQL caching mechanism is determined to be an alternative browser caching mechanism, and if there are multiple alternative browser caching mechanisms, select from the multiple alternative browser caching mechanisms The browser cache mechanism with the highest priority is used as the target browser cache mechanism.
- the determining module 1101 is specifically configured to: obtain the configuration file of the browser, detect whether the configuration file of the browser contains the window.localStorage object, and if so, determine that the local host caching mechanism is the target browser Cache mechanism; if not, detect whether the configuration file of the browser contains any one or more of the system browser database object, window.IDBTransaction object, and window.IDBKeyRange object; if so, determine the indexDB cache mechanism It is the cache mechanism of the target browser. If not, it is detected whether the browser’s configuration file contains the window.openDatabase object. If so, it is determined that the WebSQL cache mechanism is the cache mechanism of the target browser. If not, it is determined that there is no Describes the cache mechanism of the target browser matched by the browser.
- the determining module 1101 before the determining module 1101 obtains the configuration file of the browser, it is further configured to determine that there is no cache mechanism of the target browser specified by the user.
- the caching module 1102 is specifically configured to: compress a plurality of collection events to be cached using a preset compression algorithm, obtain a string cache corresponding to the plurality of collection events to be cached, and store the to-be-cached The string data corresponding to the multiple collection events are cached and stored in the storage space corresponding to the cache mechanism of the target browser.
- the caching module 1102 is specifically configured to: for each collection event to be cached, extract the value of the collection event under each feature from the collection event, and for any feature, Generate a feature vector corresponding to the feature according to the values of the multiple collection events to be cached under the feature, and combine the feature vectors corresponding to each feature to obtain the characters corresponding to the multiple collection events to be cached String cache.
- the cache module 1102 is specifically configured to: compress any collection event to be cached using a preset compression algorithm, obtain a string cache corresponding to each collection event to be cached, and store the to-be-cached The string data corresponding to each collection event is cached and stored in the storage space corresponding to the cache mechanism of the target browser.
- the device further includes a processing module 1103.
- the processing module 1103 is configured to: detect that the user triggers the After the second preset operation on the browser, multiple collection events are generated when the task corresponding to the second preset operation is executed, the first queue is created, and it is determined whether the storage space corresponding to the cache mechanism of the target browser is stored There is a string buffer, if it is, the string buffer is first stored in the first queue, and then the multiple collection events are sequentially stored in the first queue; the multiple collection events are located at all After the character string is buffered, the collected data stored in the first queue is reported to the collection server in sequence.
- embodiments of the present invention also provide a computing device, including at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the program is executed by the processing unit , So that the processing unit executes the data processing method described in any of FIGS. 2-10.
- embodiments of the present invention also provide a computer-readable storage medium that stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes The data processing method described in any of Figures 2 to 10.
- an embodiment of the present invention provides a terminal device. As shown in FIG. 12, it includes at least one processor 1201 and a memory 1202 connected to the at least one processor.
- the embodiment of the present invention does not limit the processor.
- the bus can be divided into address bus, data bus, control bus and so on.
- the memory 1202 stores instructions that can be executed by at least one processor 1201, and the at least one processor 1201 can execute the steps included in the aforementioned data processing method by executing the instructions stored in the memory 1202.
- the processor 1201 is the control center of the terminal device, which can use various interfaces and lines to connect various parts of the terminal device, and realize data by running or executing instructions stored in the memory 1202 and calling data stored in the memory 1202. deal with.
- the processor 1201 may include one or more processing units, and the processor 1201 may integrate an application processor and a modem processor.
- the application processor mainly processes the operating system, user interface, and application programs.
- the adjustment processor mainly handles issuing instructions. It can be understood that the foregoing modem processor may not be integrated into the processor 1201.
- the processor 1201 and the memory 1202 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
- the processor 1201 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.
- the general-purpose processor may be a microprocessor or any conventional processor or the like.
- the steps of the method disclosed in the embodiment of the data processing method may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
- the memory 1202 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules.
- the memory 1202 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc.
- the memory 1202 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
- the memory 1202 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
- an embodiment of the present invention provides a back-end device. As shown in FIG. 13, it includes at least one processor 1301 and a memory 1302 connected to the at least one processor.
- the embodiment of the present invention does not limit the processing.
- the bus can be divided into address bus, data bus, control bus and so on.
- the memory 1302 stores instructions that can be executed by at least one processor 1301, and the at least one processor 1301 can execute the steps included in the aforementioned data processing method by executing the instructions stored in the memory 1302.
- the processor 1301 is the control center of the back-end equipment.
- the processor 1301 may include one or more processing units, and the processor 1301 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, application programs, etc., and the modem processor Mainly analyze the received instructions and analyze the received results. It can be understood that the foregoing modem processor may not be integrated into the processor 1301. In some embodiments, the processor 1301 and the memory 1302 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
- the processor 1301 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.
- the general-purpose processor may be a microprocessor or any conventional processor or the like.
- the steps of the method disclosed in the embodiment of the data processing method may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
- the memory 1302 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules.
- the memory 1302 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc.
- the memory 1302 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
- the memory 1302 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
- the embodiments of the present invention can be provided as methods or computer program products. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
- a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
- the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
Claims (16)
- 一种数据处理方法,其特征在于,所述方法包括:确定待缓存的采集事件;所述待缓存的采集事件包括多个采集事件中未成功上报给采集服务器的采集事件,所述多个采集事件为检测到用户触发浏览器上的第一预设操作后,在执行所述第一预设操作对应的任务时生成的,每个采集事件用于记录执行所述任务中的每个子任务的事件;基于预设的浏览器与浏览器缓存机制之间的映射关系,确定与所述浏览器匹配的目标浏览器缓存机制,并使用所述目标浏览器缓存机制缓存所述待缓存的采集事件。
- 根据权利要求1所述的方法,其特征在于,所述确定与所述浏览器匹配的目标浏览器缓存机制,包括:获取所述浏览器的配置文件;若所述浏览器的配置文件中包含window.localStorage对象,则确定本地主机缓存机制为备选浏览器缓存机制;若所述浏览器的配置文件中包含系统浏览器数据库对象、window.IDBTransaction对象和window.IDBKeyRange对象中的任意一项或任意多项,则确定indexDB缓存机制为备选浏览器缓存机制;若所述浏览器的配置文件中包含window.openDatabase对象,则确定WebSQL缓存机制为备选浏览器缓存机制;若存在多个备选浏览器缓存机制,则从所述多个备选浏览器缓存机制中选择优先级最大的浏览器缓存机制作为所述目标浏览器缓存机制。
- 根据权利要求1所述的方法,其特征在于,所述确定与所述浏览器匹配的目标浏览器缓存机制,包括:获取所述浏览器的配置文件;检测所述浏览器的配置文件中是否包含window.localStorage对象,若是,则确定本地主机缓存机制为目标浏览器缓存机制;若否,则检测所述浏览器的配置文件中是否包含系统浏览器数据库对象、window.IDBTransaction对象和window.IDBKeyRange对象中的任意一项或任意多项,若是,则确定indexDB缓存机制为目标浏览器缓存机制,若否,则检测所述浏览器的配置文件中是否包含window.openDatabase对象,若是,则确定WebSQL缓存机制为目标浏览器缓存机制,若否,则确定不存在与所述浏览器匹配的目标浏览器缓存机制。
- 根据权利要求1所述的方法,其特征在于,所述使用所述目标浏览器缓存机制缓存所述待缓存的采集事件,包括:使用预设压缩算法压缩待缓存的多条采集事件,得到所述待缓存的多条采集事件对应的字符串缓存,并将所述待缓存的多条采集事件对应的字符串数据缓存存储至所述目标浏览器缓存机制对应的存储空间。
- 根据权利要求4所述的方法,其特征在于,所述使用预设压缩算法压缩待缓存的多条采集事件,得到所述待缓存的多条采集事件对应的字符串缓存,包括:针对于待缓存的每条采集事件,从所述采集事件中提取得到所述采集事件在各项特征下的值;针对于任一项特征,根据所述待缓存的多条采集事件在所述特征下的值,生成所述特征对应的特征向量;根据各项特征对应的特征向量,组合得到所述待缓存的多条采集事件对应的字符串缓 存。
- 根据权利要求1所述的方法,其特征在于,所述使用所述目标浏览器缓存机制缓存所述采集事件,包括:使用预设压缩算法压缩待缓存的任一采集事件,得到待缓存的每个采集事件对应的字符串缓存,并将所述待缓存的每个采集事件对应的字符串数据缓存存储至所述目标浏览器缓存机制对应的存储空间。
- 根据权利要求1至6中任一项所述的方法,其特征在于,所述使用所述目标浏览器缓存机制缓存所述待缓存的采集事件之后,还包括:检测到用户触发所述浏览器上的第二预设操作后,在执行所述第二预设操作对应的任务时生成多条采集事件;创建第一队列,确定所述目标浏览器缓存机制对应的存储空间中是否存储有字符串缓存,若是,则先将所述字符串缓存存储在所述第一队列中,再将所述多条采集事件依次存储在所述第一队列中;所述多条采集事件位于所述字符串缓存之后;若否,则将所述多条采集事件依次存储在所述第一队列中;依次将所述第一队列中存储的采集数据上报给所述采集服务器。
- 一种数据处理装置,其特征在于,所述装置包括:确定模块,用于确定待缓存的采集事件;所述待缓存的采集事件包括多个采集事件中未成功上报给采集服务器的采集事件,所述多个采集事件为检测到用户触发浏览器上的第一预设操作后,在执行所述第一预设操作对应的任务时生成的,每个采集事件用于记录执行所述任务中的每个子任务的事件;缓存模块,用于基于预设的浏览器与浏览器缓存机制之间的映射关系,确定与所述浏览器匹配的目标浏览器缓存机制,并使用所述目标浏览器缓存机制缓存所述待缓存的采集事件。
- 根据权利要求8所述的装置,其特征在于,所述确定模块具体用于:获取所述浏览器的配置文件;若所述浏览器的配置文件中包含window.localStorage对象,则确定localhost缓存机制为备选浏览器缓存机制;若所述浏览器的配置文件中包含window.indexedDB对象、window.IDBTransaction对象和window.IDBKeyRange对象中的任意一项或任意多项,则确定indexDB缓存机制为备选浏览器缓存机制;若所述浏览器的配置文件中包含window.openDatabase对象,则确定WebSQL缓存机制为备选浏览器缓存机制;若存在多个备选浏览器缓存机制,则从所述多个备选浏览器缓存机制中选择优先级最大的浏览器缓存机制作为所述目标浏览器缓存机制。
- 根据权利要求8所述的装置,其特征在于,所述确定模块具体用于:获取所述浏览器的配置文件;检测所述浏览器的配置文件中是否包含window.localStorage对象,若是,则确定本地主机缓存机制为目标浏览器缓存机制;若否,则检测所述浏览器的配置文件中是否包含系统浏览器数据库对象、window.IDBTransaction对象和window.IDBKeyRange对象中的任意一项或任意多项,若是,则确定indexDB缓存机制为目标浏览器缓存机制,若否,则检测所述浏览器的配置文件中是否包含window.openDatabase对象,若是,则确定WebSQL缓存机制为目标浏览器缓存机制,若否,则确定不存在与所述浏览器匹配的目标浏览器缓存机制。
- 根据权利要求8所述的装置,其特征在于,所述缓存模块具体用于:使用预设压缩算法压缩待缓存的多条采集事件,得到所述待缓存的多条采集事件对应的字符串缓存,并将所述待缓存的多条采集事件对应的字符串数据缓存存储至所述目标浏览器缓存机制对应的存储空间。
- 根据权利要求11所述的装置,其特征在于,所述缓存模块具体用于:针对于待缓存的每条采集事件,从所述采集事件中提取得到所述采集事件在各项特征下的值;针对于任一项特征,根据所述待缓存的多条采集事件在所述特征下的值,生成所述特征对应的特征向量;根据各项特征对应的特征向量,组合得到所述待缓存的多条采集事件对应的字符串缓存。
- 根据权利要求8所述的装置,其特征在于,所述缓存模块具体用于:使用预设压缩算法压缩待缓存的任一采集事件,得到所述待缓存的每个采集事件对应的字符串缓存,并将所述待缓存的每个采集事件对应的字符串数据缓存存储至所述目标浏览器缓存机制对应的存储空间。
- 根据权利要求8至13中任一项所述的装置,其特征在于,所述装置还包括处理模块,所述缓存模块使用所述目标浏览器缓存机制缓存所述待缓存的采集事件之后,所述处理模块用于:检测到用户触发所述浏览器上的第二预设操作后,在执行所述第二预设操作对应的任务时生成多条采集事件;创建第一队列,确定所述目标浏览器缓存机制对应的存储空间中是否存储有字符串缓存,若是,则先将所述字符串缓存存储在所述第一队列中,再将所述多条采集事件依次存储在所述第一队列中;所述多条采集事件位于所述字符串缓存之后;若否,则将所述多条采集事件依次存储在所述第一队列中;依次将所述第一队列中存储的采集数据上报给所述采集服务器。
- 一种计算设备,其特征在于,包括至少一个处理单元以及至少一个存储单元,其中,所述存储单元存储有计算机程序,当所述程序被所述处理单元执行时,使得所述处理单元执行权利要求1~7任一权利要求所述的方法。
- 一种计算机可读存储介质,其特征在于,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行权利要求1~7任一权利要求所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911031641.2A CN110795166B (zh) | 2019-10-28 | 2019-10-28 | 一种数据处理方法及装置 |
CN201911031641.2 | 2019-10-28 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021082859A1 true WO2021082859A1 (zh) | 2021-05-06 |
Family
ID=69441554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/119040 WO2021082859A1 (zh) | 2019-10-28 | 2020-09-29 | 一种数据处理方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110795166B (zh) |
WO (1) | WO2021082859A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113382056A (zh) * | 2021-06-07 | 2021-09-10 | 北京博睿宏远数据科技股份有限公司 | 数据上报方法、装置、设备、存储介质及系统 |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795166B (zh) * | 2019-10-28 | 2021-08-20 | 深圳前海微众银行股份有限公司 | 一种数据处理方法及装置 |
CN111880947B (zh) * | 2020-07-20 | 2023-12-15 | 中国银联股份有限公司 | 一种数据传输方法及装置 |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103294700A (zh) * | 2012-02-24 | 2013-09-11 | 腾讯科技(北京)有限公司 | 一种跨浏览器的数据本地存储方法和装置 |
WO2014034002A1 (ja) * | 2012-08-31 | 2014-03-06 | パナソニック株式会社 | ウェブページキャッシュ装置、ウェブページキャッシュ方法、プログラム、及び集積回路 |
CN104657358A (zh) * | 2013-11-15 | 2015-05-27 | 腾讯科技(深圳)有限公司 | 实现网页程序离线缓存的方法和系统 |
CN105045539A (zh) * | 2015-08-20 | 2015-11-11 | 百度在线网络技术(北京)有限公司 | 数据离线存储的控制方法和装置 |
CN107025260A (zh) * | 2016-12-27 | 2017-08-08 | 阿里巴巴集团控股有限公司 | 实现Web离线存储的方法、装置及电子设备 |
CN107688568A (zh) * | 2016-08-03 | 2018-02-13 | 腾讯科技(深圳)有限公司 | 基于网页访问行为记录的采集方法及装置 |
CN109815433A (zh) * | 2019-01-11 | 2019-05-28 | 平安科技(深圳)有限公司 | 浏览器本地存储方法及装置、存储介质及电子设备 |
CN110795166A (zh) * | 2019-10-28 | 2020-02-14 | 深圳前海微众银行股份有限公司 | 一种数据处理方法及装置 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060031382A1 (en) * | 2004-06-04 | 2006-02-09 | Arvind Pradhakar | System and method for translating fully qualified domain name access in a browser environment |
CN103618799B (zh) * | 2013-12-04 | 2018-11-30 | 北京奇安信科技有限公司 | 浏览器缓存处理方法、系统及代理服务器 |
CN106874293B (zh) * | 2015-12-11 | 2020-12-29 | 北京国双科技有限公司 | 一种数据处理方法及装置 |
CN107480277B (zh) * | 2017-08-22 | 2021-01-26 | 北京京东尚科信息技术有限公司 | 用于网站日志采集的方法及装置 |
CN110298004B (zh) * | 2019-06-06 | 2023-03-28 | 创新先进技术有限公司 | 一种目标对象的缓存管理方法、系统、装置及电子设备 |
-
2019
- 2019-10-28 CN CN201911031641.2A patent/CN110795166B/zh active Active
-
2020
- 2020-09-29 WO PCT/CN2020/119040 patent/WO2021082859A1/zh active Application Filing
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103294700A (zh) * | 2012-02-24 | 2013-09-11 | 腾讯科技(北京)有限公司 | 一种跨浏览器的数据本地存储方法和装置 |
WO2014034002A1 (ja) * | 2012-08-31 | 2014-03-06 | パナソニック株式会社 | ウェブページキャッシュ装置、ウェブページキャッシュ方法、プログラム、及び集積回路 |
CN104657358A (zh) * | 2013-11-15 | 2015-05-27 | 腾讯科技(深圳)有限公司 | 实现网页程序离线缓存的方法和系统 |
CN105045539A (zh) * | 2015-08-20 | 2015-11-11 | 百度在线网络技术(北京)有限公司 | 数据离线存储的控制方法和装置 |
CN107688568A (zh) * | 2016-08-03 | 2018-02-13 | 腾讯科技(深圳)有限公司 | 基于网页访问行为记录的采集方法及装置 |
CN107025260A (zh) * | 2016-12-27 | 2017-08-08 | 阿里巴巴集团控股有限公司 | 实现Web离线存储的方法、装置及电子设备 |
CN109815433A (zh) * | 2019-01-11 | 2019-05-28 | 平安科技(深圳)有限公司 | 浏览器本地存储方法及装置、存储介质及电子设备 |
CN110795166A (zh) * | 2019-10-28 | 2020-02-14 | 深圳前海微众银行股份有限公司 | 一种数据处理方法及装置 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113382056A (zh) * | 2021-06-07 | 2021-09-10 | 北京博睿宏远数据科技股份有限公司 | 数据上报方法、装置、设备、存储介质及系统 |
Also Published As
Publication number | Publication date |
---|---|
CN110795166A (zh) | 2020-02-14 |
CN110795166B (zh) | 2021-08-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021082859A1 (zh) | 一种数据处理方法及装置 | |
WO2021082858A1 (zh) | 一种数据采集方法及装置 | |
CN109034993B (zh) | 对账方法、设备、系统及计算机可读存储介质 | |
US9811577B2 (en) | Asynchronous data replication using an external buffer table | |
US20150058308A1 (en) | Generating cache query requests | |
US10043220B2 (en) | Method, device and storage medium for data processing | |
CN110262807B (zh) | 集群创建进度日志采集系统、方法和装置 | |
US10649905B2 (en) | Method and apparatus for storing data | |
CN110019873B (zh) | 人脸数据处理方法、装置及设备 | |
WO2021139131A1 (zh) | 一种文件下载方法及相关产品 | |
CN113254320A (zh) | 记录用户网页操作行为的方法及装置 | |
US10657099B1 (en) | Systems and methods for transformation and analysis of logfile data | |
WO2022048358A1 (zh) | 数据处理方法、装置及存储介质 | |
CN111813573A (zh) | 管理平台与机器人软件的通信方法及其相关设备 | |
CN106991118A (zh) | 基于ceph纠删除容错的读取文件方法及装置 | |
US10430115B2 (en) | System and method for optimizing multiple packaging operations in a storage system | |
KR102247247B1 (ko) | 데이터베이스 관리 방법 | |
CN112035205A (zh) | 数据处理方法、装置、设备和存储介质 | |
CN108062224B (zh) | 基于文件句柄的数据读写方法、装置及计算设备 | |
CN113190384B (zh) | 基于纠删码的数据恢复控制方法、装置、设备及介质 | |
CN115048595A (zh) | 数据获取方法、装置、终端及存储介质 | |
CN109241110A (zh) | 订单管理方法及系统、电子设备、存储介质 | |
CN112988812B (zh) | 库存数据的处理方法、装置、设备及存储介质 | |
CN115695326A (zh) | 数据帧传输方法、装置、计算机设备和存储介质 | |
US11977636B2 (en) | Storage transaction log |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20881442 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20881442 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 210922) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20881442 Country of ref document: EP Kind code of ref document: A1 |