CN107508759B - Information reporting method and device, computer readable storage medium and electronic equipment - Google Patents
Information reporting method and device, computer readable storage medium and electronic equipment Download PDFInfo
- Publication number
- CN107508759B CN107508759B CN201710703068.XA CN201710703068A CN107508759B CN 107508759 B CN107508759 B CN 107508759B CN 201710703068 A CN201710703068 A CN 201710703068A CN 107508759 B CN107508759 B CN 107508759B
- Authority
- CN
- China
- Prior art keywords
- uploaded
- file
- information
- path
- uploading
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000012546 transfer Methods 0.000 claims abstract description 26
- 230000001960 triggered effect Effects 0.000 claims description 27
- 230000008569 process Effects 0.000 claims description 23
- 238000004590 computer program Methods 0.000 claims description 13
- 238000012545 processing Methods 0.000 claims description 7
- 238000012217 deletion Methods 0.000 claims description 5
- 230000037430 deletion Effects 0.000 claims description 5
- 230000007704 transition Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 8
- 230000009191 jumping Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004083 survival effect Effects 0.000 description 3
- 235000008694 Humulus lupulus Nutrition 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- -1 C + + Proteins 0.000 description 1
- 102100034761 Cilia- and flagella-associated protein 418 Human genes 0.000 description 1
- 101100439214 Homo sapiens CFAP418 gene Proteins 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/122—Avoiding congestion; Recovering from congestion by diverting traffic away from congested entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0677—Localisation of faults
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/28—Routing or path finding of packets in data switching networks using route fault recovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
- Debugging And Monitoring (AREA)
Abstract
An information reporting method, an information reporting device, a computer readable storage medium and an electronic device are disclosed. The embodiment of the invention combines the acquired information into the data to be uploaded and caches the data in the memory, further writes the cached data to be uploaded into the file and uploads the data based on the writing condition, and then transfers the file to be uploaded and uploads the file based on the transferring condition, thereby effectively reporting the information acquired by the client.
Description
Technical Field
The invention relates to the internet technology, in particular to an information reporting method, an information reporting device, a computer readable storage medium and electronic equipment.
Background
The development of the mobile internet enables users to develop diverse services and collaboration based on intelligent mobile terminals. In the running and research and development processes of the internet service system, in order to ensure user experience and solve emergency situations in time, the running state and the network state of the client program need to be collected and acquired as real time as possible. Therefore, the client needs to be able to report information efficiently.
Disclosure of Invention
In view of this, embodiments of the present invention provide an information reporting method and apparatus, a computer-readable storage medium, and an electronic device, so as to effectively report information.
According to a first aspect of the embodiments of the present invention, there is provided an information reporting method, including:
collecting information, combining the collected information into data to be uploaded, and storing the data in an internal memory;
when the writing condition is triggered, writing the data to be uploaded into the file to be uploaded under the first path;
when a transfer condition is triggered, transferring the file to be uploaded to a second path; and
and uploading the file to be uploaded under the second path to a server.
According to a second aspect of embodiments of the present invention, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the method of the first aspect.
According to a third aspect of embodiments of the present invention, there is provided an electronic device comprising a memory and a processor, the memory for storing one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to the first aspect.
According to a third aspect of the embodiments of the present invention, an information reporting apparatus is provided, where the apparatus includes:
the acquisition and cache unit is used for acquiring information, combining the acquired information into data to be uploaded and storing the data in the memory;
the file writing unit is used for writing the data to be uploaded into the file to be uploaded in the first path when the writing condition is triggered;
the file transfer unit is used for transferring the file to be uploaded to a second path when a transfer condition is triggered; and
and the uploading unit is used for uploading the file to be uploaded under the second path to a server.
The embodiment of the invention combines the acquired information into the data to be uploaded and caches the data in the memory, further writes the cached data to be uploaded into the file and uploads the data based on the writing condition, and then transfers the file to be uploaded and uploads the file based on the transferring condition, thereby effectively reporting the information acquired by the client.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
fig. 1 is a flowchart of an information reporting method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of an alternative implementation of an embodiment of the invention for collecting Domain Name System (DNS) state information;
FIG. 3 is a flow chart of socket related network state information for an alternative implementation of an embodiment of the present invention;
FIG. 4 is a flow chart of an alternative implementation of an embodiment of the invention for collecting network state information via Traceroute (TraceRoute);
FIG. 5 is a flowchart of uploading a file to be uploaded in an alternative implementation of an embodiment of the invention;
fig. 6 is a flowchart of an information reporting method according to another embodiment of the present invention;
fig. 7 is a flowchart of an information reporting method according to another embodiment of the present invention;
fig. 8 is a schematic diagram of an information reporting apparatus according to an embodiment of the present invention;
fig. 9 is a schematic view of an electronic device for implementing an information reporting method according to an embodiment of the present invention.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth. It will be apparent to one skilled in the art that the present invention may be practiced without these specific details. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present invention.
Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout the description and the claims, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including, but not limited to".
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
Fig. 1 is a flowchart of an information reporting method according to an embodiment of the present invention. As shown in fig. 1, the information reporting method of this embodiment includes:
and S100, collecting information, combining the collected information into data to be uploaded, and storing the data in a memory.
Wherein the information may be collected periodically or based on other trigger conditions, such as an interrupt trigger.
And step S200, when the writing condition is triggered, writing the data to be uploaded into the file to be uploaded in the first path.
And step S300, when the transfer condition is triggered, transferring the file to be uploaded to a second path.
And S400, uploading the file to be uploaded under the second path to a server.
Therefore, the collected information can be effectively uploaded through caching, writing in files, transferring and uploading, and meanwhile, reading, writing and uploading cannot be performed too frequently, so that the efficiency is improved, and the influence on the performance of the client is reduced.
In step S100 of this embodiment, the collected information includes at least one item of information representing a network status and information of a current location. The current location information may be collected by invoking a location service of the operating system or invoking an SDK (Software Development Kit) of the navigation and location related application. Therefore, the information of the current position and the corresponding information representing the network state can be reported to the server side. The server can master the current network overall conditions of different areas based on a large amount of information reported from the client. The service system operator and the research personnel can know the network environment of all the client terminals using the system in near real time according to the data of the server terminal, know the regional distribution of the network environment and analyze and position the network fault in time. This may allow network faults due in part to program bugs to be quickly diagnosed and located. Meanwhile, for network faults caused by infrastructure, the problems can be solved and optimized more timely through feedback of an operator to a telecom operator, and the system operation efficiency and the user experience are improved.
Specifically, the information characterizing the network status may include one or more of DNS (Domain Name System) status information, Socket (Socket) related network status information, connection status information from the current network location to the server, and collection of network status information through Traceroute (Traceroute).
Fig. 2 is a flow chart of an alternative implementation of an embodiment of the invention for collecting DNS status information. The DNS is a distributed database in which domain names and IP addresses are mapped to each other. By accessing the DNS server, the client can obtain an IP address corresponding to the domain name to be accessed. If the address configuration of the DNS server is wrong or the services of the DNS server are not available, the client's access to the network may be affected because the domain name cannot be resolved correctly. As shown in fig. 2, the process of collecting DNS status information includes:
and step S110, acquiring the address of the DNS server.
For example, a system command getprop net may be invoked at the android system to obtain the addresses of all local DNS servers configured and the addresses of network DNS servers that may be requested.
And step S120, analyzing the domain names of the hosts (Host) one by one through the acquired DNS server addresses, and acquiring an analysis result.
In this embodiment, the host is a server that provides business services with the current process.
And S130, caching the DNS server address and the corresponding resolution result.
Thereby, status information of a plurality of DNS servers can be obtained. Further, based on this information, it can be determined whether domain name resolution is normal.
Fig. 3 is a flow chart of collecting Socket (Socket) related network state information in an alternative implementation manner according to the embodiment of the present invention. Applications typically make or respond to network requests through sockets (sockets). Therefore, whether normal communication with the Host (Host) is possible through Socket is also network status information that operators and developers wish to know. As shown in fig. 3, the process of collecting Round-Trip Time (RTT) for establishing a communication connection through Socket includes:
and step S140, establishing a Socket address.
And S150, sending a Socket request.
And step S160, receiving a Socket response to obtain the round-trip delay.
And step S170, caching the currently obtained round-trip delay.
Thus, the state of communication between the client and the host based on Socket can be obtained.
The internet communicates on a packet basis. Ping (packet Internet groper) is a packet explorer, which is a program for testing network connection capacity that can be used under various operating systems. The PING program can detect whether the host is communicable and how the communication quality is by sending a packet. For example, the round trip delay of sending a packet To the host and the Time To Live (TTL) of the packet may be collected through a "ping-c count host" command. Thus, the network state at the packet level between the client and the host can be tested by sending packets through ping commands.
Fig. 4 is a flowchart of an alternative implementation of the embodiment of the present invention for collecting network state information through Traceroute (Traceroute). Traceroute may detect the number of Hops (Hops) and the elapsed time to reach the host from the current network address. As shown in fig. 4, the process of collecting network status information through route tracing includes:
and step S180, setting the self-increment of the survival time of the data packet.
Step S190, the packet with the set lifetime is sent to the host.
And S1A0, judging whether the return result indicates that the data packet arrives at the host, if so, jumping to the step S1B0, otherwise, jumping to the step S180.
And S1B0, judging whether the current survival time is larger than a set value, if not, skipping to the step 0C0, otherwise, skipping to the step 0D 0.
And S1C0, caching the current survival time, namely, the hop count reaching the host as the network state information.
And step S1D0, caching the error mark as network state information.
Thus, an error can be reported when the hop rate to the host is excessive.
It should be understood that the above network status information may be collected in parallel or may be collected one by one in a predetermined order.
In this embodiment, one or more pieces of network state information to be collected are periodically collected, merged with the obtained information of the current location, and then cached in the memory. Specifically, the network status information and the information of the current location are converted into character strings (i.e., data to be uploaded) according to a predetermined format, and stored in a predetermined memory structure (e.g., a cacheArray). Each string serves as a piece of data to be uploaded.
Optionally, in step S200, the writing condition is triggered when the number or size of the data to be uploaded stored in the memory reaches a writing threshold, so as to trigger writing of the data to be uploaded into the file to be uploaded in the first path. For example, the write condition may be triggered when the number of cached data to be uploaded is greater than 20.
And when the file to be uploaded exists in the first path, writing the data to be uploaded in an incremental writing mode.
And when the file to be uploaded which meets the requirement does not exist in the first path, creating a new file to be uploaded and writing the data to be uploaded.
The cached data are written into the file after meeting the preset quantity condition or size condition, so that the memory occupied by the cached data cannot be infinitely increased, the resources of a client are saved, and meanwhile, the timeliness of information acquisition can be ensured by matching the cache with a file system.
Optionally, in step S300, a transfer condition is triggered when the size of the file to be uploaded in the first path reaches an upload threshold (for example, 10kb), so as to trigger the file to be uploaded to be transferred to the second path. In subsequent step S400, the upload service traverses the file in the second path, and uploads the file to be uploaded that meets the requirement.
Therefore, the collected information is uploaded to the server after a certain amount of collected information is accumulated, the approximate period of file uploading can be adjusted by adjusting the uploading threshold set by the transfer condition, and the real-time performance and the frequency of information reporting are balanced. Meanwhile, by means of transferring the path and uploading the file, competition of writing and uploading operations on file operations can be avoided.
Since the network environment of the client may be unstable, uploading the file to be uploaded may fail. At this time, it is often necessary to report the network environment information. In this case, the strategy of using repeated uploads is a reasonable choice. However, repeated uploading without limit would result in waste of system resources and a large consumption of power by the terminal running the client application. Thus, in an alternative embodiment, the file to be uploaded may be uploaded in the following manner. As shown in fig. 5, step S400 includes:
and step S410, deleting the file to be uploaded of which the uploading failure times of the second path exceed the failure threshold value.
Wherein the failure threshold may be set to a predetermined value, e.g. 3.
Specifically, the number of file upload failures may be recorded by a dedicated variable or file and modified after each upload operation.
And step S420, uploading the undeleted file to be uploaded in the second path to the server.
In this step, all the files in the second path may be traversed, and the files may be uploaded one by one or in parallel. Specifically, the file upload may be performed by any one of an HTTP POST method, Socket, FTP, or other means.
And step S430, deleting the files to be uploaded which are successfully uploaded.
And deleting the file to be uploaded which is successfully uploaded, so that the file cannot be uploaded again in the next uploading operation.
Therefore, the files to be uploaded with excessive uploading times and the files to be uploaded with successful uploading are deleted, and uploading is carried out in a mode of traversing all the files under the second path, so that balance can be achieved between the fact that information is reported successfully and system resources are saved.
Preferably, the uploading frequency information may be added to the file name of the file to be uploaded on the second path, so that whether the uploading frequency of the specific file exceeds the failure threshold value may be determined according to the file name. Meanwhile, the step S400 further includes a step S440 (indicated by a dotted line in the figure), after the step S430, modifying upload number information in the file name of the file to be uploaded, of which the upload has failed.
For example, the file name of the file to be uploaded in the first path is "file to be uploaded 0001. txt". When the file is transferred to the second path, its name is modified to "file to upload 0001_0. txt". That is, a record of the number of uploads is added at the end of its original main file name. Since the file to be uploaded is just transferred to the second path and is not uploaded, the initial value of the number of uploads is 0. Subsequently, after each uploading, the uploading frequency information of all the undeleted files under the second path is increased. Taking "file to be uploaded 0001_0. txt" as an example, if the file to be uploaded "file to be uploaded 0001_0. txt" is not successfully uploaded after one uploading operation, after step S430, the file still exists under the second path. Therefore, the file name "file to be uploaded 0001_0. txt" is modified to "file to be uploaded 0001_1. txt". When the failure threshold is 3, if the file with the initial name of "file to be uploaded 0001_0. txt" is still not uploaded successfully after 4 uploads, the name of the file is modified to "file to be uploaded 0001_4. txt". Before uploading next time, the uploading times of the file can be judged to exceed the failure threshold value according to the file name, and therefore the file is deleted.
It should be understood that although step S410 is provided before step S420 of performing the upload operation in the present implementation, step S410 may be provided at the end of all sub-steps of step S400. That is, the file to be uploaded, the number of uploads of which exceeds the failure threshold, is deleted after the end of one upload operation, which is actually equivalent to deleting the file to be uploaded, the number of uploads of which exceeds the failure threshold, before each upload. Alternatively, step S410 may also be performed between step S420 and step S430, or simultaneously with step S430.
In this embodiment, step S400 may be started periodically, or may be started immediately after step S300 is executed.
The embodiment combines the collected information into the data to be uploaded and caches the data in the memory, and then writes the cached data to be uploaded into the file and uploads the data based on the writing condition, and then transfers the file to be uploaded and uploads the file based on the transferring condition, so that the information collected by the client can be effectively reported.
Meanwhile, the embodiment of the invention can effectively collect and report the network state or the communication state between the client and the associated server (host) in near real time while realizing the service function based on the client application program used by the user by combining with the client application program running on the intelligent mobile terminal, thereby providing a new information collection mode.
Fig. 6 is a flowchart of an information reporting method according to another embodiment of the present invention. According to the embodiment, scenes for uploading information are increased, so that the real-time performance of information uploading is further guaranteed. As shown in fig. 6, the method includes:
and step S100a, after the current process is started or switched to the foreground state, detecting the second path, and if a file to be uploaded exists, jumping to step S400, otherwise, jumping to step S100.
And S100, collecting information, combining the collected information into data to be uploaded, and storing the data in a memory.
And step S200, when the writing condition is triggered, writing the data to be uploaded into the file to be uploaded in the first path.
And step S300, when the transfer condition is triggered, transferring the file to be uploaded to a second path.
And S400, uploading the file to be uploaded under the second path to a server.
After step S400 is executed, the process returns to step S100 to start to repeatedly perform information collection and report.
That is, after the process is started or switched to the foreground state, the embodiment first determines whether there is information that cannot be reported successfully before or is available for reporting, and if so, starts to upload first to ensure timeliness of information reporting.
Fig. 7 is a flowchart of an information reporting method according to another embodiment of the present invention. In the embodiment, a new file writing triggering mode and a new file uploading triggering mode are set according to the characteristics of the intelligent mobile terminal operating system. As shown in fig. 7, the information reporting method includes:
and S100, collecting information, combining the collected information into data to be uploaded, and storing the data in a memory.
Step S200a, judging whether the current process receives the notice of switching from the foreground state to the non-foreground state, if yes, jumping to step S200c, otherwise, jumping to step S200 b.
Step S200b, judging whether the writing condition is triggered, if yes, jumping to step S200d, otherwise jumping to step S100.
In step S200c, the data to be uploaded is written into the file to be uploaded on the first path.
Next, without a transfer condition trigger, the file to be uploaded is directly transferred to the second path in step S300 a. Step S300a goes to step S400, and uploads the file to be uploaded on the second path to the server.
Meanwhile, if it is not detected that the current process is to be switched from the foreground state to the non-foreground state, in step S200d, when the write-in condition is triggered, the data to be uploaded is written into the file to be uploaded in the first path.
Next, at step S300b, it is determined whether a transition condition is triggered, and if so, it jumps to step S300a, otherwise it jumps to step S100.
Thus, when the transfer condition is triggered, the file to be uploaded is transferred to the second path in step S300 a. And further uploads the file to be uploaded in the second path in step S400.
It should be understood that the file uploading method and the writing condition and the transferring condition adopted in the foregoing embodiments may be applied to this embodiment.
In the operating system of the mobile terminal, the state in which the process is in use and display interaction is referred to as a foreground state, and the user may switch it to a background state or to another state (e.g., a background mode in an IOS system) as needed. After being switched, the process has a period of time to be able to perform a predetermined task. In this embodiment, when the current process receives a notification of switching from the foreground state to the non-foreground state, the write-in condition is triggered, and the transfer operation and the upload operation are triggered after the data to be uploaded is successfully written in. By the mode, the method and the device can adapt to the operation of the user on the intelligent mobile terminal, and the real-time performance of information reporting is guaranteed.
The information reporting method of the embodiment can be applied to various application scenes in which information reporting is expected to be performed based on the intelligent mobile terminal. In particular, in an O2O (Online To offline) business system, operators and developers are more concerned about the network status of each client in the system. Since merchants in an O2O business system typically use merchant client applications for extended periods of time, applying the above-described method to O2O merchant client applications may effectively and continuously monitor network status information or other information of interest for different network locations and geographic locations.
Fig. 8 is a schematic diagram of an information reporting apparatus according to an embodiment of the present invention. As shown in fig. 8, an information reporting apparatus 8 of this embodiment includes a collecting and caching unit 81, a file writing unit 82, a file transferring unit 83, and an uploading unit 84.
The collecting and buffering unit 81 is configured to collect information, combine the collected information into data to be uploaded, and store the data in a memory. The file writing unit 82 is configured to write the data to be uploaded into the file to be uploaded in the first path when the writing condition is triggered. The file transfer unit 83 is configured to transfer the file to be uploaded to the second path when a transfer condition is triggered. The uploading unit 84 is configured to upload the file to be uploaded in the second path to the server.
Further, the collected information includes at least one of information characterizing a network status and information of a current location.
Further, the file writing unit 82 triggers the writing condition when the number or size of the data to be uploaded stored in the memory reaches a writing threshold.
Further, the file transfer unit 83 triggers the transfer condition when the size of the file to be uploaded reaches an upload threshold.
Further, the uploading unit 84 includes a first deleting subunit 84a, an uploading subunit 84b, and a second deleting subunit 84 c.
The first deleting subunit 84a is configured to delete the file to be uploaded, where the number of times of download failure of the second path exceeds a failure threshold. The uploading subunit 84b is configured to upload, to the server, the file to be uploaded that is not deleted in the second path. The second deletion subunit 84c is configured to delete the file to be uploaded, which is successfully uploaded.
Further, the file name of the file to be uploaded in the second path has uploading frequency information, and the first deletion subunit judges whether the uploading failure frequency exceeds a failure threshold value according to the uploading frequency information in the file name. Meanwhile, the uploading unit 84 further includes a filename modification subunit 84d, configured to modify the uploading frequency information in the filename of the file to be uploaded that fails to be uploaded.
Further, the apparatus further includes a start processing unit 85 and an upload start unit 86. The starting processing unit 85 is configured to detect the second path after the current process is started or switched to the foreground state. The upload starting unit 86 is configured to upload the file to be uploaded in the second path to the server when the file to be uploaded exists in the second path.
Further, the apparatus further includes a switching processing unit 87, configured to trigger the writing condition when the current process receives a notification of switching from the foreground state to the non-foreground state, and trigger the transition condition after the data to be uploaded is successfully written.
The apparatus of the present embodiment may be adapted to an O2O merchant client application running on a mobile terminal.
The embodiment of the invention combines the acquired information into the data to be uploaded and caches the data in the memory, further writes the cached data to be uploaded into the file and uploads the data based on the writing condition, and then transfers the file to be uploaded and uploads the file based on the transferring condition, thereby effectively reporting the information acquired by the client.
FIG. 9 is a schematic diagram of an electronic device for implementing methods of embodiments of the invention. The electronic device 9 includes a display 91, a memory 92 (which may include one or more computer-readable storage media), a storage controller 93, one or more processors (CPUs) 94, a peripheral interface 95, radio frequency circuitry 96, an input/output (I/O) subsystem 97, and one or more optical sensors 98 that can acquire images. These components may communicate over one or more communication buses or signal lines 99. It should be understood that the electronic device 9 shown in fig. 9 is merely an example, and the electronic device 9 may have more or fewer components than shown, may combine two or more components, or may have a different configuration or arrangement of components.
Among other things, the memory 92 may store software components such as an operating system, a communication module, an interaction module, and an application program. Each of the modules and applications described above corresponds to a set of executable program instructions that perform one or more functions and methods described in embodiments of the invention.
The flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention described above illustrate various aspects of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Also, as will be appreciated by one skilled in the art, aspects of embodiments of the present invention may be embodied as a system, method or computer program product. Accordingly, various aspects of embodiments of the invention may take the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a "circuit," module "or" system. Further, aspects of the invention may take the form of: a computer program product embodied in one or more computer readable media having computer readable program code embodied thereon.
Any combination of one or more computer-readable media may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of embodiments of the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to: electromagnetic, optical, or any suitable combination thereof. The computer readable signal medium may be any of the following computer readable media: is not a computer readable storage medium and may communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including: object-oriented programming languages such as Java, Smal ltalk, C + +, PHP, Python, and the like; and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package; executing in part on a user computer and in part on a remote computer; or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (20)
1. An information reporting method, the method comprising:
collecting information, combining the collected information into data to be uploaded, and storing the data in an internal memory;
when the writing condition is triggered, writing the data to be uploaded into the file to be uploaded under the first path;
when a transfer condition is triggered, transferring the file to be uploaded to a second path; and
and uploading the file to be uploaded under the second path to a server.
2. The method according to claim 1, wherein the collected information includes information of a current location and at least one item of information characterizing a network status.
3. The information reporting method according to claim 1, wherein the writing condition is triggered when the amount or size of the data to be uploaded stored in the memory reaches a writing threshold.
4. The information reporting method according to claim 3, wherein the transfer condition is triggered when the size of the file to be uploaded on the first path reaches an upload threshold.
5. The information reporting method according to claim 1, wherein the uploading the file to be uploaded on the second path to the server comprises:
deleting the file to be uploaded of which the uploading failure times of the second path exceed a failure threshold value;
uploading the undeleted file to be uploaded in the second path to a server; and
and deleting the files to be uploaded which are successfully uploaded.
6. The information reporting method according to claim 5, wherein the filename of the file to be uploaded on the second path has upload frequency information, and whether the upload failure frequency exceeds a failure threshold is determined according to the upload frequency information in the filename;
the uploading the file to be uploaded under the second path to the server further comprises:
and modifying the uploading frequency information in the file name of the file to be uploaded which fails to be uploaded.
7. The information reporting method according to any one of claims 1 to 6, wherein the method further comprises:
detecting the second path after the current process is started or switched to a foreground state;
and when the file to be uploaded exists in the second path, uploading the file to be uploaded in the second path to a server.
8. An information reporting method as claimed in any one of claims 1 to 6, wherein the writing condition is triggered when a current process receives a notification of switching from a foreground state to a non-foreground state, and the transition condition is triggered after the data to be uploaded is successfully written.
9. An information reporting method as claimed in claim 8, wherein the current process is an O2O merchant client application process adapted to run on the mobile terminal.
10. A computer-readable storage medium on which computer program instructions are stored, which computer program instructions, when executed by a processor, implement the method of any one of claims 1-9.
11. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any of claims 1-9.
12. An information reporting apparatus, comprising:
the acquisition and cache unit is used for acquiring information, combining the acquired information into data to be uploaded and storing the data in the memory;
the file writing unit is used for writing the data to be uploaded into the file to be uploaded in the first path when the writing condition is triggered;
the file transfer unit is used for transferring the file to be uploaded to a second path when a transfer condition is triggered; and
and the uploading unit is used for uploading the file to be uploaded under the second path to a server.
13. The information reporting device of claim 12, wherein the collected information includes information of a current location and at least one item of information characterizing a network status.
14. The apparatus according to claim 12, wherein the file writing unit triggers the writing condition when a number or size of data to be uploaded stored in a memory reaches a writing threshold.
15. The apparatus according to claim 14, wherein the file transfer unit triggers the transfer condition when a size of the file to be uploaded reaches an upload threshold.
16. The apparatus according to claim 12, wherein the uploading unit includes:
the first deletion subunit is used for deleting the file to be uploaded, of which the download and upload failure times of the second path exceed the failure threshold value;
the uploading subunit is used for uploading the undeleted file to be uploaded in the second path to the server; and
and the second deletion subunit is used for deleting the file to be uploaded which is successfully uploaded.
17. The information reporting device according to claim 16, wherein the filename of the file to be uploaded on the second path has information on the number of times of uploading, and the first deletion subunit is configured to determine whether the number of times of uploading failure exceeds a failure threshold according to the information on the number of times of uploading in the filename;
the upload unit further comprises:
and the file name modifying subunit is used for modifying the uploading frequency information in the file name of the file to be uploaded, which fails to be uploaded.
18. The information reporting apparatus according to any one of claims 12 to 17, wherein the apparatus further comprises:
the starting processing unit is used for detecting the second path after the current process is started or switched to a foreground state; and
and the uploading starting unit is used for uploading the file to be uploaded under the second path to a server when the file to be uploaded exists in the second path.
19. The information reporting apparatus according to any one of claims 12 to 17, wherein the apparatus further comprises:
and the switching processing unit is used for triggering the writing condition when the current process receives the notification of switching from the foreground state to the non-foreground state, and triggering the transfer condition after the data to be uploaded is successfully written.
20. The apparatus for reporting information as claimed in claim 19, wherein the current process is an O2O merchant client application process adapted to run on the mobile terminal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710703068.XA CN107508759B (en) | 2017-08-16 | 2017-08-16 | Information reporting method and device, computer readable storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710703068.XA CN107508759B (en) | 2017-08-16 | 2017-08-16 | Information reporting method and device, computer readable storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107508759A CN107508759A (en) | 2017-12-22 |
CN107508759B true CN107508759B (en) | 2020-06-05 |
Family
ID=60692184
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710703068.XA Expired - Fee Related CN107508759B (en) | 2017-08-16 | 2017-08-16 | Information reporting method and device, computer readable storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107508759B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108259698B (en) * | 2018-03-22 | 2020-05-15 | 深圳怡化电脑股份有限公司 | Image scanning method, system, device and computer readable storage medium |
CN111400158A (en) * | 2020-03-31 | 2020-07-10 | 新华三信息安全技术有限公司 | Information collection method and device |
CN113449172B (en) | 2021-06-03 | 2024-03-29 | 阿波罗智联(北京)科技有限公司 | Asynchronous data reporting method and device, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7506118B2 (en) * | 2003-12-25 | 2009-03-17 | Hitachi, Ltd. | Storage control subsystem for managing the online and offline states of logical volumes |
CN102196481A (en) * | 2011-06-07 | 2011-09-21 | 中兴通讯股份有限公司 | Network status report method, detection method, device and system |
CN103037005A (en) * | 2012-12-21 | 2013-04-10 | 天闻数媒科技(北京)有限公司 | File synchronization method and device of on-line storage service |
CN103973772A (en) * | 2014-04-02 | 2014-08-06 | 小米科技有限责任公司 | File reading and writing method and device |
CN104270466A (en) * | 2014-10-22 | 2015-01-07 | 中国建设银行股份有限公司 | Data reporting method and related equipment |
CN105227672A (en) * | 2015-10-13 | 2016-01-06 | 国家电网公司 | The method and system that data store and access |
-
2017
- 2017-08-16 CN CN201710703068.XA patent/CN107508759B/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7506118B2 (en) * | 2003-12-25 | 2009-03-17 | Hitachi, Ltd. | Storage control subsystem for managing the online and offline states of logical volumes |
CN102196481A (en) * | 2011-06-07 | 2011-09-21 | 中兴通讯股份有限公司 | Network status report method, detection method, device and system |
CN103037005A (en) * | 2012-12-21 | 2013-04-10 | 天闻数媒科技(北京)有限公司 | File synchronization method and device of on-line storage service |
CN103973772A (en) * | 2014-04-02 | 2014-08-06 | 小米科技有限责任公司 | File reading and writing method and device |
CN104270466A (en) * | 2014-10-22 | 2015-01-07 | 中国建设银行股份有限公司 | Data reporting method and related equipment |
CN105227672A (en) * | 2015-10-13 | 2016-01-06 | 国家电网公司 | The method and system that data store and access |
Also Published As
Publication number | Publication date |
---|---|
CN107508759A (en) | 2017-12-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110457199B (en) | Performance test method and device | |
US10897391B2 (en) | Fault detection method and node device | |
WO2015113450A1 (en) | Method and apparatus for visualized operation and maintenance of network | |
CN107508759B (en) | Information reporting method and device, computer readable storage medium and electronic equipment | |
JP2005278176A (en) | Evaluation and management of network traffic | |
JP5742958B2 (en) | Program, information processing apparatus, and route setting method | |
CN106411629B (en) | Method and equipment for monitoring state of CDN node | |
CN113268308B (en) | Information processing method, device and storage medium | |
US20140337471A1 (en) | Migration assist system and migration assist method | |
US11637912B2 (en) | Intermediated retrieval of networked content | |
US20170153909A1 (en) | Methods and Devices for Acquiring Data Using Virtual Machine and Host Machine | |
CN114430383B (en) | Detection node screening method and device, electronic equipment and storage medium | |
CN111258971A (en) | Application state monitoring alarm system and method based on access log | |
CN110312140B (en) | Live broadcast data processing method, device and system and computer readable storage medium | |
US20110239058A1 (en) | Switching device, inormation processing device, and recording medium for failure notification control program | |
CN111769997A (en) | Method, server, device and computer readable medium for network monitoring | |
CN112994982A (en) | Packet capture control method, device and system of cloud-real machine and storage medium | |
CN110661673B (en) | Heartbeat detection method and device | |
CN110971482B (en) | Back-end server detection method and device based on ebpf and electronic equipment | |
CN114826979B (en) | Network link quality acquisition method, device, system, equipment and storage medium | |
WO2018164618A1 (en) | Prediction of a performance indicator | |
CN113542076A (en) | Link detection method, link detection device, computer equipment and storage medium | |
CN115733768B (en) | Network node performance test method, device, equipment and medium | |
CN115021831B (en) | Weak network test method, device, system, equipment and storage medium | |
CN116582465A (en) | Link monitoring method, medium, device and computing equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 100085 Beijing, Haidian District on the road to the information on the ground floor of the 1 to the 3 floor of the 2 floor, room 11, 202 Applicant after: Beijing Xingxuan Technology Co.,Ltd. Address before: 100085 Beijing, Haidian District on the road to the information on the ground floor of the 1 to the 3 floor of the 2 floor, room 11, 202 Applicant before: Beijing Xiaodu Information Technology Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200605 |