Log resource management method and related device

By dynamically adjusting log resource allocation according to log resource management methods, the problem of insufficient log information is solved, the utilization efficiency of log resources is improved, and developers can better locate and analyze problems.

CN117724937BActive Publication Date: 2024-09-17HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410172798.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-07
Publication Date
2024-09-17
Estimated Expiration
2044-02-07

AI Technical Summary

Technical Problem

When developers locate problems, it may be difficult to locate the problem due to insufficient log information obtained. Especially when electronic devices frequently experience performance freezes, the uploaded log information is not enough to accurately locate the cause of the problem.

Method used

By considering the number of problem tickets provided by users, the number of collected logs, and the number of performance fault management, the allocation of log resources is dynamically adjusted. Devices that frequently experience performance lags upload more log information, while devices that rarely experience performance lags upload more log information. Less log information, thereby rationally allocating resources for uploading logs.

Benefits of technology

It improves the utilization efficiency of log resources, ensures that developers can obtain sufficient log information for problem location and analysis, and improves the efficiency and accuracy of problem solving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117724937B
    Figure CN117724937B
Patent Text Reader

Abstract

The log resource management method and related device provided by the embodiment of the present application relate to the field of terminal technology. The method includes: the number of problem tickets provided by users, the number of collected logs, and the number of collected performance fault points can be considered, and used as factors for allocating uploaded log resources. In this way, for electronic devices that frequently have performance jams, more log information can be uploaded to facilitate developers to locate and analyze problems. For electronic devices that rarely have performance jams, less log information can be uploaded, thereby reasonably allocating resources for uploading logs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a log resource management method and related devices. Background Art

[0002] Electronic devices can print logs during operation, which may include call information between functions, scheduling information of processes or threads, performance information of system operation, etc. Electronic devices can also upload logs to cloud servers, and developers can locate and analyze problems based on the logs in the cloud servers.

[0003] However, when developers are locating problems, they may not obtain enough log information, making it difficult to locate the problem. Summary of the invention

[0004] The log resource management method and related device provided by the embodiment of the present application can consider the number of problem tickets provided by users, the number of logs collected, and the number of performance fault points collected, and use them as factors for allocating uploaded log resources. In this way, for electronic devices that frequently have performance jams, more log information can be uploaded to facilitate developers to locate and analyze problems. For electronic devices that rarely have performance jams, less log information can be uploaded, thereby reasonably allocating resources for uploading logs.

[0005] In a first aspect, a log resource management method provided by an embodiment of the present application is applied to a first electronic device, and the method includes:

[0006] Receive log data from N electronic devices, the N electronic devices include a second electronic device and a third electronic device, and N is an integer greater than 1; determine a first value and a second value, wherein the first value is used to indicate the maximum number of logs uploaded by the second electronic device to the first electronic device, the first value is positively correlated with the frequency of the second electronic device uploading log data to the first electronic device, and the second value is used to indicate the maximum number of logs uploaded by the third electronic device to the first electronic device, the second value is positively correlated with the frequency of the third electronic device uploading log data to the first electronic device, and the first value is different from the second value; send the first value to the second electronic device; send the second value to the third electronic device. In this way, for electronic devices with a large number of problem tickets, a large number of performance logs, and / or a large number of performance faults, more resources for uploading logs can be allocated; for electronic devices with a small number of problem tickets, a small number of performance logs, and / or a small number of performance faults, fewer resources for uploading logs can be allocated. It can also be understood that for electronic devices with frequent performance jams, more log information can be uploaded to facilitate developers to locate and analyze problems. For electronic devices with less performance jams, less log information can be uploaded, thereby reasonably allocating resources for uploading logs.

[0007] In a possible implementation, after receiving log data from N electronic devices, it also includes: determining a first weight, the first weight is positively correlated with the ranking of the frequency of the second electronic device uploading log data to the first electronic device among the frequencies of the N electronic devices uploading log data to the first electronic device; determining a first value, including: determining the first value based on the first weight, the first weight is positively correlated with the first value. When the first weight is larger, the electronic device can be allocated more log quotas, which is conducive to the location and analysis of the problem; when the first weight is smaller, the electronic device can be allocated less log quotas. In this way, the cloud server can collect more useful performance logs, which is convenient for developers to locate and solve problems based on performance logs.

[0008] In a possible implementation, the first weight and the first value satisfy the following formula:

[0009] .

[0010] in, wi is the first weight, Li is the first value, L adjust The first electronic device is the i The number of uploaded logs preset by each electronic device, i is an integer greater than or equal to 1, iLess than or equal to N. The first electronic device may sum the adjustable log quotas of each electronic device to obtain a total adjustable log quota. The total adjustable log quota may be understood as a public resource pool, so that each electronic device may obtain more or less log quota from the public resource pool based on the size of the log weight.

[0011] In a possible implementation, the first weight and the first value satisfy the following formula:

[0012] .

[0013] in, wi is the first weight, Li is the first value, L adjust The first electronic device is the i The number of adjustable logs for each electronic device setting, L basic The first electronic device is the i The minimum number of uploaded logs set by each electronic device, i is an integer greater than or equal to 1, i Less than or equal to N. The first electronic device can allocate a basic log quota and an adjustable log quota to each electronic device. The basic log quota allows each electronic device to obtain a certain log quota. For electronic devices that upload logs less frequently, when the electronic device fails, the developers can still locate and analyze the problem of the electronic device through log information. In this way, under the premise that the total amount of log resources allocated by the cloud server to the electronic device remains unchanged and the pressure on the cloud server is not increased, the resources for log upload can be reasonably adjusted and allocated based on different log weights, thereby improving the efficiency of log collection.

[0014] In a possible implementation, sending a first value to a second electronic device includes: sending the first value to the second electronic device in the Lth cycle, where L is an integer greater than or equal to 1; after sending the first value to the second electronic device, further including: receiving log data from the second electronic device in the L+1th cycle; determining a third value, where the third value is used to indicate the maximum number of logs uploaded by the second electronic device to the first electronic device, and the third value is positively correlated with the frequency of the second electronic device uploading log data to the first electronic device; and sending the third value to the second electronic device. For the same electronic device, the log quotas obtained in different cycles may be the same or different. In this way, the log quota of the second electronic device can be flexibly adjusted according to the different numbers of logs uploaded by the second electronic device in different cycles, thereby rationally utilizing the memory resources of the first electronic device.

[0015] In a possible implementation, before determining the third value, it also includes: determining a third weight, the third weight is positively correlated with one or more of the following: the ranking of the frequency of the second electronic device uploading log data to the first electronic device among the frequencies of N electronic devices uploading log data to the first electronic device, and the first weight; determining the third value includes: determining the third value based on the third weight, the third weight is positively correlated with the third value. Since the user's habits may not change significantly during the process of using the electronic device, when calculating the third weight, the first weight of the previous cycle can be considered in combination, so that the log weight of the previous cycle can be used as an empirical value for reference, thereby obtaining a more accurate and reasonable log weight.

[0016] In a possible implementation, the third weight satisfies the following formula:

[0017] .

[0018] in, wi is the third weight, is a weight obtained based on the ranking of the frequency of the second electronic device uploading log data to the first electronic device among the frequencies of the N electronic devices uploading log data to the first electronic device, is the first weight, and D is the weight of the first weight in the L+1th cycle. When calculating the third weight, the first weight of the previous cycle can be considered in combination, so that the user's previous habits can be considered to obtain a more accurate and reasonable log weight.

[0019] In a possible implementation, the log data includes one or more of the following: problem ticket information, performance log information or fault management information; wherein the problem ticket information is used to record problems occurring in the electronic device, and the problem ticket information includes one or more of the following information: problem description, pictures related to the problem, problem frequency or problem type; performance log information is used to record the running status of the electronic device, and the performance log information includes one or more of the following information: call information between functions, scheduling information of processes or threads, load information of the kernel, kernel usage rate or running status of threads on the kernel; fault management information is used to record jams occurring in the electronic device, and the fault management information includes one or more of the following information: jam type, jam time or jam level. In this way, the first electronic device can count the number of problem tickets, the number of performance logs and the number of fault management based on the log data uploaded by each electronic device, thereby calculating the log quota of each electronic device, so that the allocation of log resources is more reasonable.

[0020] In a possible implementation, the first electronic device includes a first service, a second service, and a third service. After receiving log data from N electronic devices, the first service also includes: the first service counts a fourth value, a fifth value, and a sixth value based on the log data of the second electronic device, the fourth value includes the number of problem tickets, the fifth value includes the number of logs, and the sixth value includes the number of fault points; before determining the first value, the second service determines the ranking of the second electronic device among the N electronic devices, and the ranking is positively correlated with one or more of the following: the fourth value, the fifth value, or the sixth value; the second service determines the first weight; determining the first value includes: the second service determines the first value based on the first weight, and the first weight is positively correlated with the first value; sending the first value to the second electronic device includes: the third service sends the first value to the second electronic device. For electronic devices with higher performance sensitivity, the log quota calculation service can set a larger log weight, so that more resources for uploading logs can be allocated. For electronic devices with lower performance sensitivity, the log quota calculation service can set a smaller log weight, so that fewer resources for uploading logs can be allocated. In this way, the cloud server can collect more useful performance logs, which is convenient for developers to locate and solve problems based on performance logs.

[0021] In one possible implementation, the first service stores the weight value of the previous cycle, and before the second service determines the first weight, it also includes: the second service obtains the weight value of the previous cycle from the first service; the second service determines the first weight, including: the second service determines the first weight based on the ranking and the weight value of the previous cycle. The first service can record the weight of the log quota of each electronic device. When the second service calculates the log quota of the next cycle, the weight of the log quota recorded last time can be obtained from the first service as reference data for calculating the log quota of the next cycle. In this way, the log weight of the previous cycle can be used as an empirical value for reference, so as to obtain a more accurate and reasonable log weight.

[0022] In a possible implementation, the second electronic device includes a fourth service and a fifth service, the fourth service is used to receive a first value from the first electronic device and transmit the first value to the fifth service; the fifth service is used to determine whether the second electronic device is allowed to upload logs to the first electronic device based on the first value, if the number of logs uploaded by the second electronic device to the first electronic device is less than the first value, the second electronic device is allowed to upload logs to the first electronic device; or, if the number of logs uploaded by the second electronic device to the first electronic device is equal to the first value, the second electronic device is not allowed to upload logs to the first electronic device. For electronic devices that upload more logs, more resources for uploading logs can be obtained, which is convenient for developers to locate and analyze problems. For electronic devices that upload fewer logs, fewer resources for uploading logs can be obtained, so that the resources for uploading logs can be reasonably allocated, which is convenient for developers to locate and analyze problems.

[0023] In a second aspect, an embodiment of the present application provides a device for log resource management, which may be an electronic device, or a chip or chip system in an electronic device. The device may include a processing unit. The processing unit is used to implement any method related to processing performed by the electronic device in the first aspect or any possible implementation of the first aspect. When the device is an electronic device, the processing unit may be a processor. The device may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit so that the electronic device implements the method described in the first aspect or any possible implementation of the first aspect. When the device is a chip or chip system in an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit so that the electronic device implements the method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit in the chip (for example, a register, a cache, etc.), or a storage unit in the electronic device located outside the chip (for example, a read-only memory, a random access memory, etc.).

[0024] Exemplarily, the processing unit is used to receive log data from N electronic devices; also used to determine a first value and a second value; specifically, to send the first value to the second electronic device; and also used to send the second value to a third electronic device.

[0025] In a possible implementation, the processing unit is used to determine a first weight; and is also used to determine a first value based on the first weight.

[0026] In a possible implementation, the first weight and the first value satisfy the following formula:

[0027] .

[0028] in, wi is the first weight, Li is the first value, L adjust The first electronic device is the i The number of uploaded logs preset by each electronic device, i is an integer greater than or equal to 1, i Less than or equal to N.

[0029] In a possible implementation, the first weight and the first value satisfy the following formula:

[0030] .

[0031] in, wi is the first weight, Li is the first value, L adjust The first electronic device is the i The number of adjustable logs for each electronic device setting, L basic The first electronic device is the i The minimum number of uploaded logs set by each electronic device, i is an integer greater than or equal to 1, i Less than or equal to N.

[0032] In one possible implementation, the processing unit is used to send the first value to the second electronic device in the Lth cycle, and is also used to receive log data from the second electronic device in the L+1th cycle; specifically, it is also used to determine the third value, and is also used to send the third value to the second electronic device.

[0033] In a possible implementation, the processing unit is used to determine a third weight; and is also used to determine a third value based on the third weight.

[0034] In a possible implementation, the third weight satisfies the following formula:

[0035] .

[0036] in, wi is the third weight, is a weight obtained based on the ranking of the frequency of the second electronic device uploading log data to the first electronic device among the frequencies of the N electronic devices uploading log data to the first electronic device, is the first weight, and D is the weight of the first weight in the L+1th cycle.

[0037] In a possible implementation, the log data includes one or more of the following: problem ticket information, performance log information, or fault management information.

[0038] In one possible implementation, the processing unit is used to count the fourth value, the fifth value, and the sixth value based on the log data of the second electronic device, and is also used to determine the ranking of the second electronic device among N electronic devices, and is also used to determine the first weight; specifically, it is also used to determine the first value based on the first weight, and is also used to send the first value to the second electronic device.

[0039] In a possible implementation, the processing unit is used to obtain the weight value of the previous cycle from the first service; and is also used to determine the first weight based on the ranking and the weight value of the previous cycle.

[0040] In one possible implementation, the second electronic device includes a fourth service and a fifth service. The fourth service is used to receive a first value from the first electronic device and transmit the first value to the fifth service. The fifth service is used to determine whether the second electronic device is allowed to upload logs to the first electronic device based on the first value. If the number of logs uploaded by the second electronic device to the first electronic device is less than the first value, the second electronic device is allowed to upload logs to the first electronic device; or, if the number of logs uploaded by the second electronic device to the first electronic device is equal to the first value, the second electronic device is not allowed to upload logs to the first electronic device.

[0041] In a third aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and a memory, wherein the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method described in the first aspect or any possible implementation of the first aspect.

[0042] In a fourth aspect, an embodiment of the present application provides a system, the system comprising: a first electronic device and a second electronic device, the first electronic device being used to execute the method described in the first aspect or any possible implementation manner of the first aspect.

[0043] The second electronic device is used to upload log data to the first electronic device, the second electronic device is also used to receive a first value from the first electronic device, and the second electronic device is also used to determine whether to allow the second electronic device to upload logs to the first electronic device based on the first value.

[0044] In a fifth aspect, the present application provides a chip or a chip system, which is applied to an electronic device, and the chip or chip system includes one or more processors and a communication interface, wherein the communication interface and at least one processor are interconnected through a line, and the one or more processors are used to call computer instructions so that the electronic device executes the method described in the first aspect or any possible implementation of the first aspect. Among them, the communication interface in the chip can be an input / output interface, a pin or a circuit, etc.

[0045] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (such as a read-only memory, a random access memory, etc.).

[0046] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect or any possible implementation of the first aspect.

[0047] In a seventh aspect, an embodiment of the present application provides a computer program product, which includes a computer program code. When the computer program code runs on an electronic device, the electronic device executes the method described in the first aspect or any possible implementation of the first aspect.

[0048] It should be understood that the second to seventh aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0050] Figure 2 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;

[0051] Figure 3 A flow chart of a log resource management method provided in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of generating a log quota provided in an embodiment of the present application;

[0053] Figure 5 A schematic diagram of a log resource management method provided in an embodiment of the present application;

[0054] Figure 6 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:

[0056] 1. Terminology

[0057] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0058] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0059] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.

[0060] Electronic devices can print logs during operation, which may include call information between functions, scheduling information of processes or threads, performance information of system operation, etc. Among them, performance information may include CPU load information, CPU usage, thread running status on the kernel and other information. Electronic devices can also upload logs to the server, and developers can locate and analyze problems based on the logs in the server. In some scenarios, the server can also be called a cloud server. For the sake of ease of description, the following explanation will be given using the cloud server as an example.

[0061] In some implementations, the cloud server can allocate fixed resources for uploading logs to the electronic device. Exemplarily, each electronic device can upload a preset number of logs to the cloud server within a period. The period can be pre-set by the cloud server or the electronic device, for example, the period can include one day or one week, etc. The specific period is not limited in the embodiments of the present application. It is understandable that when the number of logs uploaded by the electronic device exceeds the preset number, the logs cannot be uploaded any more.

[0062] However, due to the large differences in users' habits of using electronic devices, different electronic devices have different frequencies of performance freezes. For example, some users may not often clean up the background applications of electronic devices, or may often play games, watch videos, etc., in which case the electronic device may be more likely to be under high load, resulting in more frequent performance freezes. Some users may often clean up the background applications of electronic devices, or use some functions that reduce the load on electronic devices, etc., in which case the electronic device will have fewer performance freezes.

[0063] For electronic devices that frequently experience performance freezes, the number of uploaded logs can easily exceed the preset number, making it impossible to continue uploading newly generated logs. This results in insufficient log information for developers to locate the problem, making it difficult to accurately locate the cause of the problem.

[0064] For electronic devices that rarely have performance lag issues, the number of uploaded logs is unlikely to exceed the preset number, causing the cloud server to allocate more resources for uploading logs to such electronic devices.

[0065] In view of this, the log resource management method provided in the embodiment of the present application can consider the number of problem tickets provided by users, the number of collected logs, and the number of collected performance fault points, and use them as factors for allocating upload log resources. Exemplarily, for electronic devices that provide a large number of problem tickets, a large number of collected logs, and / or a large number of collected performance fault points, more resources for uploading logs can be allocated; for electronic devices that provide a small number of problem tickets, a small number of collected logs, and / or a small number of collected performance fault points, fewer resources for uploading logs can be allocated. In this way, for electronic devices that frequently have performance jams, more log information can be uploaded, which is convenient for developers to locate and analyze problems. For electronic devices that rarely have performance jams, less log information can be uploaded, thereby reasonably allocating resources for uploading logs.

[0066] It can be understood that the electronic device of the embodiment of the present application may include a cloud server or any form of terminal device. For example, the terminal device may include: a mobile phone, a tablet computer, a PDA, a laptop computer, a mobile Internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), and a wireless terminal in a smart city. The present invention may include a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a 5G network, or a terminal device in a public land mobile communication network (PLMN) to be evolved in the future, etc. The embodiments of the present application are not limited to this.

[0067] As an example but not limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.

[0068] In addition, in the embodiments of the present application, the electronic device may also be an electronic device in an Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.

[0069] The electronic device in the embodiments of the present application may also be referred to as: user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.

[0070] In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.

[0071] In the embodiment of the present application, the electronic device may include a first electronic device and a second electronic device.

[0072] The first electronic device may include an electronic device with strong computing power and / or strong storage capacity, for example, the first electronic device may include a cloud server, etc. For ease of description, the following description will be made by taking the first electronic device as a cloud server as an example.

[0073] The second electronic device may include an electronic device that is frequently operated by the user, for example, the second electronic device may include a mobile phone, a tablet, a watch, etc. The embodiment of the present application does not limit the specific first electronic device and the second electronic device. The following takes the second electronic device as an example to illustrate the hardware structure diagram and the software architecture diagram of the electronic device.

[0074] For example, Figure 1 A schematic diagram of the hardware structure of the second electronic device is shown.

[0075] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0076] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may include hardware, software, or a combination of software and hardware.

[0077] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.

[0078] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the above-mentioned memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system. For example, in an embodiment of the present application, the processor 110 may be used to process processes such as the collection of processing logs and the uploading of processing logs.

[0079] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0080] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function, etc. The data storage area may store data created during the use of the electronic device, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor. For example, in an embodiment of the present application, the internal memory 121 can be used to store logs, and can also be used to store relevant codes for log collection and log upload, etc.

[0081] Figure 2 A schematic diagram of the software architecture of the second electronic device of an embodiment of the present application is shown. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, the hardware abstraction layer (hardware adaptation layer, HAL), and the kernel layer.

[0082] The application layer can also be called the application layer, which can include a series of application packages. Figure 2As shown, the application package may include cloud-based parameter update service, desktop, camera and other applications. Applications may include system applications and third-party applications.

[0083] In the embodiment of the present application, the cloud-based parameter update service can be used to interact with the cloud push service of the cloud server to obtain data packets from the cloud server. The cloud-based parameter update service can also decompress the data packets to obtain relevant information such as log quotas.

[0084] The application framework layer can also be called the Framework layer. The Framework layer can provide application programming interface (API) and programming framework for the application layer applications. The Framework layer can include some predefined functions.

[0085] like Figure 2 As shown, the Framework layer may include an activity manager, a window manager, and a view manager, etc.

[0086] The activity manager can be responsible for the application's life cycle management, task stack management, process management, and permission management.

[0087] The window manager can be responsible for the management of window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc.

[0088] The view manager can be responsible for the application's interface drawing and event handling.

[0089] Android runtime includes core libraries and virtual machines. Android runtime is responsible for the control and management of the Android system.

[0090] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0091] The application layer and the framework layer run in a virtual machine. The virtual machine executes the java files of the application layer and the framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection. For example, in the embodiment of the present application, the virtual machine can be used to perform functions such as log collection and log upload control.

[0092] The system library can also be called the Native layer, which can include multiple functional modules. For example, the Native layer can include log collection services, log libraries, traffic control services, network libraries, and graphics libraries.

[0093] The log collection service can be used to collect logs generated during the operation of electronic devices, etc.

[0094] The log library can be used to save the logs collected by the log collection service.

[0095] Traffic control service can be used to determine whether the log quota is exceeded when the electronic device uploads logs to the cloud server. If the log quota is exceeded, the log cannot be uploaded; if the log quota is not exceeded, the log can be uploaded. Since electronic devices need to consume a certain amount of traffic data when uploading logs, in some scenarios, the control of the number of uploaded logs can also be understood as traffic control.

[0096] The network library can be used to process network requests and responses. The network library can provide APIs related to network processing and support functions such as synchronous and asynchronous network requests, file upload and download. For example, the network library can include the okhttp network framework.

[0097] The graphics library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing.

[0098] The hardware abstraction layer is an abstract structure between the kernel layer and the Android runtime. The hardware abstraction layer can be a package of hardware drivers, providing a unified interface for upper-layer applications to call.

[0099] The kernel layer is the layer between hardware and software. The kernel layer can include device drivers, file system drivers, binding drivers, etc.

[0100] It should be noted that the embodiments of the present application are only illustrated using the Android system as an example. In other operating systems (such as Windows system, IOS system, etc.), as long as the functions implemented by each functional module are similar to those in the embodiments of the present application, the solutions of the present application can also be implemented.

[0101] It is understandable that the first electronic device can interact with the cloud server.

[0102] In the embodiment of the present application, the cloud server may include a log reporting statistics service, a log quota calculation service, a cloud push service, and the like.

[0103] The log reporting statistics service can be used to count the number of problem tickets, the number of logs, and the number of performance fault points. Among them, since both the problem ticket and the log can reflect the performance of the electronic device to a certain extent, in the embodiment of the present application, the problem ticket can also be called a performance problem ticket, and the log can also be called a performance log. In addition, in some scenarios, the number of performance fault points can also be understood as the number of times the performance fault is triggered. For the convenience of unified description, the number of performance problem tickets and performance fault points will be used as an example for explanation.

[0104] The log reporting statistics service can also be used to process statistical data. For example, the log reporting statistics service can normalize the statistical data within a period to obtain the statistical data for a single day.

[0105] The log quota calculation service can allocate log resources based on the collected data and obtain the log quota of each electronic device. For example, the log quota calculation service can calculate the sensitivity data related to the log, calculate the weights corresponding to the performance problem ticket, performance log, and performance fault management points based on the sensitivity data, and calculate the log quota of different electronic devices based on the weights.

[0106] The cloud push service can be used to push log quota related data to electronic devices.

[0107] Figure 3 A flow chart of a log resource management method provided in an embodiment of the present application is shown.

[0108] As shown in the figure, the cloud server can include log reporting and statistics service, log quota calculation service and cloud push service. The functions implemented by the specific log reporting and statistics service, log quota calculation service and cloud push service can refer to the above Figure 2 The relevant descriptions in the corresponding embodiments are not repeated here.

[0109] The electronic device may include a cloud-based parameter update service and a traffic control service. The functions implemented by the specific cloud-based parameter update service and the traffic control service can refer to the above Figure 2 The relevant descriptions in the corresponding embodiments are not repeated here.

[0110] S301. The log reporting statistics service counts the statistical values ​​of three types of data.

[0111] The log reporting statistics service can count the number of performance problem tickets, performance logs, and performance fault points provided by each user within a period.

[0112] During the process of using an electronic device, if the electronic device freezes or has other problems, or the user has a poor experience using the electronic device, the user can actively provide a performance problem sheet to the cloud server through the electronic device. The performance problem sheet can be used to record problems that occur during the operation of the electronic device, and the performance problem sheet may include one or more of the following information: problem description, pictures related to the problem, frequency of problem occurrence, problem type or time when the problem occurs, etc. The content included in the specific performance problem sheet is not limited in the embodiments of this application.

[0113] In a possible implementation, after receiving an operation for submitting a performance problem sheet, the electronic device can call a related interface for uploading the problem sheet in response to the operation and upload the performance problem sheet to the cloud server. The cloud server can then collect the number of performance problem sheets provided by each user.

[0114] When an electronic device freezes, the system backend of the electronic device can report performance fault management events to the cloud server, and can also report performance logs to the cloud server. In this way, the cloud server can collect the number of performance fault management events and performance logs reported by each electronic device.

[0115] Among them, the performance fault management event can be used to record the freeze and other problems that occur in the electronic device. The performance fault management event may include one or more of the following information: freeze type, freeze time, freeze level or freeze module, etc. The content included in the specific performance fault management event is not limited in the embodiment of the application.

[0116] The performance log can be used to record the running status of the electronic device. The performance log may include one or more of the following information: call information between functions, scheduling information of processes or threads, kernel load information, kernel usage, running status of threads on the kernel, memory usage, disk usage or system temperature, etc. The content included in the specific performance log is not limited in the embodiments of the present application.

[0117] Exemplarily, a performance detection service may be run in the system background of the electronic device, and the performance detection service may detect the jamming time, jamming type, and jamming level of the jamming problem in the electronic device. Among them, the jamming type may include sliding jamming, animation jamming, frame loss jamming, cold start jamming, or hot start jamming. The electronic device may also classify the jamming into different levels according to the severity of the jamming. The specific classification of the jamming type and jamming level is not limited in the embodiments of the present application.

[0118] It is understandable that the number of performance logs and performance fault points reported by the electronic device to the cloud server are not necessarily the same. When the jamming in the electronic device reaches the lowest or lower jamming level, it can be considered that a performance fault has occurred, and the electronic device can report the performance fault point event to the cloud server. When the electronic device has a more obvious jamming, reaches a certain jamming level or meets a certain jamming type, the electronic device can report the performance log to the cloud server.

[0119] It can also be understood that not every time a performance fault management event is triggered, the electronic device will collect performance logs and report the performance logs to the cloud server. Instead, the performance log will be reported only when the jamming reaches a certain jamming level or meets a certain jamming type. In the embodiment of the present application, the number of collected performance failures can be understood as a macroscopic statistics of the performance jamming state of the electronic device, and the collection of performance logs requires that the jamming of the electronic device reaches a certain jamming level or meets a certain jamming type. Therefore, the number of collected performance logs can be less than or equal to the number of performance fault management events.

[0120] In a possible implementation, the duration of the above-mentioned cycle can be preset by the cloud server based on experience. Exemplarily, a cycle can adopt a fixed preset duration, for example, a cycle can be 3 days, 5 days or 7 days, etc.; or, a cycle can also include the update cycle of the system version of the electronic device, where different system versions can correspond to different update cycles, so the duration of a cycle can also be non-fixed. The specific duration of a cycle is not limited in the embodiments of this application.

[0121] The log reporting and statistics service can also normalize the statistical data within a period to obtain normalized statistical data. For example, the log reporting and statistics service can convert the statistical data within a period into the statistical results of a single day.

[0122] For example, assuming that a cycle is 7 days, after the log reporting statistics service counts the number of performance problem tickets, the number of performance logs, and the number of performance fault points in a cycle, each data can be divided by 7 to obtain the statistical data for a single day. In this way, by normalizing each data, the performance jam status of the electronic device over a period of time can be more accurately evaluated, making the allocation of log resources more reasonable.

[0123] S302: The log quota calculation service calculates the performance sensitivity ranking.

[0124] The log quota calculation service can calculate the performance sensitivity of each electronic device based on the normalized statistical data obtained by the log reporting statistics service.

[0125] Among them, the performance sensitivity of the electronic device can be positively correlated with the number of performance problem tickets, the number of performance logs, and the number of performance fault points. For example, when the number of performance logs and the number of performance fault points are constant, the more performance problem tickets there are, the higher the performance sensitivity of the electronic device is; when the number of performance problem tickets and the number of performance fault points are constant, the more performance logs there are, the higher the performance sensitivity of the electronic device is; when the number of performance problem tickets and the number of performance logs are constant, the more performance fault points there are, the higher the performance sensitivity of the electronic device is.

[0126] It can also be understood that the performance sensitivity of the electronic device may be positively correlated with the weighted sum of the number of performance problem tickets, the number of performance logs, and the number of performance fault points.

[0127] In possible implementations, Figure 4 A schematic diagram of calculating log quotas is shown, where the number of performance problem tickets, the number of performance logs, and the number of performance fault points can each correspond to a weight. For example, the number of performance problem tickets can correspond to weight A, the number of performance logs can correspond to weight B, and the number of performance fault points can correspond to weight C.

[0128] Among them, weight A, weight B and weight C can be preset by the cloud server based on experience. The values ​​of weight A, weight B and weight C can be the same or different. The specific values ​​of weight A, weight B and weight C are not limited in the embodiment of the present application.

[0129] It is understandable that in order to better improve the user experience, developers may pay more attention to the problem of more obvious jamming, and when the electronic device has more obvious jamming or the jamming reaches a certain level, the performance log will be reported. Therefore, the cloud server can set a relatively larger weight for the number of performance logs, so that the problem of more obvious jamming can be given priority and solved, thereby improving the user experience. For example, weight A can be 0.3, weight B can be 0.4, and weight C can be 0.3. The values ​​of weight A, weight B, and weight C can be modified for further optimization.

[0130] After the values ​​of weight A, weight B, and weight C are determined, the log quota calculation service can calculate the performance sensitivity of each electronic device based on the weights.

[0131] For example, i Performance sensitivity of electronic devices The following formula can be satisfied:

[0132] .

[0133] in, Param1 is the number of performance problem tickets after normalization. Param 2 is the number of normalized performance logs. Param 3 may be the number of performance fault points after normalization.

[0134] The log quota calculation service can also sort the performance sensitivity of each electronic device. For electronic devices with higher performance sensitivity, the log quota calculation service can set a larger log weight so that more resources for uploading logs can be allocated. For electronic devices with lower performance sensitivity, the log quota calculation service can set a smaller log weight so that fewer resources for uploading logs can be allocated. In this way, the cloud server can collect more useful performance logs, making it easier for developers to locate and solve problems based on performance logs.

[0135] In a possible implementation, after sorting the performance sensitivity of N electronic devices, the log quota calculation service can divide the N electronic devices into M groups. Wherein, N and M can both be positive integers greater than or equal to 1. After grouping the electronic devices, the log quota calculation service can also determine the performance sensitivity weight corresponding to each electronic device based on the grouping. .

[0136] For example, assuming that N is 100 and M is 5, and taking the performance sensitivity as an example, after sorting the 100 electronic devices by performance sensitivity, the log quota calculation service can divide the 100 electronic devices into 5 groups, each with 20 electronic devices. The first group may include electronic devices ranked from 1st to 20th in terms of performance sensitivity, the second group may include electronic devices ranked from 21st to 40th in terms of performance sensitivity, the third group may include electronic devices ranked from 41st to 60th in terms of performance sensitivity, the fourth group may include electronic devices ranked from 61st to 80th in terms of performance sensitivity, and the fifth group may include electronic devices ranked from 81st to 100th in terms of performance sensitivity.

[0137] Among them, the performance sensitivity weight corresponding to the first group is greater than the performance sensitivity weight corresponding to the second group, the performance sensitivity weight corresponding to the second group is greater than the performance sensitivity weight corresponding to the third group, the performance sensitivity weight corresponding to the third group is greater than the performance sensitivity weight corresponding to the fourth group, and the performance sensitivity weight corresponding to the fourth group is greater than the performance sensitivity weight corresponding to the fifth group. In this way, the performance sensitivity of electronic devices can be positively correlated with the weight. For electronic devices with higher performance sensitivity, more log upload resources can be allocated, which is conducive to the location and analysis of problems.

[0138] It can be understood that if the performance sensitivity is sorted in descending order, the performance sensitivity weight corresponding to the first group is less than the performance sensitivity weight corresponding to the second group, the performance sensitivity weight corresponding to the second group is less than the performance sensitivity weight corresponding to the third group, the performance sensitivity weight corresponding to the third group is less than the performance sensitivity weight corresponding to the fourth group, and the performance sensitivity weight corresponding to the fourth group is less than the performance sensitivity weight corresponding to the fifth group, so that the performance sensitivity of the electronic device is positively correlated with the weight. In this way, it can also meet the requirements that electronic devices with higher performance sensitivity can be allocated more resources for log upload.

[0139] S303: The log quota calculation service obtains the log quota weight of the previous period.

[0140] After determining the performance sensitivity weight corresponding to each electronic device, the log quota calculation service can calculate the log weight of each electronic device.

[0141] In one possible implementation, i Log weight of electronic devices wi Can be equal to the performance sensitivity weight corresponding to the electronic device .

[0142] Another possible implementation is Figure 4 As shown, the log quota calculation service can also obtain i The log weight of the last cycle of the electronic device is calculated based on the performance sensitivity weight and the log weight of the last cycle. i The log weight of the current cycle of each electronic device.

[0143] It is understandable that since the user's habits may not change significantly when using an electronic device, when calculating the log weight of the electronic device in the current cycle, the log weight of the electronic device in the previous cycle can be taken into consideration. In this way, the log weight of the previous cycle can be used as an empirical value for reference, thereby obtaining a more accurate and reasonable log weight.

[0144] For example, i The log weight of the current cycle of each electronic device wi The following formula can be satisfied:

[0145] .

[0146] in, For the previous cycle i The log weight of the electronic device in the previous cycle, D is i The log weight of the electronic device is the first in the current cycle. iThe weight D of the log weight of each electronic device. The weight D can be preset by the cloud server based on experience. For example, the weight D can include 0.5. The value of the subsequent weight D can also be modified for further optimization. The specific value of the weight D is not limited in the embodiment of the present application.

[0147] Optionally, the log quota calculation service can also be i Performance sensitivity weights corresponding to each electronic device Set the corresponding weight. The specific value of the weight can be set by the cloud server based on experience, and is not limited in the embodiment of the present application.

[0148] S304: The log quota calculation service calculates the log quota of the electronic device.

[0149] In one possible implementation, the log quota calculation service may allocate the same or different adjustable log quotas to each electronic device. L adjust The specific adjustable log quota obtained by each electronic device is not limited in the embodiment of the present application.

[0150] For example, i Log quota allocated to each electronic device Li The following formula can be satisfied:

[0151] .

[0152] As can be seen from the above formula, the log quota calculation service can sum the adjustable log quota of each electronic device to obtain a total adjustable log quota. The total adjustable log quota can be understood as a public resource pool, and each electronic device can obtain more or less log quota from the public resource pool based on the size of the log weight.

[0153] Another possible implementation is Figure 4 As shown, the log quota calculation service can allocate a log quota to each electronic device. L , the log quota L Can include basic log quota L basic and adjustable log quotas L adjust .

[0154] Each electronic device can have a certain basic log quota. L basic. For example, assume that the log quota calculation service allocates 12 log quotas to each electronic device every day, of which the basic log quota can be 4 and the adjustable log quota can be 8. In this way, a certain basic log quota is allocated to each electronic device, so that electronic devices with lower performance sensitivity can also get a certain log quota. If an electronic device with lower performance sensitivity fails, the developer can still locate and analyze the problem of the electronic device through the log information.

[0155] It is understandable that the log quota calculation service can allocate the same or different log quotas, the same or different basic log quotas, and the same or different adjustable log quotas to each electronic device. The specific log quota, basic log quota and adjustable log quota obtained by each electronic device are not limited in the embodiments of the present application.

[0156] In the possible implementation, i Log quota allocated to each electronic device Li The following formula can be satisfied:

[0157] .

[0158] As can be seen from the above formula, the log quota calculation service can sum the adjustable log quota of each electronic device to obtain a total adjustable log quota. The total adjustable log quota can be understood as a public resource pool, and each electronic device can obtain more or less log quota from the public resource pool based on the level of performance sensitivity.

[0159] For example, electronic devices with higher performance sensitivity can get more log quotas, and electronic devices with lower performance sensitivity can get less log quotas. In this way, under the premise that the total amount of log resources allocated by the cloud server to electronic devices remains unchanged and the pressure on the cloud server is not increased, the resources for log upload can be reasonably adjusted and allocated based on the different log weights, thereby improving the efficiency of log collection.

[0160] Optionally, the log quota calculation service can also make any possible changes to the above formula, for example, it can be used as the basic log quota L basic and adjustable log quotas L adjust Set the corresponding weights, where the basic log quota L basic Weights and adjustable log quotas L adjust The specific value of the weight can be set by the cloud server based on experience and is not limited in the embodiments of the present application.

[0161] S305: The log quota calculation service executes the configuration push service.

[0162] After calculating the log quota of each electronic device, the log quota calculation service can execute the configuration push service to instruct the cloud push service to push the log quota and other related information to the electronic device.

[0163] S306: The log reporting statistics service records the current log quota weight.

[0164] The log reporting and statistics service can also record the weight of the log quota of each electronic device in the cloud server. For example, the log reporting and statistics service can save the weight of the log quota of each electronic device in the database. In this way, when the log quota calculation service calculates the log quota of the next cycle, the previously recorded log quota can be obtained from the cloud server as reference data for calculating the log quota of the next cycle.

[0165] It is understandable that the execution of step S305 and step S306 may not distinguish the order of execution. That is, the cloud server may first execute step S305 and then execute step S306; or, the cloud server may first execute step S306 and then execute step S305; or, the cloud server may execute step S303 and step S306 at the same time, which is not limited in the embodiments of the present application.

[0166] S307, the cloud push service pushes to the electronic device.

[0167] After the cloud push service obtains the instruction message from the log quota calculation service, the cloud push service can push relevant information such as the log quota to each electronic device.

[0168] In a possible implementation, the log quota calculation service can configure the log quotas corresponding to the electronic devices in the same group into a configuration file according to the groups into which the electronic devices are divided. The cloud push service can push different configuration files according to the different groups to which the electronic devices belong.

[0169] Optionally, the log quota calculation service may not configure the log quota in the configuration file, but the cloud push service transmits the log quota identifier to each electronic device, and the log quota identifier can be used to indicate the log quota corresponding to the electronic device.

[0170] The cloud push service may use any possible method to push log quotas to each electronic device. The specific implementation method of delivering log quotas to electronic devices is not limited in the embodiments of the present application.

[0171] S308. The configuration file takes effect.

[0172] The cloud-based parameter update service can obtain data packets related to log quotas from the cloud server and decompress the data packets to obtain relevant information such as log quotas.

[0173] The traffic control service can control the number of logs uploaded by electronic devices to the cloud server based on the log quota in the configuration file, so that the configuration file can take effect. In this way, for electronic devices with higher performance sensitivity, more resources for uploading logs can be obtained, which is convenient for developers to locate and analyze problems. For electronic devices with lower performance sensitivity, fewer resources for uploading logs can be obtained, so as to reasonably allocate resources for uploading logs.

[0174] The following specific embodiments are used to describe the method of the present application in detail. The following embodiments may be combined with each other or implemented independently, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0175] Figure 5 The log resource management method of an embodiment of the present application is shown. The method is applied to a first electronic device, and the method includes:

[0176] S501. Receive log data from N electronic devices, where the N electronic devices include a second electronic device and a third electronic device, and N is an integer greater than 1.

[0177] In the embodiment of the present application, the first electronic device may include an electronic device with strong computing power and / or strong storage capacity, for example, the first electronic device may include a cloud server, etc. The embodiment of the present application does not limit the specific first electronic device.

[0178] The second electronic device and the third electronic device may include electronic devices that are frequently operated by the user, for example, the second electronic device may include a mobile phone, a tablet, a watch, etc. The embodiment of the present application does not limit the specific second electronic device and the third electronic device.

[0179] Log data may include information that developers can use to locate problems. For example, log data may include the following: Figure 3 The corresponding embodiments include performance problem sheets, performance logs, and performance fault management information. The specific log data may include more or less content, which is not limited in the embodiments of the present application.

[0180] Receiving log data from N electronic devices may include an electronic device reporting the log data of a first electronic device, or may include the first electronic device obtaining log data from an electronic device by calling an interface or the like. The specific manner of receiving log data is not limited in the embodiments of the present application.

[0181] S502. Determine a first value and a second value, wherein the first value is used to indicate the maximum number of logs uploaded by the second electronic device to the first electronic device, and the first value is positively correlated with the frequency of the second electronic device uploading log data to the first electronic device; the second value is used to indicate the maximum number of logs uploaded by the third electronic device to the first electronic device, and the second value is positively correlated with the frequency of the third electronic device uploading log data to the first electronic device, and the first value is different from the second value.

[0182] In the embodiment of the present application, the first value can be understood as the log quota of the second electronic device or the resource for uploading logs, and the second value can be understood as the log quota of the third electronic device or the resource for uploading logs. The log quota can include the number of uploaded logs, or the traffic for uploading logs, etc. The calculation method with log quota can refer to the above Figure 3 The relevant description in step S304 in the corresponding embodiment is not repeated here.

[0183] The frequency of uploading log data can be understood as the amount of uploaded log data. The more the amount of uploaded log data, the higher the frequency of uploading log data. The higher the frequency of uploading log data by the second electronic device, the larger the first value, which can also be understood as the amount of uploaded log data by the second electronic device. The higher the frequency of uploading log data by the third electronic device, the larger the second value, which can also be understood as the amount of uploaded log data by the third electronic device.

[0184] S503: Send the first value to the second electronic device.

[0185] In the embodiment of the present application, after calculating the first value, the first electronic device can send the first value to the second electronic device. The specific process of sending the first value to the second electronic device can refer to the above Figure 3 The relevant description in step S307 in the corresponding embodiment is not repeated here.

[0186] S504: Send the second value to the third electronic device.

[0187] In the embodiment of the present application, after calculating the second value, the first electronic device can send the second value to the third electronic device. Similarly, the specific process of sending the first value to the second electronic device can refer to the above Figure 3 The relevant description in step S307 in the corresponding embodiment is not repeated here.

[0188] The log resource management method provided in the embodiment of the present application can consider the number of problem tickets, the number of performance logs, and the number of performance fault points, and use them as factors for allocating upload log resources. Exemplarily, for electronic devices with a large number of problem tickets, a large number of performance logs, and / or a large number of performance fault points, more resources for uploading logs can be allocated; for electronic devices with a small number of problem tickets, a small number of performance logs, and / or a small number of performance fault points, fewer resources for uploading logs can be allocated. In this way, for electronic devices that frequently have performance jams, more log information can be uploaded, which is convenient for developers to locate and analyze problems. For electronic devices that rarely have performance jams, less log information can be uploaded, thereby reasonably allocating resources for uploading logs.

[0189] Optional, in Figure 5 On the basis of the corresponding embodiment, after receiving the log data from N electronic devices, it can also include: determining a first weight, the first weight is positively correlated with the ranking of the frequency of the second electronic device uploading log data to the first electronic device among the frequencies of the N electronic devices uploading log data to the first electronic device; determining the first value can include: determining the first value based on the first weight, the first weight and the first value are positively correlated.

[0190] In the embodiment of the present application, the first weight can be used to measure the log quota obtained by the electronic device. The first weight can include the above Figure 3 Corresponding to the log weight in the embodiment wi , specific log weight wi The calculation method can refer to Figure 3 The relevant description in step S303 in the corresponding embodiment is not repeated here.

[0191] Determining the first value based on the first weight may refer to Figure 3 The relevant description in step S304 in the corresponding embodiment is not repeated here.

[0192] When the first weight is large, the electronic device can be allocated more log quotas, which is conducive to the location and analysis of the problem; when the first weight is small, the electronic device can be allocated less log quotas. In this way, the cloud server can collect more useful performance logs, making it easier for developers to locate and solve problems based on performance logs.

[0193] Optional, in Figure 5 Based on the corresponding embodiment, the first weight and the first value satisfy the following formula:

[0194] .

[0195] in, wi is the first weight, Li is the first value, L adjust The first electronic device is the i The number of uploaded logs preset by each electronic device, i is an integer greater than or equal to 1, i Less than or equal to N.

[0196] In the embodiment of the present application, the calculation method of the first value can refer to Figure 3 The relevant description in step S304 in the corresponding embodiment is not repeated here.

[0197] The first electronic device can sum the adjustable log quotas of each electronic device to obtain a total adjustable log quota. The total adjustable log quota can be understood as a public resource pool, so that each electronic device can obtain more or less log quota from the public resource pool based on the size of the log weight.

[0198] Optional, in Figure 5 Based on the corresponding embodiment, the first weight and the first value satisfy the following formula:

[0199] .

[0200] in, wi is the first weight, Li is the first value, L adjust The first electronic device is the i The number of adjustable logs for each electronic device setting, L basic The first electronic device is the i The minimum number of uploaded logs set by each electronic device, i is an integer greater than or equal to 1, i Less than or equal to N.

[0201] In the embodiment of the present application, the calculation method of the first value can refer to Figure 3 The relevant description in step S304 in the corresponding embodiment is not repeated here.

[0202] The first electronic device can allocate a basic log quota and an adjustable log quota to each electronic device. The basic log quota allows each electronic device to obtain a certain log quota. For electronic devices that upload logs less frequently, when the electronic device fails, developers can still locate and analyze the problem of the electronic device through log information. In this way, under the premise that the total amount of log resources allocated by the cloud server to the electronic device remains unchanged and the pressure on the cloud server is not increased, the resources for log upload can be reasonably adjusted and allocated based on different log weights, thereby improving the efficiency of log collection.

[0203] Optional, in Figure 5 On the basis of the corresponding embodiment, sending a first value to a second electronic device may include: sending the first value to the second electronic device within the Lth period, where L is an integer greater than or equal to 1; after sending the first value to the second electronic device, it may also include: receiving log data from the second electronic device within the L+1th period; determining a third value, the third value is used to indicate the maximum number of logs uploaded by the second electronic device to the first electronic device, and the third value is positively correlated with the frequency of the second electronic device uploading log data to the first electronic device; and sending the third value to the second electronic device.

[0204] In the embodiment of the present application, the third value can be understood as the log quota of the second electronic device or the resource for uploading logs in the L+1th cycle. After calculating the third value, the first electronic device can send the third value to the second electronic device. The specific process of sending the third value to the second electronic device can refer to the above Figure 3 The relevant description in step S307 in the corresponding embodiment is not repeated here.

[0205] It is understandable that the first value and the third value may be the same or different. It is also understandable that the same electronic device may have the same or different log quotas in different cycles, which is not limited in the embodiments of the present application. In this way, the log quota of the second electronic device may be flexibly adjusted according to the number of logs uploaded by the second electronic device in different cycles, thereby making reasonable use of the memory resources of the first electronic device.

[0206] Optional, in Figure 5 On the basis of the corresponding embodiment, before determining the third value, it may also include: determining a third weight, the third weight is positively correlated with one or more of the following: the ranking of the frequency of the second electronic device uploading log data to the first electronic device among the frequencies of N electronic devices uploading log data to the first electronic device, and the first weight; determining the third value may include: determining the third value based on the third weight, the third weight and the third value are positively correlated.

[0207] In the embodiment of the present application, the third weight can be used to measure the log quota obtained by the electronic device. The third weight can include the above Figure 3 Corresponding to the log weight in the embodiment wi , specific log weight wi The calculation method can refer to Figure 3 The relevant description in step S303 in the corresponding embodiment is not repeated here.

[0208] Since the user's habits may not change significantly when using an electronic device, the first weight of the previous period may be taken into consideration when calculating the third weight. In this way, the log weight of the previous period may be used as an empirical value for reference, thereby obtaining a more accurate and reasonable log weight.

[0209] Optional, in Figure 5 Based on the corresponding embodiment, the third weight satisfies the following formula:

[0210] .

[0211] in, wi is the third weight, is a weight obtained based on the ranking of the frequency of the second electronic device uploading log data to the first electronic device among the frequencies of the N electronic devices uploading log data to the first electronic device, is the first weight, and D is the weight of the first weight in the L+1th cycle.

[0212] In the embodiment of the present application, the calculation method of the third weight can refer to the above Figure 3 The relevant description in step S303 in the corresponding embodiment is not repeated here.

[0213] When calculating the third weight, the first weight of the previous period may be considered in combination, so that the user's previous habits can be taken into account to obtain a more accurate and reasonable log weight.

[0214] Optional, in Figure 5 Based on the corresponding embodiments, the log data may include one or more of the following: problem ticket information, performance log information or fault management information; wherein, the problem ticket information is used to record problems occurring in the electronic device, and the problem ticket information may include one or more of the following information: problem description, pictures related to the problem, problem occurrence frequency or problem type; the performance log information is used to record the operating status of the electronic device, and the performance log information may include one or more of the following information: call information between functions, scheduling information of processes or threads, kernel load information, kernel usage rate or running status of threads on the kernel; the fault management information is used to record the freeze occurring in the electronic device, and the fault management information may include one or more of the following information: freeze type, freeze duration or freeze level.

[0215] In the embodiment of the present application, the specific description of the log data can refer to the above Figure 3 The relevant description in step S301 in the corresponding embodiment is not repeated here.

[0216] In this way, the first electronic device can count the number of problem tickets, the number of performance logs, and the number of fault points based on the log data uploaded by each electronic device, thereby calculating the log quota of each electronic device, making the allocation of log resources more reasonable.

[0217] Optional, in Figure 5 On the basis of the corresponding embodiment, the first electronic device includes a first service, a second service and a third service. After receiving log data from N electronic devices, it may also include: the first service counts a fourth value, a fifth value and a sixth value based on the log data of the second electronic device, the fourth value includes the number of problem tickets, the fifth value includes the number of logs, and the sixth value includes the number of fault points; before determining the first value, it may also include: the second service determines the ranking of the second electronic device among the N electronic devices, and the ranking is positively correlated with one or more of the following: the fourth value, the fifth value or the sixth value; the second service determines the first weight; determining the first value may include: the second service determines the first value based on the first weight, and the first weight is positively correlated with the first value; sending the first value to the second electronic device may include: the third service sends the first value to the second electronic device.

[0218] In the embodiment of the present application, the first service can be understood as a service for counting the number of problem tickets, the number of performance logs, and the number of fault points. The first service can also be understood as a service for normalizing the statistical data. For example, the first service may include the above Figure 3 The log reporting statistics service in the corresponding embodiment.

[0219] The second service can be understood as a service that allocates log resources based on the data collected by the first service to obtain log quotas for each electronic device. For example, the second service may include the above Figure 3 The log quota calculation service in the corresponding embodiment.

[0220] The third service can be understood as a service for pushing the relevant data of the log quota to each electronic device. For example, the third service may include the above Figure 3 The cloud push service in the corresponding embodiment.

[0221] The fourth value, the fifth value, and the sixth value of the first service based on the log data of the second electronic device can refer to the above Figure 3 The relevant description in step S301 of the corresponding embodiment is not repeated here.

[0222] The ranking of the second electronic device among the N electronic devices may include a ranking obtained by ranking by performance sensitivity. The specific second service determines the ranking of the second electronic device among the N electronic devices by referring to the above Figure 3 The relevant description in step S302 of the corresponding embodiment is not repeated here.

[0223] The second service may determine the first value based on the first weight by referring to the above Figure 3 The relevant description in step S304 of the corresponding embodiment is not repeated here.

[0224] The third service may send the first value to the second electronic device by referring to the above Figure 3 The relevant description in step S307 of the corresponding embodiment is not repeated here.

[0225] In the embodiment of the present application, for electronic devices with high performance sensitivity, the log quota calculation service can set a larger log weight, so that more resources for uploading logs can be allocated. For electronic devices with low performance sensitivity, the log quota calculation service can set a smaller log weight, so that fewer resources for uploading logs can be allocated. In this way, the cloud server can collect more useful performance logs, which makes it easier for developers to locate and solve problems based on performance logs.

[0226] Optional, in Figure 5 On the basis of the corresponding embodiment, the first service saves the weight value of the previous cycle. Before the second service determines the first weight, it can also include: the second service obtains the weight value of the previous cycle from the first service; the second service determines the first weight, which can include: the second service determines the first weight based on the ranking and the weight value of the previous cycle.

[0227] In the embodiment of the present application, the second service obtains the weight value of the previous cycle from the first service by referring to the above Figure 3 The relevant description in step S303 of the corresponding embodiment is not repeated here.

[0228] The first service can record the weight of the log quota of each electronic device. When the second service calculates the log quota of the next cycle, it can obtain the weight of the log quota recorded last time from the first service as reference data for calculating the log quota of the next cycle. In this way, the log weight of the previous cycle can be used as an empirical value for reference, thereby obtaining a more accurate and reasonable log weight.

[0229] Optional, in Figure 5 Based on the corresponding embodiment, the second electronic device includes a fourth service and a fifth service. The fourth service is used to receive a first value from the first electronic device and transmit the first value to the fifth service; the fifth service is used to determine whether the second electronic device is allowed to upload logs to the first electronic device based on the first value. If the number of logs uploaded by the second electronic device to the first electronic device is less than the first value, the second electronic device is allowed to upload logs to the first electronic device; or, if the number of logs uploaded by the second electronic device to the first electronic device is equal to the first value, the second electronic device is not allowed to upload logs to the first electronic device.

[0230] In the embodiment of the present application, the fourth service can be understood as a service for receiving a first value from a first electronic device and transmitting the first value to a fifth service. The fourth service can also be used to interact with a cloud server and obtain a data packet service. The fourth service can be used to decompress the data packet to obtain relevant information such as log quotas. For example, the fourth service may include the above Figure 3 The cloud-based parameter update service in the corresponding embodiment.

[0231] The fifth service can be understood as a service for determining whether to allow the second electronic device to upload a log to the first electronic device based on the first value. For example, the fifth service may include the above Figure 3 The traffic control service in the corresponding embodiment.

[0232] The specific execution process of the fourth service and the fifth service can refer to the above Figure 3 The relevant description in step S308 of the corresponding embodiment is not repeated here.

[0233] For electronic devices that upload more logs, more resources for uploading logs can be obtained, which is convenient for developers to locate and analyze problems. For electronic devices that upload fewer logs, fewer resources for uploading logs can be obtained, so that the resources for uploading logs can be reasonably allocated, which is convenient for developers to locate and analyze problems.

[0234] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0235] It is understandable that in the embodiments of the present application, logs can be collected during the testing phase of the electronic device. For electronic devices that have been released, user logs may not be collected, which can better protect user information. Of course, for electronic devices that have been released, if the user agrees that the electronic device collects logs and allows developers to locate and analyze problems, logs can also be collected, and the embodiments of the present application are not limited thereto.

[0236] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0237] The embodiment of the present application can divide the functional modules of the device implementing the method according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0238] like Figure 6 FIG. 6 is a schematic diagram of a chip structure provided by an embodiment of the present application. The chip 600 includes one or more (including two) processors 601 , a communication line 602 , a communication interface 603 and a memory 604 .

[0239] In some implementations, the memory 604 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.

[0240] The method described in the above embodiment of the present application can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 601 or an instruction in the form of software. The above processor 601 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 601 can implement or execute the methods, steps and logic block diagrams related to each processing disclosed in the embodiment of the present application.

[0241] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 604, and the processor 601 reads the information in the memory 604 and completes the steps of the above method in combination with its hardware.

[0242] The processor 601 , the memory 604 , and the communication interface 603 may communicate with each other via the communication line 602 .

[0243] In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory, or may be downloaded and installed in the memory in the form of software.

[0244] The embodiment of the present application also provides a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium may include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0245] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.

[0246] As a possible design, the computer readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while discs reproduce data optically using lasers.

[0247] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

Claims

1. A log resource management method, characterized in that: The method is applied to a first electronic device, and the method includes: Receiving log data from N electronic devices, where the N electronic devices include a second electronic device and a third electronic device, and N is an integer greater than 1; Determine a first value and a second value, wherein the first value is used to indicate the maximum value of the number of logs uploaded by the second electronic device to the first electronic device, and the first value is positively correlated with the frequency of the second electronic device uploading log data to the first electronic device, and the second value is used to indicate the maximum value of the number of logs uploaded by the third electronic device to the first electronic device, and the second value is positively correlated with the frequency of the third electronic device uploading log data to the first electronic device, and the first value is different from the second value; sending the first value to the second electronic device; sending the second value to the third electronic device; After receiving the log data from the N electronic devices, the method further includes: Determine a first weight, where the first weight is positively correlated with a ranking of a frequency of the second electronic device uploading log data to the first electronic device among frequencies of the N electronic devices uploading log data to the first electronic device; The determining of the first value comprises: determining the first value based on the first weight, the first weight being positively correlated with the first value; The first weight and the first value satisfy the following formula: or, Among them, w i is the first weight, L i is the first value, L adjust is the number of adjustable logs set by the first electronic device for the i-th electronic device, L basic is the minimum value of the number of upload logs set by the first electronic device for the i-th electronic device, i is an integer greater than or equal to 1, i is less than or equal to N, j is an integer greater than or equal to 1, j is less than or equal to N.

2. The method according to claim 1, characterized in that Sending the first value to the second electronic device includes: In an Lth period, sending the first value to the second electronic device, where L is an integer greater than or equal to 1; After sending the first value to the second electronic device, the method further includes: In the L+1th cycle, receiving log data from the second electronic device; Determine a third value, where the third value is used to indicate a maximum value of the number of logs uploaded by the second electronic device to the first electronic device, and the third value is positively correlated with a frequency of the second electronic device uploading log data to the first electronic device; The third value is sent to the second electronic device.

3. The method according to claim 2, characterized in that Before determining the third value, the method further includes: Determine a third weight, where the third weight is positively correlated with one or more of the following: a ranking of a frequency of the second electronic device uploading log data to the first electronic device among frequencies of the N electronic devices uploading log data to the first electronic device, and the first weight; The determining of the third value comprises: The third value is determined based on the third weight, and the third weight and the third value are positively correlated.

4. The method according to claim 3, characterized in that The third weight satisfies the following formula: Among them, w L+1 is the third weight, is a weight obtained based on the ranking of the frequency of the second electronic device uploading log data to the first electronic device among the frequencies of the N electronic devices uploading log data to the first electronic device, and w i is the first weight, and D is the weight of the first weight in the L+1th cycle.

5. The method according to claim 1, characterized in that The log data includes one or more of the following: problem ticket information, performance log information or fault management information; The problem ticket information is used to record the problem that occurs in the electronic device, and the problem ticket information includes one or more of the following information: a description of the problem, pictures related to the problem, the frequency of the problem, or the type of the problem; The performance log information is used to record the running status of the electronic device, and the performance log information includes one or more of the following information: calling information between functions, scheduling information of processes or threads, load information of kernels, usage rate of kernels or running status of threads on kernels; The fault marking information is used to record the jamming that occurs in the electronic device, and the fault marking information includes one or more of the following information: jamming type, jamming time or jamming level.

6. The method according to claim 1, characterized in that The first electronic device includes a first service, a second service and a third service. After receiving the log data from the N electronic devices, the method further includes: The first service counts a fourth value, a fifth value, and a sixth value based on the log data of the second electronic device, wherein the fourth value includes the number of problem tickets, the fifth value includes the number of logs, and the sixth value includes the number of fault points; Before determining the first value, the method further includes: The second service determines a ranking of the second electronic device among the N electronic devices, the ranking being positively correlated with one or more of: the fourth value, the fifth value, or the sixth value; The second service determines the first weight; The determining of the first value comprises: The second service determines the first value based on the first weight, and the first weight is positively correlated with the first value; Sending the first value to the second electronic device includes: The third service sends the first value to the second electronic device.

7. The method according to claim 6, characterized in that The first service stores a weight value of a previous period, and before the second service determines the first weight, the method further includes: The second service obtains the weight value of the previous period from the first service; The second service determines the first weight, including: The second service determines the first weight based on the ranking and the weight value of the previous period.

8. The method according to claim 1, characterized in that: The second electronic device includes a fourth service and a fifth service, the fourth service being configured to receive the first value from the first electronic device and to transmit the first value to the fifth service; The fifth service is used to determine whether the second electronic device is allowed to upload logs to the first electronic device based on the first value. If the number of logs uploaded by the second electronic device to the first electronic device is less than the first value, the second electronic device is allowed to upload logs to the first electronic device; or, if the number of logs uploaded by the second electronic device to the first electronic device is equal to the first value, the second electronic device is not allowed to upload logs to the first electronic device.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method according to any one of claims 1 to 8.

10. A communication system, characterized in that: The communication system comprises: a first electronic device and a second electronic device, wherein the first electronic device is used to execute the method according to any one of claims 1 to 8; The second electronic device is used to upload log data to the first electronic device, the second electronic device is also used to receive a first value from the first electronic device, and the second electronic device is also used to determine whether to allow the second electronic device to upload logs to the first electronic device based on the first value.

11. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1-8.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.

13. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is run on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 8.