CN112153681A - Resource segmentation method and device, electronic equipment and storage medium - Google Patents

Resource segmentation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112153681A
CN112153681A CN202011003959.2A CN202011003959A CN112153681A CN 112153681 A CN112153681 A CN 112153681A CN 202011003959 A CN202011003959 A CN 202011003959A CN 112153681 A CN112153681 A CN 112153681A
Authority
CN
China
Prior art keywords
fragment
network
target resource
transmitted
data volume
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011003959.2A
Other languages
Chinese (zh)
Other versions
CN112153681B (en
Inventor
吴贯亮
张赛
董利明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011003959.2A priority Critical patent/CN112153681B/en
Publication of CN112153681A publication Critical patent/CN112153681A/en
Application granted granted Critical
Publication of CN112153681B publication Critical patent/CN112153681B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/06Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information

Abstract

The disclosure relates to a resource segmentation method, a resource segmentation device, an electronic device and a storage medium, wherein the method comprises the following steps: responding to a transmission instruction of the target resource, generating a first fragment of the target resource, wherein the data volume of the first fragment is matched with the network state when the target resource is transmitted, and the network state comprises the network type and/or the network speed; and sequentially generating the rest fragments of the target resource, wherein the data volume of the Nth fragment is obtained by calculating the data volume of the (N-1) th fragment and a dynamic growth factor, the value of the dynamic growth factor is positively correlated with the state value corresponding to the network quality state when the (N-1) th fragment is transmitted, and N is an integer greater than 1.

Description

Resource segmentation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of communications, and in particular, to a method and an apparatus for resource segmentation, an electronic device, and a storage medium.
Background
With the popularization of electronic devices and the development of communication technologies, the transmission of resources such as pictures, audio, video, etc. is becoming more and more popular in daily life and work. However, due to poor network environment, uneven distribution of server nodes, and the like, normal transmission of resources is often greatly hindered, and thus the transmission stability in the resource transmission process is concerned.
In the related art, resource data to be transmitted are generally fragmented according to a uniform size in advance, and then the fragmented resource data are transmitted one by one. However, the fragmentation mode with uniform size is often difficult to adapt to the actual network transmission environment, and the transmission success rate is low in poor network conditions, especially in weak network environments, so that it is difficult to realize stable resource transmission.
Disclosure of Invention
The disclosure provides a resource segmentation method, a resource segmentation device, electronic equipment and a storage medium, which are used for at least solving the technical problem of low transmission success rate of the related technology in a weak network environment. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for resource segmentation is provided, where the method includes:
responding to a transmission instruction of a target resource, generating a first fragment of the target resource, wherein the data volume of the first fragment is matched with the network state when the target resource is transmitted, and the network state comprises the network type and/or the network speed;
and sequentially generating the rest fragments of the target resource, wherein the data volume of the Nth fragment is obtained by calculating the data volume of the (N-1) th fragment and a dynamic growth factor, the value of the dynamic growth factor is positively correlated with the state value corresponding to the network quality state when the (N-1) th fragment is transmitted, and N is an integer greater than 1.
Optionally, the dynamic growth factor corresponding to the nth segment is also positively correlated with the growth rate, where the growth rate includes a rate pre-specified for a state value corresponding to a network quality state when the nth segment is transmitted.
Optionally, the state value corresponding to the network quality state when the nth-1 th fragment is transmitted is determined according to the average transmission rate when the nth-1 th fragment is transmitted.
Optionally, the method further includes:
determining the average transmission rate according to the ratio of the data volume of the (N-1) th fragment to the transmission time consumption during transmission of the (N-1) th fragment;
the average transmission rate is normalized, and the result of the normalization process is used to determine a state value corresponding to a network goodness state.
Optionally, the state value corresponding to the network quality state when the N-1 th fragment is transmitted is determined according to the average transmission rates corresponding to the first N-1 fragments.
Optionally, the method further includes:
calculating the weighted sum of the average transmission rates respectively corresponding to the first N-1 fragments according to the weighted values respectively corresponding to the first N-1 fragments; and the value of the weight value is positively correlated with the size of the sequence number of the corresponding fragment.
Optionally, the method further includes:
and when the dynamic growth factor is higher than a preset multiplying power threshold value, determining the data volume of the Nth fragment according to the data volume of the (N-1) th fragment and the preset multiplying power threshold value.
Optionally, the method further includes:
monitoring a network state when the relevant operation is executed when the operation relevant to the remaining fragment of the target resource is detected, wherein the operation relevant to the remaining fragment of the target resource comprises at least one of the following operations: generating the remaining fragments of the target resource, uploading the remaining fragments of the target resource, and receiving a message that the uploading of the remaining fragments of the target resource fails;
and when the monitored network state changes, generating the first fragment in the remaining fragments of the target resource according to the changed network state.
Optionally, the method further includes:
monitoring a calculation process and an uploading process of the first fragment of the target resource; and/or the presence of a gas in the gas,
a calculation process and an uploading process for identifying the remaining segments of the target resource;
and under the condition that the calculation process or the uploading process of any fragment is monitored to be wrong, the configuration parameters of the first fragment are correspondingly updated according to the reason of the mistake so as to adjust the calculation process or the uploading process of the next first fragment.
Optionally, the method further includes:
monitoring the uploading process of the first fragment and/or the rest fragments of the target resource;
and under the condition that uploading failure is monitored, correspondingly updating the configuration parameters corresponding to the first fragment according to the failure reason so as to adjust the calculation process and/or the uploading process of the next first fragment.
According to a second aspect of the embodiments of the present disclosure, a resource splitting apparatus is provided, where the apparatus includes:
a first fragment generation module configured to generate a first fragment of a target resource in response to a transmission instruction for the target resource, where a data volume of the first fragment matches a network state when the target resource is transmitted, where the network state includes a network type and/or a network speed;
and the residual fragment generating module is configured to sequentially generate the residual fragments of the target resource, wherein the data volume of the Nth fragment is obtained by calculating the data volume of the (N-1) th fragment and a dynamic growth factor, the value of the dynamic growth factor is positively correlated with the state value corresponding to the network quality state when the (N-1) th fragment is transmitted, and N is an integer greater than 1.
Optionally, the dynamic growth factor corresponding to the nth segment is also positively correlated with the growth rate, where the growth rate includes a rate pre-specified for a state value corresponding to a network quality state when the nth segment is transmitted.
Optionally, the state value corresponding to the network quality state when the nth-1 th fragment is transmitted is determined according to the average transmission rate when the nth-1 th fragment is transmitted.
Optionally, the method further includes:
the rate determining module is configured to determine the average transmission rate according to the ratio of the data volume of the (N-1) th fragment to the transmission time consumption when the (N-1) th fragment is transmitted;
and the normalization processing module is configured to perform normalization processing on the average transmission rate, and the normalization processing result is used for determining a state value corresponding to the network quality state.
Optionally, the state value corresponding to the network quality state when the N-1 th fragment is transmitted is determined according to the average transmission rates corresponding to the first N-1 fragments.
Optionally, the method further includes:
the rate weighting module is configured to calculate weighted sums of average transmission rates corresponding to the first N-1 fragments according to weight values corresponding to the first N-1 fragments respectively; and the value of the weight value is positively correlated with the size of the sequence number of the corresponding fragment.
Optionally, the method further includes:
and the data volume determining module is configured to determine the data volume of the nth slice according to the data volume of the (N-1) th slice and a preset multiplying power threshold when the dynamic growth factor is higher than the preset multiplying power threshold.
Optionally, the method further includes:
a state monitoring module configured to monitor a network state when the relevant operation is executed when detecting an operation related to the remaining fragment of the target resource, where the operation related to the remaining fragment of the target resource includes at least one of: generating the remaining fragments of the target resource, uploading the remaining fragments of the target resource, and receiving a message that the uploading of the remaining fragments of the target resource fails;
and the changed generation module is configured to generate the first fragment of the remaining fragments of the target resource according to the changed network state when the monitored network state changes.
Optionally, the method further includes:
the first fragment computing and monitoring module is configured to monitor the computing process and the uploading process of the first fragment of the target resource; and/or the presence of a gas in the gas,
the residual fragment computing and monitoring module is configured to identify the computing process and the uploading process of the residual fragments of the target resource;
and the first adjusting module is configured to correspondingly update the configuration parameters of the first fragment according to the error reason under the condition that the calculation process or the uploading process of any one fragment is monitored to be in error so as to adjust the calculation process or the uploading process of the next first fragment.
Optionally, the method further includes:
the uploading monitoring module is configured to monitor the uploading process of the first fragment and/or the rest fragments of the target resource;
and the second adjusting module is configured to, under the condition that the uploading failure is monitored, correspondingly update the configuration parameters corresponding to the first fragment according to the failure reason so as to adjust the calculation process and/or the uploading process of the next first fragment.
According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the resource partitioning method as described in any one of the embodiments of the first aspect.
According to a fourth aspect of the embodiments of the present disclosure, a storage medium is provided, where instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the resource partitioning method described in any one of the above first aspects.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product configured to execute the resource partitioning method of any of the embodiments.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the data volume of the next fragment to be transmitted is determined according to the network quality state when the previous fragment is transmitted, and then the fragmentation operation is performed on the remaining target resource according to the determined data volume of the next fragment, so that the problems that the fragment size is difficult to adapt to the actual network transmission environment, the resource transmission failure rate is high and the like caused by a fragmentation mode of unifying the data volume size are solved, and the transmission success rate and the stability of the target resource are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow chart diagram illustrating a resource partitioning method according to one of the exemplary embodiments of the present disclosure;
fig. 2 is a flowchart illustrating a resource partitioning method according to a second exemplary embodiment of the present disclosure;
FIG. 3 is a schematic block diagram of a resource partitioning apparatus shown in accordance with one of the exemplary embodiments of the present disclosure;
fig. 4 is a schematic block diagram illustrating an electronic device in accordance with an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a resource partitioning method according to an exemplary embodiment, where the method is applied to a data transmission device, and as shown in fig. 1, the method may include the following steps:
step 101, responding to a transmission instruction of a target resource, generating a first fragment of the target resource, wherein a data volume of the first fragment matches with a network state when the target resource is transmitted, and the network state includes a network type and/or a network speed.
In this embodiment, the transmission instruction for the target resource may be a sending operation, a sharing operation, an uploading operation, and the like performed on the target resource and detected by a preset application, and the transmission action for the target resource may include processes of sending the target resource to an electronic device logged in by a target account, uploading the target resource to a server, forwarding the target resource to a transfer device, and sending the target resource out by the transfer device.
In an embodiment, the data volume of the first segment used for segmenting the target resource may be determined according to a preset mapping relationship between the network state and the data volume of the first segment, and then the first segment of the target resource is generated according to the determined data volume of the first segment. Further, the preset mapping relationship between the network state and the data size of the first segment may be determined in advance through a large number of experiments, so as to determine the optimal data size of the first segment segmented under different network states. In practical applications, the network status may include the network type, the network speed, or both.
And 102, sequentially generating the remaining fragments of the target resource, wherein the data volume of the nth fragment is obtained by calculating the data volume of the (N-1) th fragment and a dynamic growth factor, the value of the dynamic growth factor is positively correlated with a state value corresponding to the network quality state when the (N-1) th fragment is transmitted, and N is a positive integer greater than 1.
In an embodiment, the dynamic growth factor corresponding to the nth segment is also positively correlated with a growth rate, where the growth rate includes a rate pre-specified for a state value corresponding to a network quality state when the nth segment is transmitted. At the moment, the preassigned multiplying power is used as the increasing multiplying power, so that the dynamic increasing factor is positively correlated with the preassigned multiplying power, the calculation accuracy of the data volume of the Nth fragment is ensured, and the data transmission stability is ensured in a new step.
In an embodiment, the state value corresponding to the network quality state when the (N-1) th fragment is transmitted may be determined according to the average transmission rate when the (N-1) th fragment is transmitted, thereby ensuring that the state value of the (N-1) th fragment is transmitted is closely related to the average transmission rate when the fragment is transmitted, and ensuring the stability of the fragment during the transmission of the (N-1) th fragment.
Further, the average transmission rate may be determined according to a ratio of the data volume of the (N-1) th segment to the transmission time consumption when the (N-1) th segment is transmitted, then the determined average transmission rate is normalized, and a normalization processing result is used to determine a state value corresponding to the network quality state. Through normalization processing, the average transmission rates of the fragments are conveniently compared transversely, so that the analysis of abnormal states of the fragments in the transmission process is facilitated, and fault diagnosis in the transmission process is facilitated.
In an embodiment, the state value corresponding to the network quality state when the N-1 th fragment is transmitted may be determined by the average transmission rate corresponding to each fragment in the first N-1 transmitted fragments. In this embodiment, the transmission condition of each of the first N-1 slices is integrated to determine the state value corresponding to the network quality state when the (N-1) th slice is transmitted, which helps to reduce the adverse effect of the transmission rate of the slice with abnormal transmission on calculating the state value corresponding to the network quality state.
Further, the weighted sum of the average transmission rates respectively corresponding to the first N-1 slices can be calculated according to the weighted values respectively corresponding to the first N-1 slices; wherein, the value of the weight value is positively correlated with the size of the sequence number of the corresponding fragment. In this embodiment, since the size of the sequence number of the segment represents the distance between the separation time and the time for determining the next remaining segment, the larger the sequence number of the segment is, the closer the separation time is to the time for determining the next remaining segment is, accordingly. Therefore, the weight values which correspond to the average transmission rate respectively corresponding to each fragment and are positively correlated with the sequence number of the fragment can be given, the transmission state of the fragment which is separated by the separation time from the current fragment is higher in similarity with the current state, and the weight values which are separated by the separation time from the current fragment can be given correspondingly to the distance between the separation time from the fragment and the current fragment so as to enhance the influence of the transmission rate of the fragment which is separated by the separation time from the current fragment, weaken the influence of the transmission rate of the fragment which is separated by the distance from the current fragment, and improve the accuracy of determining the average transmission rate.
In an embodiment, the determined dynamic growth factor may be evaluated according to a preset magnification threshold, so as to avoid that the determined dynamic growth factor is too large to cause file transmission failure. For example, the data amount of the nth slice may be determined according to the data amount of the N-1 th slice and a preset magnification threshold in the case that it is detected that the dynamic growth factor is higher than the preset magnification threshold.
In an embodiment, an operation related to the remaining fragment of the target resource may be detected, and a network status when the related operation is performed may be monitored, where the related operation related to the remaining fragment of the target resource may include at least one of: generating the remaining fragments of the target resource, uploading the remaining fragments of the target resource, receiving a message that the uploading of the remaining fragments of the target resource fails, and the like. Further, when the monitored network state changes, the first segment in the remaining segments of the target resource can be generated according to the changed network state, so that the first segment in the remaining segments of the target resource can be readjusted according to the current network state condition, and the uploading efficiency of the remaining segments of the target resource is improved.
In an embodiment, a calculation process and an upload process of a first fragment of the target resource may also be monitored, and/or a calculation process and an upload process of a remaining fragment of the target resource may be identified; and then, under the condition that the error is monitored in the calculation process or the uploading process of any fragment, the configuration parameters of the first fragment can be correspondingly updated according to the error reason so as to adjust the calculation process or the uploading process of the next first fragment. By the mode, errors in subsequent fragment transmission can be effectively avoided, and automatic elimination of transmission faults is realized, so that the stability of data transmission is improved.
In an embodiment, the uploading process of the first fragment and/or the remaining fragments of the target resource may also be monitored; and then, under the condition that uploading failure is monitored, correspondingly updating the configuration parameters corresponding to the first fragment according to the failure reason so as to adjust the calculation process and/or the uploading process of the next first fragment. Similarly, the mode can also avoid errors in subsequent fragment transmission, and realize automatic elimination of transmission faults, thereby being beneficial to improving the stability of data transmission.
By the embodiment, the data volume of the next fragment to be transmitted is determined according to the network quality state when the previous fragment is transmitted, and then the fragmentation operation is performed on the remaining target resource according to the determined data volume of the next fragment, so that the problems that the fragment size is difficult to adapt to the actual network transmission environment, the resource transmission failure rate is high and the like caused by the fragmentation mode of unifying the data volume size are solved, and the transmission success rate and the stability of the target resource are improved.
Fig. 2 is a flowchart illustrating a resource partitioning method applied to a data transmission device according to a second exemplary embodiment of the present disclosure. As shown in fig. 2, the following steps may be included:
step 201, in response to the transmission instruction to the target resource, acquiring the current network state.
In response to the transmission instruction of the target resource, the network state detection interface can be called by the started network inspection thread by starting the network inspection thread, so as to acquire the current network state information. In practical applications, the obtained network status information may include a network type, a network speed, or a network type and a network speed, and of course, other attribute information, such as Round-Trip Time (RTT) when transmitting resources, may also be included in the network status information, and as an example, the network type may be at least one of the following: 2G, 3G, 4G, 5G, WIFI, etc., the present disclosure does not limit the specific form of the network type.
Step 202, determining the growth rate and the data volume of the first segment corresponding to the acquired network state.
The growth rate corresponding to the acquired network state and the data volume of the first segment may be determined according to a preconfigured mapping relationship corresponding to the network state, and the preconfigured mapping relationship may include a correspondence relationship between the network state and at least one of the growth rate and the data volume of the first segment, such as a correspondence relationship between the network type and the growth rate; the corresponding relation between the network speed and the data volume of the first fragment; the corresponding relation between the network type and the growth rate; the corresponding relation between the network type and the data volume of the first fragment; the corresponding relation among the network type, the network speed and the growth multiplying power; the network type, the network speed, and the data size of the first segment may also be a combination of multiple sets of correspondences, which is not limited in this disclosure.
Step 203, performing fragmentation operation on the target resource according to the determined data volume of the first fragment, and further transmitting the first fragment with the obtained data size corresponding to the data volume of the first fragment.
Step 204, after the determined first segment is transmitted, determining the transmission time consumption when the first segment is transmitted.
Step 205, determining a dynamic growth factor corresponding to the transmission of the nth fragment according to the product of the state value corresponding to the network quality state when the nth-1 fragment is transmitted and the determined growth multiplying factor.
The state value corresponding to the network quality state when the (N-1) th fragment is transmitted can be determined in various ways, wherein N is a positive integer greater than 1:
in one embodiment, the state value corresponding to the network goodness state when the (N-1) th fragment is transmitted can be determined by the average transmission rate when the (N-1) th fragment is transmitted. For example, the data volume of the (N-1) th fragment and the transmission time consumption when the (N-1) th fragment is transmitted can be obtained, and the average transmission rate when the (N-1) th fragment is transmitted is determined according to the ratio of the data volume of the (N-1) th fragment to the transmission time consumption when the (N-1) th fragment is transmitted; and further, rounding the ratio of the average transmission rate when the (N-1) th fragment is transmitted to the average transmission rate when the (N-2) th fragment is transmitted, and determining a dynamic growth factor corresponding to the transmission of the (N) th fragment according to the product of the rounded result and a predetermined growth multiplying factor, wherein the (N-1) th fragment and the (N-2) th fragment are both used for representing the first fragment under the condition that the value of N is 2.
Further, after the average transmission rate is determined according to the ratio of the data volume of the (N-1) th fragment to the transmission time consumption when the (N-1) th fragment is transmitted, normalization processing may be performed on the determined average transmission rate, and the normalization processing result is used to determine a state value corresponding to the network good and bad state.
The reference data for normalization may be different according to different practical application requirements, as an example: and determining the ratio of the data volume of the first fragment to the transmission time consumption during transmission of the first fragment, further taking the quotient of the ratio and the data volume of the first fragment as reference data, determining the ratio of the average transmission rate during transmission of the (N-1) th fragment to the data volume of the (N-1) th fragment, and taking the ratio of the quotient of the ratio and the data volume of the (N-1) th fragment to the reference data as a result after normalization processing.
Such as the average transmission rate speed (N-1) when the (N-1) th slice is transmitted, may be determined by the ratio of the data size (N-1) of the (N-1) th slice to the transmission time cost (N-1) when the (N-1) th slice is transmitted, i.e.:
speed(N-1)=size(N-1)/cost(N-1);
the normalized processing result normal _ slope (N-1) for the N-1 th slice may be determined by a ratio of the average transmission rate speed (N-1) when the N-1 th slice is transmitted to the data size (N-1) of the N-1 th slice, and a ratio between the determined reference data and the reference data, wherein the reference data is determined by a ratio of the data size (0) of the first slice to the transmission time cost (0) when the first slice is transmitted, and further a quotient of the ratio size (0)/cost (0) and the data size (0) of the first slice, that is:
normalize_slope(N-1)=(speed(0)/size(0))/(speed(0)/size(0))。
in another embodiment, the state value corresponding to the network quality state when the N-1 th slice is transmitted may be determined by the average transmission rate corresponding to each slice in the first N-1 slices transmitted.
Specifically, the average transmission rate speed (N-1) when the (N-1) th slice is transmitted may be determined according to a ratio of the data amount speed (N-1) of the (N-1) th slice to the transmission time cost (N-1) when the (N-1) th slice is transmitted.
And determining the weight values respectively corresponding to the first N-1 fragments according to the values positively correlated with the sequence numbers of the corresponding fragments, and further calculating the weighted sum of the average transmission rates respectively corresponding to the first N-1 fragments.
With N>For example, 3, according to the sequence numbers of the 1 st shard, the 2 nd shard, … …, and the N-1 st shard, an N-1 weight value, such as α1、α2、……、αN-1Wherein α is1<α2<…<αN-1Then, the state value status (N-1) corresponding to the network quality state when the (N-1) th fragment is transmitted can be obtained by the following formula: status (N-1) ═ alpha1*speed(1)+α2*speed(2)+…+αN-1*speed(N-1)。
Step 206, determining whether the determined dynamic growth factor is higher than a preset multiplying factor threshold, if so, entering step 207a, otherwise, entering step 207 b.
Step 207a, determining the data volume of the nth slice according to the product of the data volume of the (N-1) th slice and a preset multiplying factor threshold.
Step 207b, determining the data volume of the nth slice according to the product of the data volume of the nth-1 th slice and the determined dynamic growth factor.
And 208, performing fragmentation operation on the remaining target resource according to the determined data volume of the nth fragment, and transmitting the obtained sub-fragments with the size corresponding to the data volume of the nth fragment.
Step 209, determining whether the transmission of the target resource is completed, if not, assigning N +1 to N, and returning to step 205.
In one embodiment, the corresponding configuration parameters may be adjusted by listening for a calculation or upload failure. As an exemplary embodiment, the calculation process and the uploading process of the first segment of the target resource may be monitored, and/or the calculation process and the uploading process of the remaining segments of the target resource may be identified; and then, under the condition that the error is monitored in the calculation process or the uploading process of any fragment, the configuration parameters of the first fragment can be correspondingly updated according to the error reason so as to adjust the calculation process or the uploading process of the next first fragment. As another exemplary embodiment, an upload process of a first segment and/or remaining segments of a target resource may be monitored; and then, under the condition that uploading failure is monitored, correspondingly updating the configuration parameters corresponding to the first fragment according to the failure reason so as to adjust the calculation process and/or the uploading process of the next first fragment. Similarly, the mode can also avoid errors in subsequent fragment transmission, and realize automatic elimination of transmission faults, thereby being beneficial to improving the stability of data transmission. Through the monitoring and adjusting process, errors in subsequent fragment transmission can be effectively avoided, and automatic elimination of transmission faults is realized, so that the stability of data transmission is improved.
It can be seen from the foregoing embodiments that, in the process of transmitting a target resource, the data volume of a first fragment to be transmitted is determined according to a current network state, and the data volume of a sub-fragment to be determined before a fragmentation operation is performed is determined according to a network quality state when a previous fragment is transmitted, so that the data volume of each fragment to be transmitted in sequence can be dynamically adjusted according to a real-time network quality state, and adaptive adjustment of the fragment size in the resource transmission process is implemented, thereby avoiding the problems of difficulty in adapting the fragment size to an actual network transmission environment, high resource transmission failure rate, and the like caused by a fragmentation mode of unifying the data volume size, and improving the success rate and stability of transmission of the target resource.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently.
Further, those skilled in the art will appreciate that the embodiments described in the specification are all alternative embodiments.
Corresponding to the embodiment of the resource segmentation method, the present disclosure also provides an embodiment of a resource segmentation apparatus.
Fig. 3 is a schematic block diagram of a resource partitioning apparatus according to one of the exemplary embodiments shown in the present disclosure. The resource segmentation device shown in this embodiment may be applicable to data transmission applications, and the data transmission device corresponding to the applications may be a terminal or a server, where the terminal includes, but is not limited to, a mobile phone, a tablet computer, a wearable device, an electronic device such as a personal computer, and the like; the server includes, but is not limited to, a physical server of an independent host, a virtual server carried by a host cluster, a cloud server, and the like. The data transmission application in the data transmission equipment is pre-installed on the electronic equipment, so that the client can be started and run on the electronic equipment; of course, when an online "client" such as HTML5 technology is employed, the client can be obtained and run without installing a corresponding application on the electronic device.
As shown in fig. 3, the resource partitioning apparatus may include:
a first fragment generating module 301, configured to generate, in response to a transmission instruction for a target resource, a first fragment of the target resource, where a data volume of the first fragment matches a network status when the target resource is transmitted, where the network status includes a network type and/or a network speed;
the remaining segment generating module 302 is configured to sequentially generate remaining segments of the target resource, where a data volume of an nth segment is calculated from a data volume of an N-1 th segment and a dynamic growth factor, a value of the dynamic growth factor is positively correlated with a state value corresponding to a network quality state when the N-1 th segment is transmitted, and N is an integer greater than 1.
Optionally, the dynamic growth factor corresponding to the nth segment is also positively correlated with the growth rate, where the growth rate includes a rate pre-specified for a state value corresponding to a network quality state when the nth segment is transmitted.
Optionally, the state value corresponding to the network quality state when the nth-1 th fragment is transmitted is determined according to the average transmission rate when the nth-1 th fragment is transmitted.
Optionally, the method further includes:
a rate determining module 303, configured to determine the average transmission rate according to a ratio of a data amount of an N-1 th slice to a transmission time consumption when the N-1 th slice is transmitted;
a normalization processing module 304 configured to normalize the average transmission rate, and the normalization processing result is used to determine a state value corresponding to the network quality state.
Optionally, the state value corresponding to the network quality state when the N-1 th fragment is transmitted is determined according to the average transmission rates corresponding to the first N-1 fragments.
Optionally, the method further includes:
a rate weighting module 305, configured to calculate a weighted sum of average transmission rates corresponding to the first N-1 slices according to weight values corresponding to the first N-1 slices, respectively; and the value of the weight value is positively correlated with the size of the sequence number of the corresponding fragment.
Optionally, the method further includes:
a data amount determining module 306, configured to determine the data amount of the nth slice according to the data amount of the N-1 th slice and a preset magnification threshold when the dynamic growth factor is higher than the preset magnification threshold.
Optionally, the method further includes:
a status monitoring module 307 configured to monitor a network status when the relevant operation is performed when detecting an operation related to the remaining fragment of the target resource, where the operation related to the remaining fragment of the target resource includes at least one of: generating the remaining fragments of the target resource, uploading the remaining fragments of the target resource, and receiving a message that the uploading of the remaining fragments of the target resource fails;
and the changed generation module 308 is configured to generate a first segment of the remaining segments of the target resource according to the changed network state when the monitored network state changes.
Optionally, the method further includes:
a first slice calculation monitoring module 309 configured to monitor a calculation process and an upload process of a first slice of the target resource; and/or the presence of a gas in the gas,
a residual computing and monitoring module 310 configured to identify a computing process and an uploading process of the residual shards of the target resource;
the first adjusting module 311 is configured to, when the computing process or the uploading process of any one fragment is monitored to be faulty, correspondingly update the configuration parameter of the first fragment according to a cause of the fault, so as to adjust the computing process or the uploading process of the next first fragment.
Optionally, the method further includes:
an upload monitor module 312 configured to monitor an upload process of the first segment and/or the remaining segments of the target resource;
the second adjusting module 313 is configured to, when it is monitored that the uploading fails, correspondingly update the configuration parameters corresponding to the first segment according to the failure reason, so as to adjust the calculation process and/or the uploading process of the next first segment.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
An embodiment of the present disclosure also provides an electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the resource partitioning method according to any of the above embodiments.
Embodiments of the present disclosure also provide a storage medium, where when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the resource partitioning method according to any of the above embodiments.
Embodiments of the present disclosure further provide a computer program product configured to execute the resource partitioning method according to any of the above embodiments.
Fig. 4 is a schematic block diagram illustrating an electronic device in accordance with an embodiment of the present disclosure. For example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, electronic device 400 may include one or more of the following components: processing components 402, memory 404, power components 406, multimedia components 408, audio components 410, input/output (I/O) interfaces 412, sensor components 414, and communication components 416.
The processing component 402 generally controls overall operation of the electronic device 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or part of the steps of the resource partitioning method described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the electronic device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 406 provides power to the various components of the electronic device 400. Power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 400.
The multimedia component 408 includes a screen that provides an output interface between the electronic device 400 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 400 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 may detect an open/closed state of the electronic device 400, the relative positioning of components, such as a display and keypad of the electronic device 400, the sensor assembly 414 may also detect a change in the position of the electronic device 400 or a component of the electronic device 400, the presence or absence of user contact with the electronic device 400, orientation or acceleration/deceleration of the electronic device 400, and a change in the temperature of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an embodiment of the present disclosure, the electronic device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the above-mentioned resource partitioning method.
In an embodiment of the present disclosure, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the electronic device 400 to perform the resource partitioning method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method and apparatus provided by the embodiments of the present disclosure are described in detail above, and the principles and embodiments of the present disclosure are explained herein by applying specific examples, and the above description of the embodiments is only used to help understanding the method and core ideas of the present disclosure; meanwhile, for a person skilled in the art, based on the idea of the present disclosure, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present disclosure should not be construed as a limitation to the present disclosure.

Claims (10)

1. A resource segmentation method is characterized by comprising the following steps:
responding to a transmission instruction of a target resource, generating a first fragment of the target resource, wherein the data volume of the first fragment is matched with the network state when the target resource is transmitted, and the network state comprises the network type and/or the network speed;
and sequentially generating the rest fragments of the target resource, wherein the data volume of the Nth fragment is obtained by calculating the data volume of the (N-1) th fragment and a dynamic growth factor, the value of the dynamic growth factor is positively correlated with the state value corresponding to the network quality state when the (N-1) th fragment is transmitted, and N is an integer greater than 1.
2. The method of claim 1, wherein the dynamic growth factor corresponding to the nth slice is further positively correlated to a growth rate, and the growth rate includes a rate pre-specified for a state value corresponding to a network quality state when the nth slice is transmitted.
3. The method of claim 1, wherein the status value corresponding to the network goodness status when the (N-1) th slice is transmitted is determined according to an average transmission rate when the (N-1) th slice is transmitted.
4. The method of claim 3, further comprising:
determining the average transmission rate according to the ratio of the data volume of the (N-1) th fragment to the transmission time consumption during transmission of the (N-1) th fragment;
the average transmission rate is normalized, and the result of the normalization process is used to determine a state value corresponding to a network goodness state.
5. The method of claim 1, wherein the status value corresponding to the network goodness status when transmitting the (N-1) th slice is determined according to the average transmission rate corresponding to the first N-1 slices transmitted respectively.
6. The method of claim 5, further comprising:
calculating the weighted sum of the average transmission rates respectively corresponding to the first N-1 fragments according to the weighted values respectively corresponding to the first N-1 fragments; and the value of the weight value is positively correlated with the size of the sequence number of the corresponding fragment.
7. The method of claim 1, further comprising:
and when the dynamic growth factor is higher than a preset multiplying power threshold value, determining the data volume of the Nth fragment according to the data volume of the (N-1) th fragment and the preset multiplying power threshold value.
8. A resource partitioning apparatus, comprising:
a first fragment generation module configured to generate a first fragment of a target resource in response to a transmission instruction for the target resource, where a data volume of the first fragment matches a network state when the target resource is transmitted, where the network state includes a network type and/or a network speed;
and the residual fragment generating module is configured to sequentially generate the residual fragments of the target resource, wherein the data volume of the Nth fragment is obtained by calculating the data volume of the (N-1) th fragment and a dynamic growth factor, the value of the dynamic growth factor is positively correlated with the state value corresponding to the network quality state when the (N-1) th fragment is transmitted, and N is an integer greater than 1.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute instructions to implement the resource partitioning method of any one of claims 1 to 7.
10. A storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the resource partitioning method of any one of claims 1 to 7.
CN202011003959.2A 2020-09-22 2020-09-22 Resource segmentation method, device, electronic equipment and storage medium Active CN112153681B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011003959.2A CN112153681B (en) 2020-09-22 2020-09-22 Resource segmentation method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011003959.2A CN112153681B (en) 2020-09-22 2020-09-22 Resource segmentation method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112153681A true CN112153681A (en) 2020-12-29
CN112153681B CN112153681B (en) 2024-02-23

Family

ID=73897595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011003959.2A Active CN112153681B (en) 2020-09-22 2020-09-22 Resource segmentation method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112153681B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168081A (en) * 2013-05-20 2014-11-26 腾讯科技(深圳)有限公司 Document transmission method and device
CN104185216A (en) * 2013-05-28 2014-12-03 腾讯科技(深圳)有限公司 File transferring method and apparatus
US8909261B1 (en) * 2008-12-16 2014-12-09 Sprint Communications Company L.P. Dynamic determination of file transmission chunk size for efficient media upload
CN104780092A (en) * 2014-01-13 2015-07-15 阿里巴巴集团控股有限公司 File transmission method and device as well as server system
CN104967634A (en) * 2014-05-21 2015-10-07 腾讯科技(北京)有限公司 File upload method and apparatus thereof
CN110324681A (en) * 2019-07-08 2019-10-11 广州酷狗计算机科技有限公司 Dicing method, device, storage medium and the Transmission system of multi-medium data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8909261B1 (en) * 2008-12-16 2014-12-09 Sprint Communications Company L.P. Dynamic determination of file transmission chunk size for efficient media upload
CN104168081A (en) * 2013-05-20 2014-11-26 腾讯科技(深圳)有限公司 Document transmission method and device
CN104185216A (en) * 2013-05-28 2014-12-03 腾讯科技(深圳)有限公司 File transferring method and apparatus
CN104780092A (en) * 2014-01-13 2015-07-15 阿里巴巴集团控股有限公司 File transmission method and device as well as server system
CN104967634A (en) * 2014-05-21 2015-10-07 腾讯科技(北京)有限公司 File upload method and apparatus thereof
CN110324681A (en) * 2019-07-08 2019-10-11 广州酷狗计算机科技有限公司 Dicing method, device, storage medium and the Transmission system of multi-medium data

Also Published As

Publication number Publication date
CN112153681B (en) 2024-02-23

Similar Documents

Publication Publication Date Title
CN110611829B (en) Video preloading method and device, electronic equipment and storage medium
EP4184506A1 (en) Audio processing
CN108965611B (en) Shooting interface switching method, device, equipment and storage medium
CN112153396B (en) Page display method, device, system and storage medium
US20220245401A1 (en) Method and apparatus for training model
CN112333518B (en) Function configuration method and device for video and electronic equipment
CN106909481B (en) Interface test method, interface test device and electronic equipment
CN112783779A (en) Test case generation method and device, electronic equipment and storage medium
CN112685599A (en) Video recommendation method and device
CN112685269A (en) Data acquisition method and device, electronic equipment and storage medium
CN110908814A (en) Message processing method and device, electronic equipment and storage medium
CN110913276A (en) Data processing method, device, server, terminal and storage medium
CN112153681A (en) Resource segmentation method and device, electronic equipment and storage medium
CN115314426A (en) Data acquisition method, system, electronic device and storage medium
CN112883314B (en) Request processing method and device
CN113067757B (en) Information transmission and storage method, device and medium
CN111880602B (en) Dropped frame detection method and device
CN109948012B (en) Serial number generation method and device and storage medium
CN110502714B (en) Information detection method and device, electronic equipment and storage medium
CN114567790A (en) Information display method and device, electronic equipment and storage medium
CN114077461A (en) Application program running method, device, equipment and storage medium
CN112769677A (en) Data synchronization method, data synchronization device, electronic equipment, storage medium and program product
CN112131104A (en) Test data distribution method and device, electronic equipment and storage medium
CN111984532A (en) Applet-based exception handling method and device
CN115361352B (en) Message updating method, device, electronic equipment and storage medium

Legal Events

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