Data processing method and related equipment
By acquiring the client device environment and adjusting the data return amount, the data return delay and high input and output occupancy when the device environment is poor, as well as multiple requests and high server load when the device environment is good, improving user experience and system operation efficiency.
Patent Information
- Application Number
- CN202311723054.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-06-17
AI Technical Summary
In the prior art, when the client equipment environment is poor, the data return takes a long time and the input and output occupies a high amount; when the device environment is good, the client needs to request multiple times, and the server requests per second load is too high.
By obtaining the client's device environment, adjusting the number of returned data, calculating the device environment score based on the device performance and network performance, and then adjusting the data return amount.
It effectively solves the problems of data return delay and high input and output occupancy when the equipment environment is poor, and reduces the multiple requests and server load problems when the equipment environment is good, improving user experience and system operation efficiency.
Smart Images

Figure CN120166079A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of mobile communication technologies, and in particular, to a data processing method and related devices. Background Art
[0002] In the prior art, for a data request initiated by a client, a fixed-length data is generally fed back, such as 20 news items, 20 videos, or 40 comments, etc. However, when the device environment of the client is poor, such as the network environment or the hardware performance of the device itself is poor, problems such as long time consumption and excessive input / output occupation will occur when receiving the aforementioned fed-back data. For those devices with a good device environment, when users consume content, they need to initiate requests to the server multiple times to obtain relevant content, which will cause the client to initiate multiple requests and the problem of excessive load on the number of requests per second of the server. Summary of the Invention
[0003] In view of this, the purpose of the present disclosure is to propose a data processing method and related devices.
[0004] Based on the above purpose, the present disclosure provides a data processing method, including:
[0005] Obtain the device environment of the client;
[0006] Adjust the amount of data returned to the client based on the device environment to obtain first data, and return the first data to the client.
[0007] Based on the above data processing method, an embodiment of the present disclosure provides a data processing device, including:
[0008] An obtaining module, which obtains the device environment of the client;
[0009] A returning module, which is used to adjust the amount of data returned to the client based on the device environment to obtain first data, and return the first data to the client.
[0010] In addition, an embodiment of the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the above method when executing the program.
[0011] An embodiment of the present disclosure also provides a non-transitory computer-readable storage medium, and the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the above method.
[0012] Embodiments of the present disclosure also provide a computer program product, including computer program instructions which, when running on a computer, cause the computer to execute the above method.
[0013] As can be seen from the above, through the data processing method provided by the present disclosure, by obtaining the device environment of the client, and then adjusting the amount of data returned to the client based on the device environment, the first data is obtained and the first data is returned to the client. The above method can effectively solve the problems of long time consumption and excessive input / output occupation that are likely to occur when the device environment of the client is poor due to the fixed length of the returned data, and solve the problems of the need to initiate requests multiple times and the excessive number of requests per second on the server side when the device environment of the client is good. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0015] Figure 1 shows the implementation process of the data processing method according to some embodiments of the present disclosure;
[0016] Figure 2 shows the schematic diagram of the process of injecting the first device environment score according to an embodiment of the present disclosure;
[0017] Figure 3 shows the schematic diagram of the process of adjusting the amount of data returned according to an embodiment of the present disclosure;
[0018] Figure 4 shows the internal structure of the data processing device according to an embodiment of the present disclosure;
[0019] Figure 5 shows the schematic diagram of the hardware structure of the electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] To make the objectives, technical solutions, and advantages of the present disclosure clearer and more understandable, the following further describes the present disclosure in detail with reference to specific embodiments and the accompanying drawings.
[0021] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the ordinary meanings understood by those of ordinary skill in the field to which the present disclosure belongs. The "first", "second" and similar terms used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. The terms such as "including" or "comprising" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. The terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left" and "right" are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0022] It can be understood that before using the technical solutions of the various embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.
[0023] For example, when a user's active request is received, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the technical solutions of the present disclosure according to the prompt message.
[0024] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving the user's active request may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0025] It can be understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not limit the implementation manner of the present disclosure, and other manners that meet relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0026] As described above, in the prior art, for a data request initiated by a client, a fixed-length data is generally returned, such as 20 news items, 20 videos, or 40 comments, etc. However, when the device environment of the client is poor, such as a poor network environment or poor hardware performance of the device itself, problems such as long time consumption and excessive input / output occupation will occur when receiving the aforementioned feedback data. For those devices with a better device environment, when users consume content, they need to initiate requests to the server multiple times to obtain relevant content, which will cause the client to initiate multiple requests and the server to have an excessive load of requests per second.
[0027] To this end, some embodiments of the present disclosure provide a data processing method, which can adjust the amount of data returned to the client by obtaining the device environment of the client. Thereby, the returned data can be well adapted to the device environment of the client, effectively preventing the occurrence of the aforementioned problems, ensuring the good operation of the client and the server, and greatly improving the user experience. In the embodiments of the present disclosure, the above data processing method can be implemented by an electronic device with computing capabilities.
[0028] Figure 1 Shows the implementation process of the data processing method described in the embodiments of the present disclosure. As Figure 1 shown, the method may include the following steps:
[0029] In step 102, obtain the device environment of the client.
[0030] In the embodiments of the present disclosure, different clients may have different device environments. The above device environment may refer to the hardware parameters of the device itself, or the environment where the device is currently located, such as the current network speed, network mode, etc., and the device environment may also include the user's habit of using the corresponding application. Of course, the device environment may also include other contents. Those skilled in the art can make relevant additions and deletions according to their own needs. However, it should be noted that after adding and deleting the device environment, the specific method of adjusting the amount of data returned to the client according to the device environment also needs to be adjusted accordingly. However, those skilled in the art cannot know the specific solution without creative labor. Therefore, the above description that those skilled in the art can make relevant additions and deletions to the content of the device environment is mainly used to express that the device environment may also include many other contents.
[0031] In the embodiments of the present disclosure, the device environment may include: device performance and network performance; obtaining the device environment of the client includes: obtaining the device performance and the network performance of the client.
[0032] In some embodiments of the present disclosure, the device performance is determined based on the hardware parameters of the client device. Specifically, the device performance may include the hardware parameters of the device, such as the central processing unit (CPU), memory, disk, etc. of the device, and the corresponding model may be referred to as the hardware parameter.
[0033] In the embodiments of the present disclosure, the process of obtaining the performance of the device can be to directly obtain the model corresponding to the aforementioned hardware parameters, or to use a preset algorithm to measure the performance of the hardware included in the aforementioned device. For example, the CPU of the device can be allowed to run a computing algorithm to obtain its time consumption, and the consumed time can be used to represent the device performance corresponding to the CPU. Correspondingly, the read-write algorithm can be used to test the time consumption of memory read-write copy and the time consumption of disk read-write copy, and the corresponding time consumption is the corresponding device performance.
[0034] In some embodiments of the present disclosure, device performance may further include video coding performance. Accordingly, when acquiring video coding capability, the video coding performance may be tested by a video coding algorithm.
[0035] In some embodiments of the present disclosure, the network performance may include a network speed. When acquiring the network speed of the client, the network speed carried by the device when initiating the request may be directly determined as the network speed corresponding to the network performance.
[0036] In some embodiments of the present disclosure, when obtaining the network speed of the client, the network speed of the requests issued within a period of time can also be obtained, and the median thereof is taken as the network speed for determining network performance. By determining the network speed in this way, the influence of network fluctuations on the subsequent calculation process caused by unstable network speed can be effectively avoided when the network fluctuates.
[0037] In some embodiments of the present disclosure, network performance may also include network standards, common network standards, such as second-generation mobile phone communication technical specifications, third-generation mobile phone communication technical specifications, fourth-generation mobile phone communication technical specifications, fifth-generation mobile phone communication technical specifications, and mobile hotspots, etc. When obtaining network performance, it can be achieved by obtaining the form of network standards. However, the method of obtaining network performance by relying on network standards is relatively rigid, because there will often be devices with more advanced network standards, and their actual network speed is lower than that of devices with lower network standards. This is obviously not in line with the original intention of the design, but the reason for setting this embodiment is that when the application is cold started, there is no network speed data provided to the server for acquisition, so the network performance of the device cannot be determined by the network speed at this time. Therefore, the network performance of the device can be temporarily obtained by the inherent network standard at this time to avoid the consequence that the application cannot provide network speed data during cold start and cannot perform subsequent steps.
[0038] Further, after obtaining the device environment of the client, in step 104, the amount of data returned to the client is adjusted based on the device environment to obtain first data, and the first data is returned to the client.
[0039] In the embodiments of the present disclosure, in the process of adjusting the amount of data returned to the client based on the device environment, it is necessary to calculate the corresponding scores of the parameters included in the device environment, and rely on the scores to further adjust the amount of data returned to the client.
[0040] In the embodiments of the present disclosure, adjusting the size of the data returned to the client based on the device environment includes: calculating the device performance score of the client according to the device performance; calculating the network performance score of the client according to the network performance; calculating the first device environment score of the client based on the device performance score, the network performance score, the weight corresponding to the device performance score, and the weight corresponding to the network performance score; and adjusting the size of the data returned to the client based on the first device environment score.
[0041] Based on the foregoing steps, the process of obtaining the device performance can be directly obtaining the model corresponding to the foregoing hardware parameters, or using a preset algorithm to measure the performance of the hardware included in the foregoing device.
[0042] In some embodiments of the present disclosure, if the process of obtaining device performance is to directly obtain the model corresponding to the hardware parameters, when the device performance score of the client is obtained according to the device performance calculation, a large amount of hardware data of the device that initiates the request can be first obtained on the server side, and the scores of different hardware parameters can be set according to the obtained data. Taking the CPU as an example, the score set for the top CPU can be higher, which can be set in the range of 8-10 points. For the mid-range processor, the score range can be set to about 6-8, and the rest are set in the range of 0-6. Of course, each range includes multiple types of CPUs, and the models of each CPU are further subdivided in each range, and finally each CPU model is guaranteed to be set with a corresponding score. Correspondingly, for other hardware, such as memory, disk, etc., a large amount of reference data is also obtained on the server side, and the scores of memory and disk with different performance are determined under a large amount of reference data, so as to ensure that different models of memory or disk have their corresponding device performance scores. After scoring different types of hardware, it is necessary to divide the weights of different hardware. The weights can be divided equally when setting. In other embodiments, the hardware resources corresponding to the main requirements of the application can also be determined. This is because different applications have different requirements for hardware. Some applications may focus on occupying CPU resources, while some applications may focus on occupying memory resources. Different applications have different characteristics. Therefore, the distribution of weights can also be appropriately adjusted according to the specific circumstances of the application, so that in addition to adapting the device during transmission, the data can also be more adaptable to different applications, which can effectively improve the user experience.
[0043] In some embodiments of the present disclosure, if the process of obtaining device performance is to calculate the time taken by different algorithms for each hardware of the device, the corresponding time is taken to obtain the corresponding score. For example, if the CPU takes 10 milliseconds to run the computing algorithm, its score is set to 9, if the memory read and write copy takes 15 seconds, its score is set to 8, the time taken for the disk to read and write the copy, its score is set to 2, and the time taken for the device to run the video encoding algorithm, its score is set to 3. Correspondingly, the mapping relationship between time and score can also be determined by obtaining a large amount of data on the server side, which is similar to the above steps, so it will not be repeated here.
[0044] In the above steps, whether it is by directly obtaining the model corresponding to the hardware parameters or by using different algorithms to calculate the hardware time consumption to obtain the corresponding device performance score, its essence is to divide the existing hardware performance utilization scores on the market, so that this application can quantify the device performance, that is, to intuitively present the device performance through scores, which can facilitate the calculation of subsequent steps.
[0045] refer to Figure 2, showing the schematic diagram of the process of injecting the first device environment score described in the embodiments of the present disclosure.
[0046] As Figure 2 shown, when the user consumes content, a corresponding network request will be initiated to the server. At this time, the public parameter interceptor will perform corresponding processing on the initiated request, and then obtain the corresponding device performance score, that is, the device performance score and network performance score calculated in the previous steps. Then, the first device environment score calculated based on the device performance score and network performance score will be injected into the public parameters. Specifically, in the previous step, after calculating the device performance score of the client, the device performance score corresponding to the client will be stored in the client. When a data request is initiated to the server, the stored device performance score can be added to the request parameters through the public parameter interceptor for use by the server when calculating the first device environment score.
[0047] In some embodiments of the present disclosure, the network performance includes network speed; calculating the network performance score of the client according to the network performance includes: calculating the network performance score of the client according to the network speed. When the network performance is network speed, first, the server needs to determine the threshold of the network performance score corresponding to the network speed, that is, at different network speeds, what the corresponding network performance scores are specifically. In the process of determining the score threshold, first, similarly, it is necessary to obtain the network speeds of a large number of devices to form a network speed set. Then, sort the network speed sequences in the network speed set, and then determine the thresholds of the network speeds corresponding to each percentile. For example, if a total of 100 data are collected, then when setting the threshold, the network speed corresponding to the 50th data can be set as the threshold corresponding to score 5. Similarly, the network speed corresponding to the 40th data can be set as the threshold corresponding to score 4, and so on. The reason for not directly setting the threshold by evenly dividing the network speed is that the network speeds of users generally follow a normal distribution, and there will be a large number of users with similar network speeds, while the number of users corresponding to the extreme values at both ends is relatively small. Therefore, if the network speed is simply evenly divided to set the threshold, the final result will not be accurate enough, which will affect the quantity of data finally returned to the user and the user experience.
[0048] In some embodiments of the present disclosure, the method further includes: in response to a network fluctuation event, obtaining the fluctuating network speeds corresponding to requests of a preset number of the clients; using the median of the preset number of the fluctuating network speeds as the network speed for determining the network performance score. When the network fluctuates, it is not as simple as described in the foregoing steps when determining the network speed. It is necessary to collect the fluctuating network speeds of the clients with network fluctuations over a period of time, and then use the median of the preset number of fluctuating network speeds as the network speed for determining the network performance score. This can effectively avoid the frequent change in the number of data returns caused by frequent network fluctuations, resulting in an extremely unstable data return process, and can effectively avoid adverse consequences such as congestion and delay.
[0049] In some embodiments of the present disclosure, the method further includes: in response to a network fluctuation event, obtaining the fluctuating network speeds corresponding to requests of a preset number of the clients; setting corresponding weights for each of the fluctuating network speeds; calculating a preset number of weighted network speeds based on each weight and the corresponding fluctuating network speed; calculating half of the sum of each weighted network speed, and matching, from each of the fluctuating network speeds, the fluctuating network speed closest to half of the sum of the weighted network speeds; using the fluctuating network speed closest to half of the sum of the weighted network speeds as the network speed for determining the network performance score. The solution provided here also obtains the network speed for determining the network performance score. The difference is that in the foregoing solution, only the median of many network speeds is taken as a representative, while in the solution of this embodiment, corresponding weights are set for the obtained many fluctuating network speeds. Specifically, the weight value corresponding to the fluctuating network speed obtained more recently will be larger because it can better represent the current network speed. Therefore, the weight value of the fluctuating network speed closer to the current time will be set relatively larger. It should be noted that when obtaining the fluctuating network speed, it is necessary to record the weight corresponding to the fluctuating network speed, the time consumed for returning the data, and the network speed at the time of this data return. Based on the foregoing data, the weighted network speed, that is, the product of the weight and the fluctuating network speed, can be calculated. In some embodiments, taking the number of obtained fluctuating network speeds as 10 as an example, first, sort the 10 records, and calculate half of the sum of the weighted network speeds. At this time, traverse the obtained fluctuating network speeds, take the network speed value corresponding to the record of half of the sum of the weighted network speeds, and use it as the value for determining the network performance score.
[0050] In some embodiments of the present disclosure, the network performance includes a network standard; the calculating the network performance score of the client according to the network performance includes: calculating the network performance score of the client according to the network standard. When the network performance is a network standard, the server can directly obtain the network standard corresponding to the device, and then determine the corresponding network performance score according to the obtained network standard. Because this solution is mainly provided for application cold start, the score setting can be relatively simple, such as setting the second-generation mobile phone communication technology specification to 2 points, the third-generation mobile phone communication technology specification to 5 points, the fourth-generation mobile phone communication technology specification to 8 points, the fifth-generation mobile phone communication technology specification to 10 points, and the mobile hotspot to 8 points.
[0051] Regarding the aforementioned network performance score, after the client initiates a request to the server, the network speed determined in the aforementioned steps and the network standard of the current device can be injected into the request parameters through the public parameter interceptor, and finally uploaded to the server.
[0052] After the device performance score and the network performance score are calculated based on the aforementioned steps, the first device environment score is calculated based on the aforementioned two scores and the weights corresponding to the two scores.
[0053] In an embodiment of the present disclosure, the method further includes: in response to the device performance score being greater than the network performance score, setting the weight corresponding to the device performance score to be less than the weight corresponding to the network performance score; in response to the device performance score being less than the network performance score, setting the weight corresponding to the device performance score to be greater than the weight corresponding to the network performance score.
[0054] When setting the weights of the two scores, the weights of the two scores can be adjusted accordingly according to the size relationship between the two scores. For example, when the device performance score is greater than the network performance score, the weight corresponding to the device performance score can be adjusted to be less than the weight corresponding to the network performance score, because the calculation result of the aforementioned step, that is, the first device environment score, will affect the amount of data transmission, and in the process of data transmission, it is mainly limited to the party with the lower score, that is, the amount of data transmission is mainly affected by the lower limit of the device environment. Therefore, when setting the weight, the weight of the party with the lower score can be set larger. This can effectively ensure the stability of the transmission process and effectively avoid the situation where the amount of data returned by the final selection is not suitable for the performance of one of the parties. Similarly, if the device performance score is less than the network performance score, the weight corresponding to the device performance score is adjusted to be greater than the weight corresponding to the network performance score. The specific reasons are the same as those discussed above, so they will not be repeated here.
[0055] refer to Figure 3, which shows the schematic diagram of the process of adjusting the number of returned data according to the embodiments of the present disclosure.
[0056] As Figure 3 shown, the client will initiate a network request carrying device performance and network performance. Then, the server determines the final device environment score according to the information carried in the network request, and then determines the number of data to be returned according to this score. Finally, the corresponding content is returned to the client according to this number.
[0057] In the embodiments of the present disclosure, the device environment further includes the historical browsing speed; obtaining the device environment of the client further includes: obtaining the historical browsing speed of the client. The historical browsing speed can be the historical browsing speed of the user when using the application. In the actual use process, it is necessary to comprehensively consider the device performance, network performance, and the historical browsing speed of the client. This is to meet the situation of clients with good device performance scores and network performance scores but slow user browsing speeds. For such situations, there is no need to return too much data to the client at one time because the user's browsing speed is slow. Therefore, it can be seen that the embodiments of the present disclosure can effectively avoid waste of resources in the process of returning data.
[0058] Further, in the embodiments of the present disclosure, adjusting the size of the data returned to the client based on the device environment includes: calculating the device performance score of the client according to the device performance; calculating the network performance score of the client according to the network performance; calculating the historical browsing score of the client according to the historical browsing speed; calculating the second device environment score of the client based on the device performance score, the network performance score, the historical browsing score, the weight corresponding to the device performance score, the weight corresponding to the network performance score, and the weight corresponding to the historical browsing score; adjusting the size of the data returned to the client based on the second device environment score.
[0059] Similarly, the process of calculating the device performance score and the network performance score is as described above and will not be elaborated here. The difference is that the embodiments of the present disclosure also calculate the historical browsing score corresponding to the client according to the historical browsing speed, and comprehensively calculate the second device environment score of the client based on the weights corresponding to the three scores. Then, the size of the data returned to the client is adjusted according to this second device environment score.
[0060] In the embodiments of the present disclosure, the method further includes: obtaining the number of the first data consumed by the client; in response to the number reaching a preset threshold, returning the corresponding number of second data to the client.
[0061] For some users, the solution after adjusting the returned data greatly reduces the amount of data returned each time compared to before, which sometimes causes problems with the continuity of the user's browsing of the application. In this case, preloading can be used to ensure the continuity of the user's browsing. For example, if a user could originally consume 50 data items at a time, but the optimized solution can only consume 10 data items at a time. When the user consumes the seventh data item, the application can actively trigger a network request to obtain the second batch of data. This can largely avoid the impairment of the continuity when the user consumes data and effectively ensure the smoothness when the user browses data.
[0062] In an embodiment of the present disclosure, the size of the first device environment score is proportional to the quantity of the first data returned to the client.
[0063] In an embodiment of the present disclosure, the size of the second device environment score is proportional to the quantity of the first data returned to the client.
[0064] The first device environment score and the second device environment score mentioned in the foregoing embodiments are the same in principle. The larger their respective values are, the more data will be returned to the client, and they are proportional.
[0065] The above data processing method obtains the device environment of the client, and then adjusts the quantity of data returned to the client based on this device environment to obtain the first data, and returns the first data to the client. The above method can effectively solve the problems of long time consumption and excessive input / output occupation that are likely to occur when the device environment of the client is poor due to the fixed length of the returned data in different device environments of different clients, and solve the problems of the need to initiate requests multiple times and the excessive number of requests per second on the server side when the device environment of the client is good.
[0066] It should be noted that the method of the embodiment of the present disclosure can be executed by a single device, such as a computer or a server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In this case of a distributed scenario, one of the multiple devices can only execute one or more steps of the method of the embodiment of the present disclosure, and these multiple devices will interact with each other to complete the described method.
[0067] It should be noted that some embodiments of the present disclosure have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the above embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0068] Corresponding to the above data processing method, an embodiment of the present disclosure also discloses a data processing device. Figure 4 The internal structure of the data processing device described in the embodiments of the present disclosure is shown. As Figure 4 shown, the device may include:
[0069] An acquisition module 402, which acquires the device environment of the client;
[0070] A return module 404, configured to adjust the amount of data returned to the client based on the device environment to obtain first data, and return the first data to the client.
[0071] In some embodiments of the present disclosure, the device environment includes: device performance and network performance;
[0072] The acquisition module 402 includes:
[0073] A first acquisition unit, configured to acquire the device performance and the network performance of the client.
[0074] In some embodiments of the present disclosure, the device environment further includes the historical browsing speed;
[0075] The acquisition module 402 further includes:
[0076] A second acquisition unit, configured to acquire the historical browsing speed of the client.
[0077] In some embodiments of the present disclosure, the return module 404 includes:
[0078] A device performance calculation unit, configured to calculate the device performance score of the client according to the device performance;
[0079] A network performance calculation unit, configured to calculate the network performance score of the client according to the network performance;
[0080] A first device environment score calculation unit, configured to calculate a first device environment score of the client based on the device performance score, the network performance score, the weight corresponding to the device performance score, and the weight corresponding to the network performance score;
[0081] A first adjustment unit, configured to adjust the size of the data returned to the client based on the first device environment score.
[0082] In some embodiments of the present disclosure, wherein the return module 404 includes:
[0083] A device performance calculation unit, configured to calculate a device performance score of the client according to the device performance;
[0084] A network performance calculation unit, configured to calculate a network performance score of the client according to the network performance;
[0085] A historical browsing score calculation unit, configured to calculate a historical browsing score of the client according to the historical browsing speed;
[0086] A second device environment score calculation unit, configured to calculate a second device environment score of the client based on the device performance score, the network performance score, the historical browsing score, the weight corresponding to the device performance score, the weight corresponding to the network performance score, and the weight corresponding to the historical browsing score;
[0087] A second adjustment unit, configured to adjust the size of the data returned to the client based on the second device environment score.
[0088] In some embodiments of the present disclosure, wherein the device performance is calculated based on the hardware parameters of the device of the client.
[0089] In some embodiments of the present disclosure, the network performance includes network speed;
[0090] The device performance calculation unit includes:
[0091] Calculate the network performance score of the client according to the network speed.
[0092] In some embodiments of the present disclosure, wherein the network performance includes network mode;
[0093] The network performance calculation unit includes:
[0094] Calculate the network performance score of the client according to the network mode.
[0095] In some embodiments of the present disclosure, it further includes:
[0096] The first response module is configured to, in response to the device performance score being greater than the network performance score, set the weight corresponding to the device performance score to be less than the weight corresponding to the network performance score;
[0097] The second response module is configured to, in response to the device performance score being less than the network performance score, set the weight corresponding to the device performance score to be greater than the weight corresponding to the network performance score.
[0098] In some embodiments of the present disclosure, it further includes:
[0099] The first network fluctuation event response module is configured to, in response to a network fluctuation event, obtain the fluctuating network speeds corresponding to requests of a preset number of the clients;
[0100] The median module is configured to use the median of the preset number of the fluctuating network speeds as the network speed for determining the network performance score.
[0101] In some embodiments of the present disclosure, it further includes:
[0102] The second network fluctuation event response module is configured to, in response to a network fluctuation event, obtain the fluctuating network speeds corresponding to requests of a preset number of the clients;
[0103] The weight setting module is configured to set corresponding weights for each of the fluctuating network speeds;
[0104] The weighted network speed calculation module is configured to calculate a preset number of weighted network speeds based on each of the weights and the corresponding fluctuating network speed;
[0105] The matching module is configured to calculate half of the sum of each of the weighted network speeds and match, from each of the fluctuating network speeds, the fluctuating network speed closest to half of the sum of the weighted network speeds;
[0106] The network speed determination module is configured to use the fluctuating network speed closest to half of the sum of the weighted network speeds as the network speed for determining the network performance score.
[0107] In some embodiments of the present disclosure, it further includes:
[0108] The first data acquisition module is configured to acquire the quantity of the first data consumed by the client;
[0109] The third response module is configured to, in response to the quantity reaching a preset threshold, return a corresponding quantity of second data to the client.
[0110] In some embodiments of the present disclosure, the magnitude of the first device environment score is proportional to the quantity of the first data returned to the client.
[0111] In some embodiments of the present disclosure, the magnitude of the second device environment score is proportional to the amount of the first data returned to the client.
[0112] For convenience of description, when describing the above device, various modules are described separately according to their functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in one or more pieces of software and / or hardware.
[0113] The device of the above embodiment is used to implement the corresponding data processing method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated herein.
[0114] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the data processing method described in any of the above embodiments when executing the program.
[0115] Figure 5 FIG. shows a more specific schematic diagram of the hardware structure of the electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. Among them, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other inside the device through the bus 1050.
[0116] The processor 1010 may be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0117] The memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0118] The input / output interface 1030 is used to connect to the input / output module to achieve information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input devices can include keyboards, mice, touchscreens, microphones, various sensors, etc., and the output devices can include displays, speakers, vibrators, indicator lights, etc.
[0119] The communication interface 1040 is used to connect to the communication module (not shown in the figure) to achieve communication and interaction between this device and other devices. Among them, the communication module can achieve communication through wired means (such as USB, network cable, etc.) or through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0120] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0121] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solution of the embodiments of this specification, and do not necessarily include all the components shown in the figure.
[0122] The electronic device of the above embodiment is used to implement the corresponding data processing method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0123] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present disclosure also provides a non-transitory computer-readable storage medium, and the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause the computer to execute the data processing method described in any of the foregoing embodiments.
[0124] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0125] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the data processing method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0126] Based on the same inventive concept, corresponding to the data processing method described in any of the above embodiments, the present disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer to cause the computer and / or the processor to execute the data processing method. Corresponding to the execution subjects of the respective steps in the respective embodiments of the data processing method, the processors that execute the corresponding steps can belong to the corresponding execution subjects.
[0127] The computer program product of the above embodiment is used to cause the computer and / or the processor to execute the data processing method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0128] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; under the concept of the present disclosure, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present disclosure as described above, and they are not provided in detail for the sake of brevity.
[0129] In addition, for simplicity of explanation and discussion, and so as not to render the embodiments of the present disclosure difficult to understand, well-known power / ground connections of integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Further, the devices may be shown in block diagram form in order to avoid rendering the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that details of the implementation of such block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (i.e., these details should be entirely within the understanding of those skilled in the art). In cases where specific details (such as circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure may be practiced without these specific details or with variations of these specific details. Accordingly, these descriptions should be considered illustrative rather than restrictive.
[0130] Although the present disclosure has been described in connection with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (such as dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0131] Embodiments of the present disclosure are intended to cover all such alternatives, modifications, and variations that fall within the broad scope of the appended claims. Accordingly, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of the present disclosure should be included within the protection scope of the present disclosure.
Claims
1. A data processing method, comprising: Obtain the device environment of the client; Based on the device environment, adjust the amount of data returned to the client to obtain the first data, and return the first data to the client.
2. The method according to claim 1, wherein, The device environment includes: device performance and network performance; The obtaining of the device environment of the client includes: Obtain the device performance and the network performance of the client.
3. The method according to claim 2, wherein, The device environment further includes the historical browsing speed; The obtaining of the device environment of the client further includes: Obtain the historical browsing speed of the client.
4. The method according to claim 2, wherein, The adjusting of the data size returned to the client based on the device environment includes: Calculate the device performance score of the client according to the device performance; Calculate the network performance score of the client according to the network performance; Based on the device performance score, the network performance score, the weight corresponding to the device performance score, and the weight corresponding to the network performance score, calculate the first device environment score of the client; Adjust the data size returned to the client based on the first device environment score.
5. The method according to claim 3, wherein, The adjusting of the data size returned to the client based on the device environment includes: Calculate the device performance score of the client according to the device performance; Calculate the network performance score of the client according to the network performance; Calculate the historical browsing score of the client according to the historical browsing speed; Based on the device performance score, the network performance score, the historical browsing score, the weight corresponding to the device performance score, the weight corresponding to the network performance score, and the weight corresponding to the historical browsing score, calculate the second device environment score of the client; Adjust the data size returned to the client based on the second device environment score.
6. The method according to claim 4 or 5, wherein, The device performance is determined based on the hardware parameters of the client's device.
7. The method according to claim 4 or 5, wherein, The network performance includes network speed; The calculating of the network performance score of the client according to the network performance includes: Calculate the network performance score of the client according to the network speed.
8. The method according to claim 4 or 5, wherein, The network performance includes network mode; The calculating of the network performance score of the client according to the network performance includes: Calculate the network performance score of the client according to the network mode.
9. The method according to claim 4 or 5, further comprising: In response to the device performance score being greater than the network performance score, set the weight corresponding to the device performance score to be less than the weight corresponding to the network performance score; In response to the device performance score being less than the network performance score, set the weight corresponding to the device performance score to be greater than the weight corresponding to the network performance score.
10. The method according to claim 7, further comprising: In response to a network fluctuation event, obtain the fluctuating network speeds corresponding to a preset number of requests of the client; Use the median of the preset number of fluctuating network speeds as the network speed for determining the network performance score.
11. The method according to claim 7, further comprising: In response to a network fluctuation event, obtain the fluctuating network speeds corresponding to a preset number of requests of the client; Set corresponding weights for each of the fluctuating network speeds; Based on each weight and the corresponding fluctuating network speed, calculate a preset number of weighted network speeds; Calculate half of the sum of each of the weighted network speeds, and match, from each of the fluctuating network speeds, the fluctuating network speed closest to half of the sum of the weighted network speeds; Use the fluctuating network speed closest to half of the sum of the weighted network speeds as the network speed for determining the network performance score.
12. The method according to claim 1, further comprising: Obtain the quantity of the first data consumed by the client; In response to the quantity reaching a preset threshold, return a corresponding quantity of second data to the client.
13. The method according to claim 4, wherein, The magnitude of the first device environment score is proportional to the quantity of the first data returned to the client.
14. The method according to claim 5, wherein, The magnitude of the second device environment score is proportional to the quantity of the first data returned to the client.
15. A data processing apparatus, comprising: An acquisition module that acquires the device environment of the client; A return module that, based on the device environment, adjusts the quantity of data returned to the client to obtain first data, and returns the first data to the client.
16. The apparatus according to claim 15, wherein, The device environment includes: device performance and network performance; The acquisition module includes: A first acquisition unit that acquires the device performance and the network performance of the client.
17. The apparatus according to claim 15, wherein, The device environment further includes the historical browsing speed; The acquisition module further includes: A second acquisition unit that acquires the historical browsing speed of the client.
18. The apparatus according to claim 16, wherein, The return module includes: A device performance calculation unit that calculates the device performance score of the client according to the device performance; A network performance calculation unit that calculates the network performance score of the client according to the network performance; A first device environment score calculation unit that calculates the first device environment score of the client based on the device performance score, the network performance score, the weight corresponding to the device performance score, and the weight corresponding to the network performance score; A first adjustment unit that adjusts the size of the data returned to the client based on the first device environment score.
19. The apparatus according to claim 17, wherein, The return module includes: A device performance calculation unit that calculates the device performance score of the client according to the device performance; A network performance calculation unit that calculates the network performance score of the client according to the network performance; A historical browsing score calculation unit that calculates the historical browsing score of the client according to the historical browsing speed; A second device environment score calculation unit that calculates the second device environment score of the client based on the device performance score, the network performance score, the historical browsing score, the weight corresponding to the device performance score, the weight corresponding to the network performance score, and the weight corresponding to the historical browsing score; A second adjustment unit that adjusts the size of the data returned to the client based on the second device environment score.
20. The apparatus according to claim 18 or 19, wherein, The device performance is calculated based on the hardware parameters of the client's device.
21. The device according to claim 18 or 19, further comprising: A first response module that, in response to the device performance score being greater than the network performance score, sets the weight corresponding to the device performance score to be less than the weight corresponding to the network performance score; A second response module, configured to, in response to the device performance score being less than the network performance score, set the weight corresponding to the device performance score to be greater than the weight corresponding to the network performance score.
22. The device according to claim 15, further comprising: A first data acquisition module, configured to acquire the quantity of the first data consumed by the client; A third response module, configured to, in response to the quantity reaching a preset threshold, return a corresponding quantity of second data to the client.
23. The device according to claim 18, wherein, The magnitude of the first device environment score is proportional to the quantity of the first data returned to the client.
24. The device according to claim 19, wherein, The magnitude of the second device environment score is proportional to the quantity of the first data returned to the client.
25. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, When the processor executes the program, the method according to any one of claims 1 to 15 is implemented.
26. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 15.
27. A computer program product comprising computer program instructions which, when run on a computer, cause the computer to execute the method according to any one of claims 1 to 15.