Metering method and device for data volume
By introducing the ACK mechanism and the measurement record status modification mechanism, the problem of inconsistency in the upstream and downstream ends of the data service is solved, and accurate data measurement and user experience are achieved.
Patent Information
- Application Number
- CN202510405803.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the amount of data measured at the upstream and downstream ends of data services is inconsistent, resulting in a decline in user experience.
By introducing an ACK mechanism and a recording status modification mechanism for metrology records, we ensure the accurate measurement of data quantity, including generating confirmation signal values and modifying the measurement record status, ensuring the consistency of data quantity during data transmission.
It realizes accurate measurement of data volume at the upstream and downstream ends, improves users' experience of data services, and ensures consistency and cost control of data volume during data transmission.
Smart Images

Figure CN120263571A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of computer network technology, and in particular, to a method and device for measuring data volume. Background Art
[0002] Data service is a service that processes raw data through processing, analysis, etc., transforms it into conclusions or information with reference value, and provides it to partners. In this data service, data is regarded as a core resource, and usually, the upstream and downstream ends are billed based on the amount of data transmitted. Whether the amount of data measured by the upstream and downstream ends in the data service is consistent is the key to ensuring the data service.
[0003] Therefore, it is necessary to provide a more accurate data volume measurement scheme to make the data volumes measured by the upstream and downstream ends consistent and improve the user experience of using the data service. Summary of the Invention
[0004] In order to more accurately measure the data volumes of the upstream and downstream ends in the data service, one or more embodiments of this specification provide a method and device for measuring data volume.
[0005] In a first aspect, one or more embodiments of this specification provide a method for measuring data volume, which is applied to a first server. The method includes: in response to receiving a first data acquisition request sent by a client, sending the first data acquisition request to a second server; the first data acquisition request is used to request to acquire target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; receiving the target data of the first data volume and a second confirmation signal value sent by the second server; generating a first measurement record corresponding to the second confirmation signal value, and setting the record status of the first measurement record to a first status; sending the target data of the first data volume and the second confirmation signal value to the client; in response to receiving a second data acquisition request sent by the client, modifying the record status of the first measurement record corresponding to the second confirmation signal value saved by the first server from the first status to a second status; the second data acquisition request is used to request to acquire target data of a second data volume, and the second data acquisition request includes a second confirmation signal value; based on the measurement record saved by the first server and in the second status, measuring the data volume output by the first server to the client.
[0006] In a possible implementation, in response to receiving a second data acquisition request sent by a client, changing the record status of a first measurement record corresponding to a second confirmation signal value saved in a first server from a first status to a second status includes: in response to receiving the second data acquisition request sent by the client, sending a confirmation ACK request to a second server, where the ACK request includes the second confirmation signal value, so that the second server changes the record status of a second measurement record corresponding to the second confirmation signal value saved by it from the first status to the second status; wherein, the second server measures the data volume output by it to the first server based on the measurement record in the second status saved by it; in response to receiving an ACK notification sent by the second server, changing the record status of the first measurement record corresponding to the second confirmation signal value saved in the first server from the first status to the second status.
[0007] In a possible implementation, generating a first measurement record corresponding to a second confirmation signal value and setting the record status of the first measurement record to a first status includes: determining whether the first server saves a measurement record corresponding to the second confirmation signal value; in the case where the first server does not save a measurement record corresponding to the second confirmation signal value, generating the first measurement record corresponding to the second confirmation signal value and setting the record status of the first measurement record to the first status.
[0008] In a possible implementation, in the case where the second confirmation signal value is the same as the first confirmation signal value and the first data volume and the second data volume are different, receiving a data volume modification notification sent by the second server; the data volume modification notification is used to notify changing the second data volume to the first data volume; sending a data volume modification notification to the client.
[0009] In a possible implementation, the method further includes: detecting whether the first server saves a measurement record in the first status that exceeds a preset duration; in the case where it is detected that the first server saves a measurement record in the first status that exceeds the preset duration, changing the record status of the measurement record in the first status that exceeds the preset duration saved in the first server from the first status to the second status.
[0010] In a possible implementation, in the case where the first data acquisition request is not the first data acquisition request for target data, before sending the target data of the first data volume to the client, the method further includes: changing the record status of a third measurement record corresponding to the first confirmation signal value saved in the first server from the first status to the second status.
[0011] In a possible implementation, before sending the first data acquisition request to the second server in response to receiving the first data acquisition request sent by the client, the method further includes: receiving a task creation request sent by the client, where the task request includes acquisition rule information of target data to be acquired; generating task identification information corresponding to the task creation request, and feeding back the task identification information to the server; sending a task creation notification to the second server, where the task creation notification includes the acquisition rule information and the task identification information, so that the second server generates target data corresponding to the task identification information based on the acquisition rule information; the first data acquisition request and the second data acquisition request further include the task identification information, so that the second server determines the target data based on the task identification information.
[0012] In a possible implementation, the client integrates at least one software development kit (SDK) interface, and the second server integrates at least one service provider interface (SPI); the first server interacts with the client through at least one SDK interface, and the first server interacts with the second server through at least one SPI interface.
[0013] In a second aspect, one or more embodiments of this specification provide a method for measuring the data volume. The method is applied to the second server and includes: in response to receiving the first data acquisition request sent by the first server, generating a second confirmation signal value and a fourth measurement record; the first data acquisition request is used to request the acquisition of target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; sending the target data of the first data volume and the second confirmation signal value to the first server; in response to receiving the second data acquisition request sent by the first server, modifying the record status of the fourth measurement record saved in the second server from a first state to a second state; the second data acquisition request is used to request the acquisition of target data of a second data volume, and the second data acquisition request includes a second confirmation signal value; measuring the data volume output by the second server to the first server based on the measurement record saved in the second server and in the second state.
[0014] In a possible implementation, modifying the record status of the fourth measurement record saved in the second server from a first state to a second state in response to receiving the second data acquisition request sent by the first server includes: in response to receiving an acknowledgment (ACK) request sent by the first server, modifying the record status of the fourth measurement record saved in the second server from the first state to the second state; the ACK request includes the first confirmation signal value; sending an ACK notification to the first server to notify the first server to modify the record status of the first measurement record corresponding to the first confirmation signal value saved in the first server from the first state to the second state.
[0015] In a possible implementation, in response to receiving a first data acquisition request sent by a first server, a second confirmation signal value and a fourth measurement record are generated, including: in response to receiving the first data acquisition request sent by the first server, determining whether the first confirmation signal value carried in the first data acquisition request is the same as the third confirmation signal value; wherein, the third confirmation signal value is the confirmation signal value generated for the previous data acquisition request and saved by the second server; in the case where it is determined that the first confirmation signal value is the same as the third confirmation signal value, a second confirmation signal value and a fourth measurement record are generated.
[0016] In a possible implementation, the method further includes: in the case where it is determined that the first confirmation signal value is the same as the second confirmation signal value and the first data volume is different from the second data volume, sending a data volume modification notice to the first server; the data volume modification notice is used to notify that the second data volume is modified to the first data volume.
[0017] In a third aspect, one or more embodiments of this specification provide a method for measuring a data volume. The method is applied to a client and includes:
[0018] Sending a first data acquisition request to a first server; the first data acquisition request is used to request to acquire target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; wherein, the first confirmation signal value is the confirmation signal value received from the first server after the previous data acquisition request; in the case where the first data acquisition request is the first data acquisition request for the target data, the first confirmation signal value is a null value;
[0019] Receiving the target data of the first data volume and a second confirmation signal value sent by the first server; wherein, the second confirmation signal value is used to be carried by the client when sending the next data acquisition request, so that the first server modifies the record status of the measurement record corresponding to the second confirmation signal value to a second status based on the second confirmation signal value, and measures the data volume output by the first server to the client based on the measurement record in the second status saved by it.
[0020] Fourth aspect, one or more embodiments of this specification further provide a data volume measurement device. The device is applied to a first server, and the device includes: a first sending module, configured to send a first data acquisition request to a second server in response to receiving a first data acquisition request sent by a client; the first data acquisition request is used to request to acquire target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; a first receiving module, configured to receive the target data of the first data volume and a second confirmation signal value sent by the second server; a first generating module, configured to generate a first measurement record corresponding to the second confirmation signal value and set the record status of the first measurement record to a first status; a second sending module, configured to send the target data of the first data volume and the second confirmation signal value to the client; a first modifying module, configured to modify the record status of the first measurement record corresponding to the second confirmation signal value saved in the first server from the first status to a second status in response to receiving a second data acquisition request sent by the client; the second data acquisition request is used to request to acquire target data of a second data volume, and the second data acquisition request includes a second confirmation signal value; a first measurement module, configured to measure the data volume output by the first server to the client based on the measurement record saved in the first server and in the second status.
[0021] Fifth aspect, one or more embodiments of this specification further provide a data volume measurement device. The device is applied to a second server, and the device includes: a second generating module, configured to generate a second confirmation signal value and a fourth measurement record in response to receiving a first data acquisition request sent by the first server; the first data acquisition request is used to request to acquire target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; a third sending module, configured to send the target data of the first data volume and the second confirmation signal value to the first server; a second modifying module, configured to modify the record status of the fourth measurement record saved in the second server from the first status to a second status in response to receiving a second data acquisition request sent by the first server; the second data acquisition request is used to request to acquire target data of a second data volume, and the second data acquisition request includes a second confirmation signal value; a second measurement module, configured to measure the data volume output by it to the first server based on the measurement record saved in the second server and in the second status.
[0022] Sixth aspect, one or more embodiments of this specification further provide a device for measuring the amount of data. The device is applied to a client, and the device includes: a fourth sending module, configured to send a first data acquisition request to a first server; the first data acquisition request is used to request to acquire target data of a first data amount, and the first data acquisition request includes a first confirmation signal value; wherein, the first confirmation signal value is the confirmation signal value received from the first server after the previous data acquisition request; in the case where the first data acquisition request is the first data acquisition request for the target data, the first confirmation signal value is a null value; a second receiving module, configured to receive the target data of the first data amount and a second confirmation signal value sent by the first server; wherein, the second confirmation signal value is used to be carried when the client sends a data acquisition request next time, so that the first server modifies the record status of the measurement record corresponding to the second confirmation signal value to a second status based on the second confirmation signal value, and measures the data amount output by the first server to the client based on the measurement record in the second status saved by it.
[0023] Seventh aspect, one or more embodiments of this specification further provide an electronic device, and the electronic device includes a memory and a processor; the memory is used to store a computer program product; the processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the methods of the first aspect, the second aspect or the third aspect are implemented.
[0024] Eighth aspect, one or more embodiments of this specification further provide a computer-readable storage medium, and the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed, the methods of the first aspect, the second aspect or the third aspect are implemented.
[0025] In summary, in order to more accurately measure the data amounts of the upstream and downstream ends in the data service, one or more embodiments of this specification provide a method and a device for measuring the data amount. In this method, based on the ACK mechanism and the modification mechanism of the record status of the measurement record, the first server can make the data amount measured by the first server consistent with the data amount actually received by the client, and can make the data amount measured by the second server consistent with the data amount actually received by the first server. In addition, by specifying the data amount to be acquired in the data acquisition request, the first server can feed back the target data to the client in batches in response to the data amount requested by the client. In this way, the client can acquire the data of the corresponding data amount based on its own actual needs, so as to more accurately control the cost consumed by the data service. Description of the Drawings
[0026] To more clearly illustrate the technical solutions of one or more embodiments of this specification, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of one or more embodiments of this specification. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0027] Figure 1 A schematic diagram of an application scenario provided for one or more embodiments of this specification;
[0028] Figure 2 A schematic flowchart of a task creation method provided for one or more embodiments of this specification;
[0029] Figure 3 An interaction example diagram of a method for measuring the data volume of non-first acquisition of target data provided for one or more embodiments of this specification;
[0030] Figure 4 An interaction example diagram of a method for measuring the data volume of first acquisition of target data provided for one or more embodiments of this specification;
[0031] Figure 5 A flowchart example diagram of a method for measuring the data volume in a non-retry request scenario provided for one or more embodiments of this specification;
[0032] Figure 6 A flowchart example diagram of a method for measuring the data volume in a retry request scenario provided for one or more embodiments of this specification;
[0033] Figure 7 An interface configuration example diagram provided for one or more embodiments of this specification;
[0034] Figure 8 A flowchart example diagram of a method for measuring the data volume applied to a first server provided for one or more embodiments of this specification;
[0035] Figure 9 A flowchart example diagram of a method for measuring the data volume applied to a second server provided for one or more embodiments of this specification;
[0036] Figure 10 A structural block diagram of a data volume measurement device applied to a first server provided for one or more embodiments of this specification;
[0037] Figure 11 A structural block diagram of a data volume measurement device applied to a second server provided for one or more embodiments of this specification;
[0038] Figure 12 Block diagram of a data volume measurement device provided for one or more embodiments of this specification;
[0039] Figure 13 Block diagram of an electronic device provided for one or more embodiments of this specification. Detailed implementation manners
[0040] The following further details one or more embodiments of this specification through the accompanying drawings and embodiments. Through these descriptions, the features and advantages of one or more embodiments of this specification will become clearer and more definite.
[0041] The special term "exemplary" here means "serving as an example, embodiment or illustration". Any embodiment described as "exemplary" here does not have to be construed as superior to or better than other embodiments. Although various aspects of the embodiments are shown in the drawings, the drawings do not have to be drawn to scale unless otherwise specified.
[0042] In addition, the technical features involved in different implementation manners of one or more embodiments of this specification described below can be combined with each other as long as they do not conflict with each other.
[0043] For ease of understanding, the application scenarios of the technical solutions provided for one or more embodiments of this specification are described below first.
[0044] Data service is a service that processes and analyzes raw data, etc., to transform it into conclusions or information with reference value and provides it to partners.
[0045] As Figure 1 shown, in the application scenario of data service, it can include at least one client, a first server, and at least one second server. Among them, the client refers to the data requester, the first server can be understood as the data aggregation end, which is used to aggregate data sources in different scenarios and provide corresponding data to the client; the second server can be understood as the data processing end, which is used to process data according to the needs of the client. Among them, there can be multiple second servers to respectively provide data sources in different scenarios to the first server.
[0046] Among them, the client can send a data acquisition request to the first server to request to acquire target data; after receiving the data acquisition request, the first server forwards the data acquisition request to the second server; after receiving the data acquisition request, the second server generates the corresponding target data and feeds the target data back to the first server; after receiving the target data, the first server feeds the target data back to the client.
[0047] In the above process, after the first server sends the target data to the client, the first server measures the amount of the target data it transmits to the client. However, if the transmission link between the first server and the client is interrupted when the first server transmits the target data to the client, the client may not actually receive the data. In this way, the amount of data actually received by the client is inconsistent with the amount of data measured by the first server.
[0048] Similarly, after the second server sends the target data to the first server, the second server measures the amount of the target data it transmits to the first server. However, if the transmission link between the first server and the second server is interrupted when the second server transmits the target data to the first server, the first server may not receive the data. In this way, the amount of data actually received by the first server is inconsistent with the amount of data measured by the second server.
[0049] The first server usually charges based on the amount of data it transmits to the client, and the second server usually charges based on the amount of data it transmits to the first server. Therefore, how to more accurately measure the amount of data at the upstream and downstream ends and improve the user experience of data services is a problem that needs to be solved currently.
[0050] In order to more accurately measure the amount of data at the upstream and downstream ends in the data service scenario and improve the user experience of data services. One or more embodiments of this specification provide a method and device for measuring the amount of data.
[0051] The following describes an embodiment of a method for measuring the amount of data provided by one or more embodiments of this specification.
[0052] See Figure 2 , Figure 2 , which is a schematic flowchart of a method for measuring the amount of data provided by one or more embodiments of this specification. As Figure 2 shown, the method may include the following steps:
[0053] Step S102, the first server receives a task creation request sent by the client, and the task request includes acquisition rule information of target data to be acquired.
[0054] Step S104, the first server generates task identification information corresponding to the task creation request.
[0055] Step S106, the first server feeds back the task identification information to the client.
[0056] Step S108, the first server sends a task creation notification to the second server, and the task creation notification includes the acquisition rule information and the task identification information.
[0057] Step S110: The second server generates target data corresponding to the task identification information based on the obtained rule information.
[0058] In the above steps S102 and S110, the second server can generate corresponding target data based on the requirements of the client. Subsequently, in response to the data acquisition request of the client, the second server can send the target data to the client.
[0059] In step S102, the obtained rule information may include data type, data filtering conditions, etc.
[0060] Among them, the first server can pre-define data types corresponding to each scenario respectively. In this way, the first server can request to obtain data from the second server that provides data for the corresponding scenario based on the data type in the received data acquisition request.
[0061] The data filtering conditions may include time conditions, numerical conditions, or other custom conditions, etc. Exemplarily, the obtained rule information includes: filtering out orders with an amount greater than 1000 yuan and a status of "completed" in the first quarter of 2023 from the order data.
[0062] It should be noted that the task creation request may also include other information such as the ID of the client, which is not limited in one or more embodiments of this specification.
[0063] One or more embodiments of this specification do not limit the specific form of the task identification information. For example, the task identification information can be represented by batchNox. Among them, different task creation requests correspond to different batchNox. For example, batchNox can be batchNo1, batchNo2, batchNo3, etc.
[0064] Next, a method for transmitting target data to the client in response to the data acquisition request sent by the client after step S110 is further described.
[0065] As Figure 3 shown, the method may include the following steps:
[0066] Step S202: The first server receives a data acquisition request sent by the client. The data acquisition request includes task identification information, a first data volume, and a first confirmation signal value.
[0067] In one or more embodiments of this specification, the first server and the second server can support the client to obtain all the target data at once, or support the client to obtain the target data in batches, that is, obtain part of the target data each time. In this way, the client can obtain data with a corresponding data volume according to its actual needs, so as to more accurately control the cost consumed by the data service.
[0068] Based on this, the data acquisition request sent by the client to the first server may include the amount of data requested to request the target data corresponding to the corresponding amount of data. For example, if the target data includes 10,000 pieces of data, the amount of data requested may be 1,000 pieces of data.
[0069] It should be noted that the amount of data requested by the client in different data acquisition requests may be the same or different, and one or more embodiments of this specification do not limit this.
[0070] In one or more embodiments of this specification, in order to more accurately measure the amount of data at the upstream and downstream ends, an acknowledgment ACK mechanism is introduced during the data transmission process.
[0071] In the ACK mechanism, the second server may generate an acknowledgment signal value (ACKNo) and feedback it to the first server and the client in sequence together with the target data. In this way, when the first server and the client receive the acknowledgment signal value, they have also received the target data. After that, the acknowledgment signal value received last time is carried in the next data acquisition request initiated by the client. In this way, the first server can determine that the client has successfully received the corresponding target data based on the acknowledgment signal value. Similarly, the second server can determine that the first server has successfully received the corresponding target data based on the acknowledgment signal value.
[0072] In this way, measuring the amount of data at the upstream and downstream ends based on the acknowledgment signal value can improve the consistency of the amount of data measured at the upstream and downstream ends.
[0073] Step S204, the first server determines whether the first acknowledgment signal value is a null value.
[0074] In one or more embodiments of this specification, in the case where the data acquisition request is not the first data acquisition request for the target data, the ACK acknowledgment process may be executed first; in the case where the data acquisition request is the first data acquisition request for the target data, the ACK acknowledgment process does not need to be executed. Among them, the ACK acknowledgment process is described in detail in the subsequent steps S206 to S212.
[0075] In a possible implementation, it is possible to determine whether the data acquisition request is the first data acquisition request for the target data based on whether the first confirmation signal value carried in the data acquisition request is a null value. For example, when the first confirmation signal value carried in the data acquisition request is a null value, for example, when ACKNo = null, it can be determined that the data acquisition request is the first data acquisition request for the target data; when the first confirmation signal value carried in the data acquisition request is not a null value, for example, when the first confirmation signal value is ACKNo1, it can be determined that the data acquisition request is not the first data acquisition request for the target data.
[0076] The ACK confirmation process (steps S206 to S212) and subsequent steps S214 to S242 will be described in detail below.
[0077] In step S206, when the first confirmation signal value is not a null value, the first server sends an ACK request to the second server, and the ACK request includes the first confirmation signal value.
[0078] In step S208, in response to receiving the ACK request, the second server changes the record status of the measurement record M1 corresponding to the first confirmation signal value from the first status to the second status.
[0079] It should be noted that during the previous data acquisition request of the client for the target data, the second server can not only generate the first confirmation signal value, but also generate the measurement record M1 corresponding to the first confirmation signal value and set the record status of the measurement record M1 to the first status. This first status indicates that the second server has sent the corresponding data to the first server, but it has not been determined whether the first server has successfully received the corresponding data. Among them, the data volume recorded by the measurement record M1 is the data volume requested in the previous data acquisition request of the client for the target data.
[0080] Therefore, after the second server receives the ACK request sent by the first server, the second server can confirm that the first server has successfully received the corresponding data based on the first confirmation signal value carried in the ACK request. At this time, the second server can change the record status of the measurement record M1 to the second status. This second status indicates that the second server has sent the corresponding data to the first server and the first server has successfully received the corresponding data.
[0081] One or more embodiments of this specification do not limit the specific forms of the first status and the second status. For example, the first status can be set to init, and the second status can be set to success.
[0082] In this way, the subsequent second server can measure the amount of data output by the second server to the first server based on the measurement record in the second state saved by it. In this way, for the amount of data output by the second server to the first server, the measured amounts of data by the first server and the second server can be kept consistent.
[0083] Step S210, the second server sends an ACK notification to the first server.
[0084] Step S212, in response to receiving the ACK notification, the first server modifies the record state of the measurement record N1 corresponding to the first confirmation signal value saved by it from the first state to the second state.
[0085] It should be noted that during the previous data acquisition request of the client for the target data, after the first server sends the corresponding data to the client, it generates a measurement record N1 corresponding to the first confirmation signal value and sets the record state of the measurement record N1 to the first state. This first state indicates that the first server has sent the corresponding data to the client, but it has not been determined whether the client has successfully received the corresponding data. Among them, the amount of data recorded in the measurement record N1 is the amount of data requested by the client in the previous data acquisition request for the target data.
[0086] Therefore, after receiving the ACK notification sent by the second server, the first server can confirm that the client has successfully received the corresponding data, and can also confirm that the second server has confirmed the measurement record corresponding to the data. At this time, the first server can modify the record state of the measurement record N1 corresponding to the first confirmation signal value saved by it from the first state to the second state. This second state indicates that the first server has sent the corresponding data to the client, and the client has successfully received the corresponding data.
[0087] In this way, the subsequent first server can measure the amount of data output by the first server to the client based on the measurement record in the second state saved by it. In this way, for the amount of data output by the first server to the client, the measured amounts of data by the first server and the client can be kept consistent.
[0088] In summary, in the above steps S206 to S212, between the first server and the second server, based on the ACK confirmation process and the modification mechanism of the measurement record, the consistency of the measured amounts of data between the upstream and downstream ends can be improved.
[0089] As Figure 3 shown, when the first confirmation signal value is not a null value, after executing the above ACK confirmation process, the following steps S214 to S242 can be executed. As Figure 4As shown, in the case where the first confirmation signal value is a null value, the above ACK confirmation process may not be executed, and the following steps S214 to S242 may be directly executed.
[0090] Step S214: the first server sends a data acquisition request to the second server, where the data acquisition request includes task identification information, a first data volume, and a first confirmation signal value.
[0091] Step S216: The second server determines whether the received data acquisition request is a retry request.
[0092] In one or more embodiments of the present specification, a save point mechanism may be introduced at the second server. For example, the second server may use the confirmation signal value generated for the last data acquisition request and the amount of data requested last as a save point. The confirmation signal value in the save point may be used to verify whether the data acquisition request is a retry request, and the amount of data in the save point may be used to verify whether the amount of data requested by the retry request meets the requirements. Verifying whether the amount of data requested by the retry request meets the requirements based on the amount of data in the save point is described in subsequent steps S224 to S228.
[0093] In a possible implementation, the second server determines whether the received data acquisition request is a retry request, which can be implemented in the following manner:
[0094] When the confirmation signal carried in the received data acquisition request is the same as the confirmation signal generated for the previous data acquisition request and saved in the second server-side save point, the second server can determine that the data acquisition request received this time is not a retry request; when the confirmation signal carried in the received data acquisition request is different from the confirmation signal generated for the previous data acquisition request and saved in the second server-side save point, the second server can determine that the data acquisition request received this time is a retry request.
[0095] That is to say, if the client did not receive feedback data and a new confirmation signal after initiating a data acquisition request last time, the client cannot carry a new confirmation signal when initiating a data acquisition request this time, but still carries the same confirmation signal as the last data acquisition request. Therefore, the second server can determine whether this data acquisition request is a retry request based on the confirmation signal value saved in the save point and the confirmation signal value carried by this data acquisition request.
[0096] Exemplarily, the save point of the second server for the previous data acquisition request includes the acknowledgement signal ACKNo2. In the case where the acknowledgement signal carried in this data acquisition request is ACKNo2, it can be determined that this data acquisition request is not a retry request. In the case where the acknowledgement signal carried in this data acquisition request is ACKNo1, it can be determined that this data acquisition request is a retry request.
[0097] In the case where this data acquisition request is not a retry request, steps S218 to S222 can be executed first, and then steps S230 and subsequent steps can be executed; in the case where this data acquisition request is a retry request, the data volume verification process (i.e., steps S224 to S228) can be executed first, and then steps S230 and subsequent steps can be executed.
[0098] In this way, in the case where this data acquisition request is a retry request, the second server does not execute the above steps S218 to S222, and thus no duplicate metering records will be generated. In this way, in the case where the previous data transmission link is interrupted and the client initiates a retry, the second server will not duplicate the metering of the data volume.
[0099] Step S218, in the case where the second server determines that the received data acquisition request is not a retry request, the second server generates a second acknowledgement signal value and uses the second acknowledgement signal value and the first data volume as the save point.
[0100] Step S220, the second server generates the target data corresponding to the first data volume.
[0101] Step S222, the second server generates a metering record M2 corresponding to the second acknowledgement signal value and sets the record status of the metering record M2 to the first status.
[0102] Among them, the data volume recorded in the metering record M2 is the first data volume.
[0103] In one or more embodiments of this specification, in the case where this data acquisition request is not a retry request, the second server generates a new acknowledgement signal and a new metering record according to the above steps S218 to S222.
[0104] Step S224, in the case where the second server determines that the received data acquisition request is a retry request, the second server determines whether the first data volume is the same as the second data volume.
[0105] Step S226, in the case where the second server determines that the first data volume is not the same as the third data volume, the second server sends a data volume modification notice to the first server. The third data volume is the data volume of the previous data acquisition request saved in the save point of the second server.
[0106] Step S228, the first server sends a data volume modification notice to the client.
[0107] In the case where this data acquisition request is a retry request, since the second server will not regenerate a new metering record. Therefore, if the client modifies the data volume in the retry request, it may cause the actual data volume output by the second server subsequently to be inconsistent with the metering record.
[0108] Therefore, in the case where this data acquisition request is a retry request, the second server can further execute a data volume verification process to determine whether the first data volume carried in this data acquisition request is the same as the third data volume. If the first data volume is not the same as the third data volume, the client is notified through the first server to modify the request quantity to the third data volume and then request again.
[0109] In this way, in one or more embodiments of this specification, by using the data volume as the save point of the second server and using the data volume in the save point to verify whether the two data volumes are consistent in the retry request scenario, the consistency between the actual data volume output by the second server and its metering record in the retry request scenario can be further improved.
[0110] When the second server determines that the first data volume is the same as the third data volume; or, in the case where this data acquisition request is not a retry request and step S222 has been executed, step S230 and subsequent steps can be executed.
[0111] Step S230, the second server sends the target data corresponding to the first data volume and the second confirmation signal value to the first server.
[0112] Step S232, the first server determines whether it has a metering record corresponding to the second confirmation signal value.
[0113] Step S234, in the case where the first server determines that it does not have a metering record corresponding to the second confirmation signal value, the first server generates a metering record N2 corresponding to the second confirmation signal value and sets the record status of the metering record N2 to the first status. Among them, the data volume recorded in the metering record N2 is the first data volume.
[0114] In the following situations, the first server may already have a metering record corresponding to the second confirmation signal value: this data acquisition request is a retry request, and in the previous data acquisition request, the transmission link between the first server and the client was interrupted, and the transmission link between the first server and the second server was not interrupted.
[0115] In this way, to avoid the first server double-counting the data volume requested in the retry request scenario, after receiving the target data corresponding to the first data volume and the second confirmation signal value, the first server can first determine whether the first server has a measurement record corresponding to the second confirmation signal value saved. In the case where the first server does not have a measurement record corresponding to the second confirmation signal value saved, the first server generates a new measurement record. In the case where the first server has a measurement record corresponding to the second confirmation signal value saved, the first server does not generate a new measurement record repeatedly. In this way, it is possible to avoid the first server double-counting the data volume requested in the retry request scenario, thereby further improving the consistency of the measurement of the data volume between the first server and the client in the retry request scenario.
[0116] Step S236, the first server sends the target data corresponding to the first data volume and the second confirmation signal value to the client.
[0117] Step S238, the client saves the target data corresponding to the first data volume and the second confirmation signal value.
[0118] In the case where the client successfully receives the target data corresponding to the first data volume and the second confirmation signal value, the client can initiate a data acquisition request again to request to acquire some or all of the remaining target data, and carry the second confirmation signal value in the data acquisition request initiated again. That is to say, the above steps S202 to S238 can be repeatedly executed until the data acquisition task ends.
[0119] It should be noted that the confirmation signal value carried in each subsequent data acquisition request is the confirmation signal value received by the client last time.
[0120] Step S240, the first server measures the data volume output by the first server to the client based on the measurement record in the second state saved by it.
[0121] In one or more embodiments of this specification, the measurement record in the second state saved by the first server refers to the data successfully sent by the first server to the client, and the measurement record corresponding to this data is successfully received by the client. In this way, the first server measures the data volume output by the first server to the client based on the measurement record in the second state saved by it, which can improve the consistency of the data volume measured by the first server and the client.
[0122] Step S242, the second server measures the data volume output by the second server to the first server based on the measurement record in the second state saved by it.
[0123] In one or more embodiments of this specification, the measurement record in the second state saved by the second server refers to the data sent by the second server to the first server, and the first server successfully receives the measurement record corresponding to this data. In this way, based on the measurement records in the second state saved by the second server, the second server measures the data volume output to the first server, which can improve the consistency of the data volumes measured by the first server and the second server.
[0124] Before step S240 and step S242, one or more embodiments of this specification may further include the following steps: The first server detects whether there is a measurement record in the first state that has exceeded a preset duration saved in the first server; when it is detected that there is a measurement record in the first state that has exceeded a preset duration saved in the first server, the first server sends an ACK request to the second server, and carries the confirmation signal value corresponding to the measurement record in the first state that has exceeded the preset duration in the ACK request. After receiving this ACK request, the second server modifies the record state of the measurement record corresponding to this confirmation signal value saved in the second server to the second state, and sends an ACK notification to the first server. After that, the first server modifies the record state of the measurement record corresponding to this confirmation signal value saved in the first server to the second state.
[0125] Among them, the preset duration can be determined based on the interval duration between any two data acquisition requests. For example, the preset duration is greater than the interval duration between any two data acquisition requests. In this way, when, after exceeding this preset duration, the first server still has a measurement record in the first state that has exceeded the preset duration, it can be defaulted that this measurement record is the data volume of the last transmission for the target data. In this case, the above ACK process can be used to modify the record state of the corresponding measurement record to the second state, so that the first server and the second server can accurately measure the data volume of the last transmission.
[0126] To facilitate the understanding of the solutions provided by one or more embodiments of this specification, the following takes the first acquisition process and the second acquisition process for target data as examples for exemplary illustration.
[0127] Such as Figure 5As shown, in the first data acquisition process, the client sends a data acquisition request to the first server. The data acquisition request includes the data volume size1 and the acknowledgment signal value ACKNo = null. The first server sends a data acquisition request to the second server. The data acquisition request includes the data volume size1 and the acknowledgment signal value ACKNo = null. The second server generates a new acknowledgment signal value ACKNo1 and takes ACKNo1 and size1 as save points. The second server also generates a measurement record M1 and sets the record status of the measurement record M1 to init. After that, the second server feeds back the target data data1 of size1 and ACKNo1 to the first server. After receiving the feedback of data1 and ACKNo1 from the second server, the first server generates a measurement record N1 and sets the record status of the measurement record N1 to init. After that, the first server feeds back data1 and ACKNo1 to the client. After receiving data1 and ACKNo1, the client saves data1 and ACKNo1.
[0128] After that, the client can initiate a second data acquisition request.
[0129] In the second data acquisition process, the client sends a data acquisition request to the first server. The data acquisition request includes the data volume size2 and the acknowledgment signal value ACKNo1. The first server sends an ACK request to the second server. The ACK request includes ACKNo1. After receiving the ACK request, the second server modifies the record status of the measurement record M1 to success and feeds back an ACK notification to the first server. After receiving the ACK notification, the first server modifies the record status of the measurement record N1 to success. After that, the first server sends a data acquisition request to the second server. The data acquisition request includes size2 and ACKNo1. The second server generates a new acknowledgment signal value ACKNo2 and takes ACKNo2 and size2 as new save points. The second server also generates a measurement record M2 and sets the record status of the measurement record M2 to init. After that, the second server feeds back the target data data2 of size2 and ACKNo2 to the first server. After receiving the feedback of data2 and ACKNo2 from the second server, the first server generates a measurement record N2 and sets the record status of the measurement record N2 to init. After that, the first server feeds back data2 and ACKNo2 to the client. After receiving data2 and ACKNo2, the client saves data2 and ACKNo2.
[0130] In the case of no retry request, the above process of the second data acquisition can be repeated until the acquisition of the target data ends.
[0131] Taking the example that in the second data acquisition process, the transmission link between the client and the first server is interrupted, resulting in the client not receiving data2 and ACKNo2, and the client initiates a third data acquisition request as a retry request for exemplary illustration.
[0132] Combined with Figure 5 and Figure 6 , in the third data acquisition process, the client sends a data acquisition request to the first server, and the data acquisition request includes the data volume size2 and the acknowledgement signal value ACKNo1. The first server sends an ACK request to the second server, and the ACK request includes ACKNo1. After receiving the ACK request, the second server modifies the record status of the measurement record M1 to success and feeds back an ACK notification to the first server. After receiving the ACK notification, the first server modifies the record status of the measurement record N1 to success. Then, the first server sends a data acquisition request to the second server, and the data acquisition request includes size2 and ACKNo1. The second server feeds back the target data data2 of size2 and ACKNo2 to the first server. After receiving the feedback of data2 and ACKNo2 from the second server, the first server feeds back data2 and ACKNo2 to the client. After receiving data2 and ACKNo2, the client saves data2 and ACKNo2.
[0133] It can be seen that in the third data acquisition process, the first server and the second server will no longer generate new measurement records, thus ensuring that the data volumes of upstream and downstream measurements are consistent in the retry request scenario.
[0134] In one or more embodiments of the present specification, the client may be integrated with at least one software development kit (SDK) interface, and the second server may be integrated with at least one service provider interface (SPI). In this way, the first server can interact with the client through at least one SDK interface, and the first server can interact with the second server through at least one SPI interface.
[0135] Exemplarily, as Figure 7 shown, the client may be integrated with SDK interface 1, SDK interface 2, and SDK interface 3. The second server may be integrated with SPI1, SPI2, and SPI3.
[0136] Among them, SDK interface 1 is a task creation interface, SDK interface 2 is a file upload interface, and SDK interface 3 is a data acquisition interface. In this way, the client can request to create a task from the first server by calling SDK interface 1. The client can request to obtain data from the first server by calling SDK interface 3. The client can also transmit the acquisition rule information of the target data to be obtained to the first server by calling SDK interface 2.
[0137] In this way, by integrating the SDK provided by the first server, the client can quickly obtain the interface call ability compared with the traditional interface document docking method.
[0138] SPI1 is the task creation notification interface, SPI2 is the ACK interface, and SPI3 is the data acquisition interface. In this way, the first server can notify the second server to create a task by calling SPI1. The first server can request ACK from the second server by calling SPI2. The first server can request to obtain data from the second server by calling SPI3.
[0139] In this way, the first server can define the standard interface SPI, enabling different second servers to implement their own logics according to the interface specifications, ensuring the unity of the system.
[0140] In the data volume measurement method provided by one or more embodiments of this specification, by specifying the data volume requested to be obtained in the data acquisition request, the first server can, in response to the data volume requested by the client, feedback the target data to the client in batches. In this way, the client can obtain the data corresponding to the data volume based on its own actual needs, thereby being able to more precisely control the cost consumed by the data service.
[0141] Secondly, based on the ACK mechanism and the modification mechanism of the record status of the measurement record, the first server can make the data volume measured by the first server consistent with the data volume actually received by the client, and can make the data volume measured by the second server consistent with the data volume actually received by the first server.
[0142] In addition, in the scenario of a retry request, the first server and the second server will not repeatedly measure the data volume requested by the retry request to further ensure the consistency of the data volume measured by the upstream and downstream.
[0143] See Figure 8 , a schematic flow diagram of a data volume measurement method provided by one or more embodiments of this specification. This method is applied to the first server. As Figure 8 shown, this method may include the following steps:
[0144] Step S302, in response to receiving the first data acquisition request sent by the client, send a first data acquisition request to the second server; the first data acquisition request is used to request to obtain the target data of the first data volume, and the first data acquisition request includes a first confirmation signal value.
[0145] Step S304, receive the target data of the first data volume and the second confirmation signal value sent by the second server.
[0146] Step S306: Generate a first measurement record corresponding to the second confirmation signal value, and set the record status of the first measurement record to the first status.
[0147] Step S308: Send the target data of the first data volume to the client.
[0148] Step S310: In response to receiving the second data acquisition request sent by the client, modify the record status of the first measurement record corresponding to the second confirmation signal value saved on the first server from the first status to the second status; the second data acquisition request is used to request the acquisition of the target data of the second data volume, and the second data acquisition request includes the second confirmation signal value.
[0149] Step S312: Based on the measurement record in the second status saved on the first server, measure the data volume output by the first server to the client.
[0150] In this way, by specifying the data volume to be acquired in the data acquisition request, the first server can, in response to the data volume requested by the client, feedback the target data to the client in batches. In this way, the client can obtain the data corresponding to the data volume based on its own actual needs, so as to more accurately control the cost consumed by the data service.
[0151] Based on the ACK mechanism and the modification mechanism of the record status of the measurement record, the first server carries the confirmation signal value each time it feeds back data to the client for the client to carry this confirmation signal value in the next data acquisition request. After that, when the first server receives the confirmation signal value sent by the client, it then modifies the record status of the corresponding measurement record to the second status. In this way, based on the measurement record in the second status saved by the first server, measuring the data volume output by the first server to the client can make the data volume measured by the first server consistent with the data volume actually received by the client.
[0152] In a possible implementation manner, in response to receiving the second data acquisition request sent by the client, modifying the record status of the first measurement record corresponding to the second confirmation signal value saved on the first server from the first status to the second status can be implemented in the following manner: in response to receiving the second data acquisition request sent by the client, send a confirmation ACK request to the second server, where the ACK request includes the second confirmation signal value, so that the second server modifies the record status of the second measurement record corresponding to the second confirmation signal value saved by it from the first status to the second status; wherein, the second server measures the data volume output by it to the first server based on the measurement record in the second status saved by it; in response to receiving the ACK notification sent by the second server, modify the record status of the first measurement record corresponding to the second confirmation signal value saved on the first server from the first status to the second status.
[0153] In this way, through the ACK confirmation process, when the second server receives the confirmation signal value sent by the first server, it then modifies the record status of the corresponding measurement record to the second status. In this way, based on the measurement records in the second status saved by the second server, the second server measures the amount of data output to the first server, enabling the amount of data measured by the second server to be consistent with the amount of data actually received by the first server.
[0154] In addition, through the ACK confirmation process, the first server can not only confirm that the client has successfully received the corresponding data, but also confirm that the second server has recorded the measurement record of the corresponding data. In this way, it can further make the amounts of data measured by the client, the first server, and the second server consistent.
[0155] In a possible implementation, to generate the first measurement record corresponding to the second confirmation signal value and set the record status of the first measurement record to the first status, the following method can be used: first determine whether the first server has a measurement record corresponding to the second confirmation signal value; in the case where the first server does not have a measurement record corresponding to the second confirmation signal value, generate the first measurement record corresponding to the second confirmation signal value and set the record status of the first measurement record to the first status. In the case where the first server has a measurement record corresponding to the second confirmation signal value, do not regenerate the first measurement record corresponding to the second confirmation signal value.
[0156] In this way, for the same data acquisition request initiated by the client, the first server will not repeatedly measure the corresponding amount of data. For example, in the previous data acquisition request process, if the data transmission link is interrupted, resulting in the client not successfully receiving the data, after the client reinitiates a retry request, the first server will not repeatedly measure the amount of data requested by this retry request.
[0157] In a possible implementation, in the case where the second confirmation signal value is the same as the first confirmation signal value, and the first data volume and the second data volume are different, receive a data volume modification notice sent by the second server; the data volume modification notice is used to notify that the second data volume is modified to the first data volume; send a data volume modification notice to the client.
[0158] Among them, in the case where the second confirmation signal value is the same as the first confirmation signal value, it means that the second data acquisition request is a retry request. In this way, in the case where the second data acquisition request is a retry request and the first data volume and the second data volume are different, notifying the client to modify the second data volume to the first data volume can make the amount of data actually output by the second server in the retry request scenario consistent with the amount of data it records.
[0159] In a possible implementation, the method further includes: detecting whether the first server stores a measurement record that has been in the first state for longer than a preset duration; in the case where it is detected that the first server stores a measurement record that has been in the first state for longer than a preset duration, modifying the record state of the measurement record that has been in the first state for longer than a preset duration stored by the first server from the first state to the second state.
[0160] Exemplarily, in the case where it is detected that the first server stores a measurement record that has been in the first state for longer than a preset duration, the record state of the measurement record that has been in the first state for longer than a preset duration stored by the first server can be modified from the first state to the second state through an ACK confirmation process.
[0161] In this way, through the above detection mechanism and ACK confirmation process, the first server and the second server can measure the data volume of the last output for the target data.
[0162] In a possible implementation, in the case where the first data acquisition request is not the first data acquisition request for the target data, before sending the target data of the first data volume to the client, the method further includes the following steps: modifying the record state of the third measurement record corresponding to the first confirmation signal value stored by the first server from the first state to the second state.
[0163] In the case where the first data acquisition request is the first data acquisition request for the target data, the first server does not store a measurement record corresponding to the first confirmation signal value. In the case where the first data acquisition request is not the first data acquisition request for the target data, the first server stores a measurement record corresponding to the first confirmation signal value, and its record state is the first state. In this way, after the first server receives the first confirmation signal value, the record state of the third measurement record corresponding to the first confirmation signal value can be modified from the first state to the second state.
[0164] In a possible implementation, before sending the first data acquisition request to the second server in response to receiving the first data acquisition request sent by the client, the method may further include the following steps: receiving a task creation request sent by the client, where the task request includes acquisition rule information of the target data to be acquired; generating task identification information corresponding to the task creation request, and feeding back the task identification information to the server; sending a task creation notification to the second server, where the task creation notification includes the acquisition rule information and the task identification information, so that the second server generates the target data corresponding to the task identification information based on the acquisition rule information; the first data acquisition request and the second data acquisition request also include the task identification information, so that the second server determines the target data based on the task identification information.
[0165] In this way, before receiving a data acquisition request, the second server can be notified in advance to prepare the corresponding target data. In this way, subsequent data acquisition requests initiated by the client can be quickly responded to, and the corresponding number of target data can be fed back, improving the data service efficiency.
[0166] In a possible implementation, the client integrates at least one Software Development Kit (SDK) interface, and the second server integrates at least one Service Provider Interface (SPI); the first server interacts with the client through at least one SDK interface, and the first server interacts with the second server through at least one SPI interface.
[0167] In this way, by integrating the SDK provided by the first server, the client can quickly obtain the interface call ability compared with the traditional interface document docking method. In addition, the first server can define a standard interface SPI, enabling different second servers to implement their own logics according to the interface specifications, ensuring the unity of the system.
[0168] Among them, for the specific implementation processes of the above steps S302 to S312, reference can be made to the descriptions of the above steps S102 to S112 and steps S202 to S242, which will not be elaborated here.
[0169] See Figure 9 , one or more embodiments of this specification provide a flow schematic diagram of a method for measuring the data volume. This method is applied to the second server, as Figure 9 shown, this method may include the following steps:
[0170] Step S402, in response to receiving a first data acquisition request sent by the first server, generate a second confirmation signal value and a fourth measurement record; the first data acquisition request is used to request the acquisition of target data of a first data volume, and the first data acquisition request includes a first confirmation signal value.
[0171] Step S404, send the target data of the first data volume and the second confirmation signal value to the first server.
[0172] Step S406, in response to receiving a second data acquisition request sent by the first server, modify the record status of the fourth measurement record saved in the second server from a first status to a second status; the second data acquisition request is used to request the acquisition of target data of a second data volume, and the second data acquisition request includes a second confirmation signal value.
[0173] Step S408, based on the measurement record saved in the second server and in the second status, measure the data volume output by it to the first server.
[0174] In this way, based on the ACK mechanism and the modification mechanism of the record status of the measurement record, each time the second server feeds back data to the first server, it carries a confirmation signal value for the first server to carry this confirmation signal value when making the next data acquisition request. After that, when the second server receives the first server sending this confirmation signal value, it then modifies the record status of the corresponding measurement record to the second status. In this way, based on the measurement records in the second status saved by the second server, the second server measures the data volume output to the first client, enabling the data volume measured by the second server to be consistent with the data volume actually received by the first server.
[0175] In a possible implementation, in response to receiving a second data acquisition request sent by the first server, modifying the record status of the fourth measurement record saved by the second server from the first status to the second status can be achieved in the following way: in response to receiving an ACK request sent by the first server, modifying the record status of the fourth measurement record saved by the second server from the first status to the second status; the ACK request includes a first confirmation signal value; sending an ACK notification to the first server to notify the first server to modify the record status of the first measurement record corresponding to the second confirmation signal value saved by the first server from the first status to the second status.
[0176] In this way, through the ACK confirmation process, when the second server receives the confirmation signal value sent by the first server, it then modifies the record status of the corresponding measurement record to the second status. In this way, based on the measurement records in the second status saved by the second server, the second server measures the data volume output to the first server, enabling the data volume measured by the second server to be consistent with the data volume actually received by the first server.
[0177] In addition, through the ACK confirmation process, the first server can not only confirm that the client has successfully received the corresponding data, but also confirm that the second server has recorded the measurement record of the corresponding data. In this way, it can further make the data volumes measured by the client, the first server, and the second server consistent.
[0178] In a possible implementation, in response to receiving a first data acquisition request sent by a first server, a second confirmation signal value and a fourth measurement record may be generated in the following manner: in response to receiving the first data acquisition request sent by the first server, determine whether the first confirmation signal value carried in the first data acquisition request is the same as the third confirmation signal value; wherein, the third confirmation signal value is the confirmation signal value generated by the second server for the previous data acquisition request; in the case where it is determined that the first confirmation signal value is the same as the third confirmation signal value, generate a second confirmation signal value and a fourth measurement record. In the case where it is determined that the first confirmation signal value is different from the third confirmation signal value, the second server does not regenerate the fourth measurement record corresponding to the second confirmation signal value.
[0179] Wherein, the same first confirmation signal value and third confirmation signal value indicate that the second data acquisition request is not a retry request. Different first confirmation signal value and third confirmation signal value indicate that the second data acquisition request is a retry request.
[0180] In this way, for the same data acquisition request initiated by the first server, the second server does not repeatedly measure the corresponding data volume. For example, in the case where the data transmission link is interrupted during the previous data acquisition request, resulting in the first server or the client not successfully receiving the data, after the first server reinitiates a retry request, the second server does not repeatedly measure the data volume requested by the retry request.
[0181] In a possible implementation, in the case where it is determined that the first confirmation signal value is the same as the second confirmation signal value and the first data volume is different from the second data volume, a data volume modification notification is sent to the first server; the data volume modification notification is used to notify that the second data volume is modified to the first data volume.
[0182] Wherein, in the case where the second confirmation signal value is the same as the first confirmation signal value, it indicates that the second data acquisition request is a retry request. In this way, in the case where the second data acquisition request is a retry request and the first data volume is different from the second data volume, notifying the first server to modify the second data volume to the first data volume can make the actual output data volume of the second server in the retry request scenario consistent with the data volume it records.
[0183] Wherein, for the specific implementation processes of the above steps S402 to S408, reference may be made to the descriptions of the above steps S102 to S112 and steps S202 to S242, which will not be elaborated here.
[0184] The flow diagram of a method for measuring data volume provided by one or more embodiments of this specification. This method is applied to the client, and the method may include the following steps: First, send a first data acquisition request to the first server; the first data acquisition request is used to request the acquisition of target data of the first data volume, and the first data acquisition request includes a first confirmation signal value; wherein, the first confirmation signal value is the confirmation signal value received from the first server after the previous data acquisition request; in the case where the first data acquisition request is the first data acquisition request for the target data, the first confirmation signal value is a null value. Then, receive the target data of the first data volume and the second confirmation signal value sent by the first server; wherein, the second confirmation signal value is used to be carried when the client sends the next data acquisition request, so that the first server modifies the record status of the measurement record corresponding to the second confirmation signal value to the second status based on the second confirmation signal value, and measures the data volume output by the first server to the client based on the measurement records in the second status saved by it.
[0185] In this way, by specifying the data volume to be acquired in the data acquisition request, the first server can, in response to the data volume requested by the client, feed back the target data to the client in batches. In this way, the client can acquire data corresponding to the data volume based on its own actual needs, so as to be able to more accurately control the cost consumed by the data service.
[0186] In addition, each time the client sends a data acquisition request, it carries the confirmation signal value received last time, so that the first server modifies the record status of the corresponding measurement record to the second status based on the ACK mechanism and the modification mechanism of the record status of the measurement record. In this way, the first server measures the data volume output by the first server to the client based on the measurement records in the second status saved by it, which can make the data volume measured by the first server consistent with the data volume actually received by the client.
[0187] Among them, for the specific implementation process of the above steps, reference can be made to the descriptions of the above steps S102 to S112 and steps S202 to S242, which will not be elaborated here.
[0188] It can be understood that the above embodiments are only examples, and deformations can be made to the above embodiments during actual implementation. Those skilled in the art can understand that the deformation methods that do not require creative labor for the above embodiments all fall within the protection scope of one or more embodiments of this specification, and will not be elaborated in the embodiments.
[0189] Based on the same inventive concept, one or more embodiments of this specification also provide a data volume measurement device. Since the principle of the problem solved by the data volume measurement device is similar to that of the foregoing data volume measurement method, the implementation of the data volume measurement device can refer to the implementation of the foregoing data volume measurement method, and the repeated parts will not be elaborated.
[0190] See Figure 10 , Figure 10 which is a structural block diagram of a data volume measurement device provided for one or more embodiments of this specification. As Figure 10 shown, the device 500 can be applied to the first server, and the device 500 can include:
[0191] A first sending module 501, configured to send a first data acquisition request to a second server in response to receiving a first data acquisition request sent by a client; the first data acquisition request is used to request to acquire target data of a first data volume, and the first data acquisition request includes a first confirmation signal value;
[0192] A first receiving module 502, which can be used to receive the target data of the first data volume and a second confirmation signal value sent by the second server;
[0193] A first generating module 503, which can be used to generate a first measurement record corresponding to the second confirmation signal value and set the record status of the first measurement record to a first status;
[0194] A second sending module 504, which can be used to send the target data of the first data volume and the second confirmation signal value to the client;
[0195] A first modifying module 505, which can be used to modify the record status of the first measurement record corresponding to the second confirmation signal value saved in the first server from the first status to a second status in response to receiving a second data acquisition request sent by the client; the second data acquisition request is used to request to acquire target data of a second data volume, and the second data acquisition request includes a second confirmation signal value;
[0196] A first measurement module 506, which can be used to measure the data volume output from the first server to the client based on the measurement records saved in the first server and in the second status.
[0197] In a possible implementation, the first modifying module 505 can specifically be used to send an ACK request including the second confirmation signal value to the second server in response to receiving the second data acquisition request sent by the client, so that the second server modifies the record status of the second measurement record corresponding to the second confirmation signal value saved by it from the first status to the second status; wherein, the second server measures the data volume output from it to the first server based on the measurement records saved in it and in the second status; in response to receiving the ACK notification sent by the second server, modify the record status of the first measurement record corresponding to the second confirmation signal value saved in the first server from the first status to the second status.
[0198] In a possible implementation manner, the first generation module 503 may specifically be configured to determine whether the first server stores a measurement record corresponding to the second confirmation signal value; in a case where the first server does not store a measurement record corresponding to the second confirmation signal value, generate a first measurement record corresponding to the second confirmation signal value, and set the record status of the first measurement record to the first status.
[0199] In a possible implementation manner, it may further include: a notification module, configured to receive a data volume modification notification sent by the second server in a case where the second confirmation signal value is the same as the first confirmation signal value and the first data volume is different from the second data volume; the data volume modification notification is used to notify that the second data volume is modified to the first data volume; and send the data volume modification notification to the client.
[0200] In a possible implementation manner, it may further include: a detection module, configured to detect whether the first server stores a measurement record in the first status for a period exceeding a preset duration; in a case where it is detected that the first server stores a measurement record in the first status for a period exceeding the preset duration, modify the record status of the measurement record stored by the first server in the first status for a period exceeding the preset duration from the first status to the second status.
[0201] In a possible implementation manner, it may further include: a task creation module, configured to receive a task creation request sent by the client, where the task request includes acquisition rule information of target data to be acquired; generate task identification information corresponding to the task creation request, and feedback the task identification information to the server; send a task creation notification to the second server, where the task creation notification includes the acquisition rule information and the task identification information, so that the second server generates target data corresponding to the task identification information based on the acquisition rule information; the first data acquisition request and the second data acquisition request further include the task identification information, so that the second server determines the target data based on the task identification information.
[0202] In a possible implementation manner, the client integrates at least one software development kit (SDK) interface, and the second server integrates at least one service provider interface (SPI); the first server interacts with the client through at least one SDK interface, and the first server interacts with the second server through at least one SPI interface.
[0203] See Figure 11 , Figure 1 is a structural block diagram of a data volume measurement device provided for one or more embodiments of this specification. As Figure 11 shown, the device 600 may be applied to the second server, and the device 600 may include:
[0204] The second generation module 601 is configured to generate a second confirmation signal value and a fourth measurement record in response to receiving a first data acquisition request sent by the first server; the first data acquisition request is used to request the acquisition of target data of a first data volume, and the first data acquisition request includes a first confirmation signal value;
[0205] The third sending module 602 is configured to send the target data of the first data volume and the second confirmation signal value to the first server;
[0206] The second modification module 603 is configured to modify the record status of the fourth measurement record saved by the second server from a first status to a second status in response to receiving a second data acquisition request sent by the first server; the second data acquisition request is used to request the acquisition of target data of a second data volume, and the second data acquisition request includes a second confirmation signal value;
[0207] The second measurement module 604 is configured to measure the data volume output to the first server based on the measurement record in the second status saved by the second server.
[0208] In a possible implementation, the second modification module 603 may specifically be configured to modify the record status of the fourth measurement record saved by the second server from a first status to a second status in response to receiving an ACK request sent by the first server; the ACK request includes a first confirmation signal value; and send an ACK notification to the first server to notify the first server to modify the record status of the first measurement record corresponding to the second confirmation signal value saved by the first server from a first status to a second status.
[0209] In a possible implementation, the second generation module 601 may specifically be configured to determine whether the first confirmation signal value carried in the first data acquisition request is the same as the third confirmation signal value in response to receiving the first data acquisition request sent by the first server; wherein, the third confirmation signal value is the confirmation signal value generated by the second server for the previous data acquisition request; and generate a second confirmation signal value and a fourth measurement record when it is determined that the first confirmation signal value is the same as the third confirmation signal value.
[0210] In a possible implementation, it may further include: a notification module, configured to send a data volume modification notification to the first server when it is determined that the first confirmation signal value is the same as the second confirmation signal value and the first data volume is different from the second data volume; the data volume modification notification is used to notify to modify the second data volume to the first data volume.
[0211] See Figure 12 , Figure 12 which is the structural block diagram of a data volume measurement device provided by one or more embodiments of this specification. As Figure 12As shown, the device 700 can be applied to a client, and the device 700 may include:
[0212] A fourth sending module 701, configured to send a first data acquisition request to a first server; the first data acquisition request is used to request to acquire target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; wherein, the first confirmation signal value is the confirmation signal value received from the first server after the previous data acquisition request; in the case where the first data acquisition request is the first data acquisition request for the target data, the first confirmation signal value is a null value;
[0213] A second receiving module 702, configured to receive the target data of the first data volume and a second confirmation signal value sent by the first server; wherein, the second confirmation signal value is used to be carried when the client sends a data acquisition request next time, so that the first server modifies the record status of the measurement record corresponding to the second confirmation signal value to a second status based on the second confirmation signal value, and measures the data volume output by the first server to the client based on the measurement record in the second status saved by it.
[0214] See Figure 13 , Figure 13 is a structural block diagram of an electronic device provided by one or more embodiments of this specification. As Figure 13 shown, the electronic device 800 may include a processor 801 and a memory 802; the memory 802 may be coupled to the processor 801. It should be noted that this Figure 13 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0215] In a possible implementation, the function of the data volume measurement device may be integrated into the processor 801. Among them, the processor 801 may be configured to perform operations for measuring the data volume.
[0216] In another possible implementation, the data volume measurement device may be separately configured from the processor 801. For example, the data volume measurement device may be configured as a chip connected to the processor 801, and the measurement of the data volume is realized through the control of the processor 801.
[0217] In addition, in some alternative implementations, the electronic device 800 may further include: a communication module, an input unit, an audio processor, a display, a power supply, etc. It should be noted that the electronic device 800 does not necessarily have to include Figure 13 all the components shown in Figure 13 ; in addition, the electronic device 800 may further include
[0218] In some alternative implementations, the processor 801, sometimes also referred to as a controller or operation control, may include a microprocessor or other processor devices and / or logic devices. The processor 801 receives inputs and controls the operations of the various components of the electronic device 800.
[0219] Among them, the memory 802 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices. It can store the information related to the data volume measurement device mentioned above. In addition, it can also store programs for executing relevant information. And the processor 801 can execute the programs stored in the memory 802 to achieve information storage or processing, etc.
[0220] The input unit can provide inputs to the processor 801. The input unit is, for example, a key or a touch input device. The power supply can be used to supply power to the electronic device 800. The display can be used to display display objects such as images and texts. The display can be, for example, an LCD display, but is not limited thereto.
[0221] The memory 802 can be a solid-state memory. For example, a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It can also be a memory that stores information even when powered off, can be selectively erased, and has more data. An example of this memory is sometimes referred to as an EPROM, etc. The memory 802 can also be some other type of device. The memory 802 includes a buffer memory (sometimes referred to as a buffer). The memory 802 can include an application / function storage section, which is used to store application programs and function programs or the processes for operating the electronic device 800 through the processor 801.
[0222] The memory 802 can also include a data storage section, which is used to store data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage section of the memory 802 can include various drivers of the computer device for communication functions and / or for performing other functions of the computer device (such as a messaging application, an address book application, etc.).
[0223] The communication module is a transmitter / receiver that transmits and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor 801 to provide input signals and receive output signals, which can be the same as in the case of a conventional mobile communication terminal.
[0224] Based on different communication technologies, in the same computer device, multiple communication modules can be provided, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to the speaker and the microphone via the audio processor to provide an audio output via the speaker and receive an audio input from the microphone, so as to implement the usual telecommunication functions. The audio processor can include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor is also coupled to the processor 801, so that it is possible to record on the local machine through the microphone and play the sound stored on the local machine through the speaker.
[0225] One or more embodiments of this specification also provide a computer-readable storage medium capable of implementing all the steps in the data volume measurement method in the above embodiments. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps of the data volume measurement method in the above embodiments are implemented.
[0226] Although one or more embodiments of this specification provide method operation steps such as in the embodiments or flowcharts, based on routine or non-creative labor, there can be more or fewer operation steps. The order of the steps listed in the embodiments is only one way among the execution orders of numerous steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in the order shown in the embodiments or the drawings or in parallel (for example, in an environment of parallel processors or multi-threaded processing).
[0227] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a device (system), or a computer program product. Therefore, the embodiments of this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of this specification can take 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 code.
[0228] One or more embodiments of this specification are described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to one or more embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the processes and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementing in the process Figure 1One or more processes and / or blocks Figure 1 Apparatus for the functions specified in one or more blocks
[0229] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction apparatus that implements the functions in the process Figure 1 One or more processes and / or blocks Figure 1 The functions specified in one or more blocks
[0230] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus, such that a series of operational steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions in the process Figure 1 One or more processes and / or blocks Figure 1 The steps of the functions specified in one or more blocks
[0231] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the apparatus and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description of the method embodiments
[0232] In this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. For those of ordinary skill in the art, the specific meanings of the above terms in one or more embodiments of this specification can be understood according to specific circumstances
[0233] It should be noted that, without conflict, the features of one or more embodiments in this specification may be combined with each other. One or more embodiments of this specification are not limited to any single aspect, nor to any single embodiment, nor to any arbitrary combination and / or permutation of these aspects and / or embodiments. Moreover, each aspect and / or embodiment of one or more embodiments of this specification can be used alone or in combination with one or more other aspects and / or their embodiments.
[0234] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of one or more embodiments of this specification, and are not intended to limit them; although the above embodiments of this specification have been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of one or more embodiments of this specification, and they should all be covered by the scope of the claims and the specification of one or more embodiments of this specification.
[0235] The above has described one or more embodiments of this specification in combination with optional embodiments, but these embodiments are only exemplary and only serve an illustrative role. On this basis, various replacements and improvements can be made to one or more embodiments of this specification, and these all fall within the protection scope of one or more embodiments of this specification.
Claims
1. A method for measuring the amount of data, characterized in that The method is applied to a first server, and the method includes: In response to receiving a first data acquisition request sent by a client, sending the first data acquisition request to a second server; the first data acquisition request is used to request to acquire target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; Receiving the target data of the first data volume and a second confirmation signal value sent by the second server; Generating a first measurement record corresponding to the second confirmation signal value, and setting the record status of the first measurement record to a first status; Sending the target data of the first data volume and the second confirmation signal value to the client; In response to receiving a second data acquisition request sent by the client, modifying the record status of the first measurement record corresponding to the second confirmation signal value saved by the first server from the first status to a second status; the second data acquisition request is used to request to acquire target data of a second data volume, and the second data acquisition request includes a second confirmation signal value; Based on the measurement records in the second status saved by the first server, measuring the data volume output by the first server to the client.
2. The method according to claim 1, wherein The step of, in response to receiving the second data acquisition request sent by the client, modifying the record status of the first measurement record corresponding to the second confirmation signal value saved by the first server from the first status to a second status includes: In response to receiving the second data acquisition request sent by the client, sending an acknowledgement ACK request to the second server, the ACK request including the second confirmation signal value, so that the second server modifies the record status of the second measurement record corresponding to the second confirmation signal value saved by it from the first status to the second status; wherein, the second server measures the data volume output by it to the first server based on the measurement records in the second status saved by it; In response to receiving the ACK notification sent by the second server, modifying the record status of the first measurement record corresponding to the second confirmation signal value saved by the first server from the first status to the second status.
3. The method according to claim 1, wherein The step of generating a first measurement record corresponding to the second confirmation signal value and setting the record status of the first measurement record to the first status includes: Determining whether the first server saves a measurement record corresponding to the second confirmation signal value; In the case that the first server does not save a measurement record corresponding to the second confirmation signal value, generating a first measurement record corresponding to the second confirmation signal value, and setting the record status of the first measurement record to the first status.
4. The method according to claim 1, characterized in that, The method further includes: In the case that the second confirmation signal value is the same as the first confirmation signal value, and the first data volume is different from the second data volume, receiving a data volume modification notification sent by the second server; the data volume modification notification is used to notify that the second data volume is modified to the first data volume; Sending the data volume modification notification to the client.
5. The method according to claim 1, characterized in that The method further includes: Detecting whether the first server saves a measurement record in the first status for longer than a preset duration; When it is detected that the first server stores measurement records in the first state for a period exceeding a preset duration, change the record state of the measurement records stored by the first server and in the first state for a period exceeding the preset duration from the first state to the second state.
6. The method according to claim 1, characterized in that, When the first data acquisition request is not the first data acquisition request for the target data, before sending the target data of the first data volume to the client, the method further includes: Change the record state of the third measurement record corresponding to the first confirmation signal value stored by the first server from the first state to the second state.
7. The method according to claim 1, characterized in that, Before sending the first data acquisition request to the second server in response to receiving the first data acquisition request sent by the client, the method further includes: Receive a task creation request sent by the client, where the task request includes acquisition rule information of target data to be acquired; Generate task identification information corresponding to the task creation request, and feedback the task identification information to the server; Send a task creation notification to the second server, where the task creation notification includes the acquisition rule information and the task identification information, so that the second server generates target data corresponding to the task identification information based on the acquisition rule information; The first data acquisition request and the second data acquisition request further include the task identification information, so that the second server determines the target data based on the task identification information.
8. The method according to claim 1, characterized in that, The client integrates at least one software development kit (SDK) interface, and the second server integrates at least one service provider interface (SPI); The first server interacts with the client through the at least one SDK interface, and the first server interacts with the second server through the at least one SPI interface.
9. A method for measuring the amount of data, characterized in that, The method is applied to the second server, and the method includes: In response to receiving the first data acquisition request sent by the first server, generate a second confirmation signal value and a fourth measurement record; the first data acquisition request is used to request the acquisition of target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; Send the target data of the first data volume and the second confirmation signal value to the first server; In response to receiving the second data acquisition request sent by the first server, change the record state of the fourth measurement record stored by the second server from the first state to the second state; the second data acquisition request is used to request the acquisition of target data of a second data volume, and the second data acquisition request includes the second confirmation signal value; Based on the measurement records stored by the second server and in the second state, measure the data volume output by it to the first server.
10. The method according to claim 9, wherein The step of, in response to receiving the second data acquisition request sent by the first server, changing the record state of the fourth measurement record stored by the second server from the first state to the second state includes: In response to receiving the confirmation ACK request sent by the first server, change the record status of the fourth measurement record saved by the second server from the first status to the second status; the ACK request includes the first confirmation signal value; Send an ACK notification to the first server to notify the first server to change the record status of the first measurement record corresponding to the second confirmation signal value saved by the first server from the first status to the second status.
11. The method according to claim 9, characterized in that The generating the second confirmation signal value and the fourth measurement record in response to receiving the first data acquisition request sent by the first server includes: In response to receiving the first data acquisition request sent by the first server, determine whether the first confirmation signal value carried in the first data acquisition request is the same as the third confirmation signal value; wherein, the third confirmation signal value is the confirmation signal value generated by the second server for the previous data acquisition request; Generate a second confirmation signal value and a fourth measurement record when it is determined that the first confirmation signal value is the same as the third confirmation signal value.
12. The method according to claim 9, characterized in that, The method further includes: When it is determined that the first confirmation signal value is the same as the second confirmation signal value and the first data volume is different from the second data volume, send a data volume modification notification to the first server; the data volume modification notification is used to notify to modify the second data volume to the first data volume.
13. A method for measuring the amount of data, characterized in that, The method is applied to a client, and the method includes: Send a first data acquisition request to the first server; the first data acquisition request is used to request to acquire target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; wherein, the first confirmation signal value is the confirmation signal value received from the first server after the previous data acquisition request; when the first data acquisition request is the first data acquisition request for the target data, the first confirmation signal value is a null value; Receive the target data of the first data volume and the second confirmation signal value sent by the first server; wherein, the second confirmation signal value is used to be carried by the client when sending the next data acquisition request, so that the first server modifies the record status of the measurement record corresponding to the second confirmation signal value to the second status based on the second confirmation signal value, and measures the data volume output by the first server to the client based on the measurement record in the second status saved by it.
14. A device for measuring the amount of data, characterized in that, The device is applied to the first server, and the device includes: A first sending module, configured to send the first data acquisition request to the second server in response to receiving the first data acquisition request sent by the client; the first data acquisition request is used to request to acquire target data of a first data volume, and the first data acquisition request includes a first confirmation signal value; A first receiving module, configured to receive the target data of the first data volume and the second confirmation signal value sent by the second server; A first generating module, configured to generate a first measurement record corresponding to the second confirmation signal value and set the record status of the first measurement record to the first status; A second sending module, configured to send the target data of the first data volume and the second confirmation signal value to the client; A first modification module, configured to, in response to receiving a second data acquisition request sent by the client, modify the record status of the first measurement record corresponding to the second confirmation signal value saved by the first server from a first status to a second status; the second data acquisition request is used to request to acquire the target data of the second data volume, and the second data acquisition request includes a second confirmation signal value; A first measurement module, configured to measure the data volume output by the first server to the client based on the measurement record in the second status saved by the first server.
15. A measuring device for the amount of data, characterized in that, The apparatus is applied to a second server, and the apparatus includes: A second generation module, configured to, in response to receiving a first data acquisition request sent by the first server, generate a second confirmation signal value and a fourth measurement record; the first data acquisition request is used to request to acquire the target data of the first data volume, and the first data acquisition request includes a first confirmation signal value; A third sending module, configured to send the target data of the first data volume and the second confirmation signal value to the first server; A second modification module, configured to, in response to receiving a second data acquisition request sent by the first server, modify the record status of the fourth measurement record saved by the second server from a first status to a second status; the second data acquisition request is used to request to acquire the target data of the second data volume, and the second data acquisition request includes a second confirmation signal value; A second measurement module, configured to measure the data volume output by it to the first server based on the measurement record in the second status saved by the second server.
16. A measuring device for the amount of data, characterized in that, The apparatus is applied to a client, and the apparatus includes: A fourth sending module, configured to send a first data acquisition request to the first server; the first data acquisition request is used to request to acquire the target data of the first data volume, and the first data acquisition request includes a first confirmation signal value; wherein, the first confirmation signal value is the confirmation signal value received from the first server after the previous data acquisition request; in the case that the first data acquisition request is the first data acquisition request for the target data, the first confirmation signal value is a null value; A second receiving module, configured to receive the target data of the first data volume and the second confirmation signal value sent by the first server; wherein, the second confirmation signal value is used to be carried when the client sends a data acquisition request next time, so that the first server modifies the record status of the measurement record corresponding to the second confirmation signal value to the second status based on the second confirmation signal value, and measures the data volume output by the first server to the client based on the measurement record in the second status saved by it.
17. An electronic device, characterized in that, The electronic device includes: A memory, configured to store a computer program product; A processor, configured to execute the computer program product stored in the memory, and when the computer program product is executed, implement the method described in any one of claims 1-8, 9-12 or 13 above.
18. A computer-readable storage medium, characterized in that, Computer program instructions are stored on the computer-readable storage medium, and when the computer program instructions are executed, the method described in any one of claims 1-8, 9-12 or 13 above is implemented.