Resource library issuing method and device, server and storage medium
By obtaining target device feature information on the server side, using a version decision model to determine and distribute the appropriate resource library version, the problem of poor compatibility caused by changes in device features is solved, and the reliability of device operation is improved.
Patent Information
- Application Number
- CN202511719838.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-03-03
AI Technical Summary
In existing technologies, changes in equipment characteristics can prevent the resource library from being updated, resulting in poor equipment compatibility and affecting the reliability of equipment operation.
By obtaining the characteristic information of the target device on the server side, the appropriate resource library version is determined using a trained version decision model, and dynamically distributed to the device to avoid the problem of insufficient resource library updates.
This improves the operational reliability of the equipment, ensures that the resource library matches the equipment characteristics, and avoids compatibility issues caused by changes in equipment characteristics.
Smart Images

Figure CN121597247A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of resource processing technology, and in particular to a method, apparatus, server, and storage medium for distributing resource databases. Background Technology
[0002] Currently, to meet the functional requirements of equipment, a hard-coded rule matching mechanism is typically used during the equipment manufacturing stage to directly burn the resource library into the corresponding device's memory. However, after the equipment enters the market, if the device characteristics (such as the device's operating system version, hardware configuration, etc.) change, the resource library already burned into the device cannot be updated, which can easily lead to device incompatibility issues, causing the device to malfunction and severely restricting its operational reliability. Summary of the Invention
[0003] This application provides a method, apparatus, server, and storage medium for distributing resource libraries, in order to solve the problem in the prior art where poor device compatibility is caused by changes in device characteristics that prevent the resource library from being updated, thus affecting the operational reliability of the device.
[0004] Firstly, this application provides a method for distributing a resource repository, applied to a server, the method comprising: When it is necessary to send a resource library to a target device, obtain the target feature information corresponding to the target device, and the target feature information is used to indicate the device feature information of the target device; Based on the target feature information and the trained version decision model, the target resource library version corresponding to the target feature information is determined. The version decision model is trained using a historical distribution information set. The historical distribution information in the historical distribution information set is used to indicate the correspondence between the historical feature information corresponding to the historical device and the historical distribution result. The historical distribution result is the result of distributing the historical resource library corresponding to the historical resource library version to the historical device under the historical feature information. The target resource library corresponding to the target resource library version is distributed to the target device.
[0005] In an optional implementation, determining the target resource library version corresponding to the target feature information based on the target feature information and the trained version decision model includes: The target feature information is input into the version decision model; The system receives the candidate resource library version set corresponding to the target feature information output by the version decision model and the target probability corresponding to each candidate resource library version in the candidate resource library version set. The target probability is used to characterize the probability that the target device is compatible with the resource library corresponding to the candidate resource library version. The highest target probability is determined from all the obtained target probabilities, and the candidate resource library version with the highest target probability is determined as the target resource library version corresponding to the target feature information.
[0006] In an optional implementation, the version decision model is a decision tree model, which includes multiple leaf nodes, each leaf node corresponding to the historical feature information, each leaf node corresponding to a candidate resource library version set, and each candidate resource library version in the candidate resource library version set corresponding to a historical distribution result set. The candidate resource library version set corresponding to the target feature information is determined in the following way: Based on the target feature information and the historical feature information corresponding to the multiple leaf nodes included in the decision tree model, the target leaf node corresponding to the target feature information is determined from the multiple leaf nodes included in the decision tree model; The candidate resource library version set corresponding to the target leaf node is determined as the candidate resource library version set corresponding to the target feature information; The target probability corresponding to each candidate resource repository version in the candidate resource repository version set is determined in the following way: For each candidate resource library version in the candidate resource library version set, based on the historical distribution result set corresponding to the candidate resource library version, determine the first number of all historical distribution results in the historical distribution result set, and determine the second number of all historical distribution results in the historical distribution set that were successfully distributed; Based on the first number and the second number, the target probability corresponding to the candidate resource library version is determined.
[0007] In an optional implementation, the step of distributing the target resource library corresponding to the target resource library version to the target device includes: Obtain the preset waiting time and the first request rate corresponding to the server. The preset waiting time is used to characterize the maximum waiting time allowed for the target resource library corresponding to the target resource library version to be sent to the target device. The first request rate is used to characterize the number of all requests sent to the server per unit time. Based on the preset waiting time and the first request rate, determine the target bandwidth required to send the target resource library corresponding to the target resource library version to the target device; Based on the target bandwidth, the target resource library corresponding to the target resource library version is distributed to the target device.
[0008] In an optional implementation, the step of distributing the target resource library corresponding to the target resource library version to the target device based on the target bandwidth includes: Determine the target comparison result between the first request rate and the first preset bandwidth, wherein the first preset bandwidth is equal to the product of the target bandwidth and a preset coefficient, and the preset coefficient is less than 1; When the target comparison result includes the first request rate being greater than the first preset bandwidth, the target number of target threads to be created is determined. Create the target threads corresponding to the specified number of targets; Based on the target bandwidth, the target resource library corresponding to the target resource library version is distributed to the target device using all the target threads created.
[0009] In an optional implementation, determining the target number of target threads to be created includes: Obtain the second preset bandwidth of the target thread to be created, the second preset bandwidth being used to characterize the maximum allowed bandwidth of the target thread; Based on the target bandwidth and the second preset bandwidth, determine the target number of the target threads to be created.
[0010] In an optional implementation, the step of distributing the target resource library corresponding to the target resource library version to the target device includes: The target resource library corresponding to the target resource library version is compressed using a preset compression algorithm to obtain the compressed target resource library; The compressed target resource library is then distributed to the target device.
[0011] Secondly, this application provides a resource repository distribution device, applied to a server, the device comprising: The acquisition module is used to acquire target feature information corresponding to the target device when it is necessary to send a resource library to the target device. The target feature information is used to indicate the device feature information of the target device. The determination module is used to determine the target resource library version corresponding to the target feature information based on the target feature information and the version decision model that has been trained. The version decision model is obtained by training using a historical distribution information set. The historical distribution information in the historical distribution information set is used to indicate the correspondence between the historical feature information corresponding to the historical device and the historical distribution result. The historical distribution result is the result of distributing the historical resource library corresponding to the historical resource library version to the historical device under the historical feature information. The distribution module is used to distribute the target resource library corresponding to the target resource library version to the target device.
[0012] Thirdly, this application provides a server, including a processor and a memory, wherein the processor is used to execute a resource library distribution program stored in the memory to implement the resource library distribution method described above.
[0013] Fourthly, this application provides a storage medium storing one or more programs that can be executed by one or more processors to implement the resource library distribution method described above.
[0014] Compared with the prior art, the technical solution provided in this application has the following advantages. The resource library distribution method provided in this application is applied to the server. The method includes: when a resource library needs to be distributed to a target device, obtaining target feature information corresponding to the target device, the target feature information being used to indicate the device feature information of the target device; determining the target resource library version corresponding to the target feature information based on the target feature information and a version decision model that has been trained, the version decision model being trained using a historical distribution information set, the historical distribution information in the historical distribution information set being used to indicate the correspondence between the historical feature information corresponding to the historical device and the historical distribution result, the historical distribution result being the result of distributing the historical resource library corresponding to the historical resource library version under the historical feature information; and distributing the target resource library corresponding to the target resource library version to the target device. Through the above methods, this application obtains a version decision model in advance based on historical distribution information to determine the resource library version compatible with the device. Thus, when a resource library needs to be distributed to a target device, the application obtains the target feature information corresponding to the target device, and determines the target resource library version compatible with the target device based on the target feature information and the version decision model. This allows the target resource library corresponding to the target resource library version to be distributed to the target device, avoiding the problem of poor device compatibility caused by the inability to update the resource library due to changes in device features, and improving the operational reliability of the device. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0018] Figure 1 A flowchart illustrating a method for distributing a resource library as provided in an embodiment of this application; Figure 2 A flowchart illustrating another method for distributing a resource library, provided as an embodiment of this application; Figure 3 A schematic diagram of a resource library distribution device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a server provided in an embodiment of this application; In the attached diagrams above: 10. Obtain module; 20. Confirm module; 30. Issue module; 400. Server; 401. Processor; 402. Memory; 4021. Operating system; 4022. Application program; 403. User interface; 404. Network interface; 405. Bus system. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0021] refer to Figure 1 , Figure 1 This is a flowchart illustrating a method for distributing a resource repository according to an embodiment of this application. The method for distributing a resource repository according to an embodiment of this application includes the following steps: S101: When it is necessary to send a resource library to the target device, obtain the target feature information corresponding to the target device.
[0022] In this embodiment, the above method is applied to the server side. The target device is the device that receives and uses the resource library sent by the server. The target device can be an IoT terminal device, industrial control device, or smart terminal device, etc., and the specific form of the target device can be selected according to actual needs. The resource library can be understood as the collection of all resources loaded and used by the target device to achieve the corresponding functions. Target feature information is used to describe the device feature information of the target device. The target feature information includes the chip architecture of the target device, the system version of the target device, and the memory capacity of the target device. The target feature information is unique to the target device and can be continuously updated during the operation of the target device. When the target feature information is updated, the resource library already burned into the target device cannot be updated, which can easily lead to poor compatibility issues. Therefore, in order to avoid the above problems, this embodiment dynamically sends the resource library to the target device through the server, so that when the target feature information is updated, the adapted resource library can be sent to the target device, ensuring the reliable operation of the target device. The above-mentioned target feature information can be obtained by the server through interaction with the target device.
[0023] In the above process, when the server detects an update to the device characteristics of the target device, it determines that the server needs to send a resource library to the target device. At this time, step S101, which involves obtaining the target characteristic information corresponding to the target device, is executed. Alternatively, a sending cycle can be preset so that when the sending cycle is reached, it is determined that a resource library needs to be sent to the target device, and step S101, which involves obtaining the target characteristic information corresponding to the target device, is executed.
[0024] S102: Based on the target feature information and the version decision model that has been trained, determine the target resource library version corresponding to the target feature information.
[0025] In this embodiment, the version decision model is trained using a historical distribution information set. This historical distribution information indicates the correspondence between the historical feature information of the historical device and the historical distribution results. The historical distribution result is the result of distributing the historical resource library corresponding to the historical resource library version to the historical device under the historical feature information. The historical device can refer to the target device described above, and the historical feature information can refer to the target feature information described above. The distribution result includes successful distribution and failed distribution. Successful distribution indicates that after the historical resource library corresponding to the historical resource library version is distributed to the historical device, the historical device can successfully use the distributed historical resource library. Failed distribution indicates that after the historical resource library corresponding to the historical resource library version is distributed to the historical device, the historical device cannot successfully use the distributed historical resource library.
[0026] After obtaining the target feature information, this information can be input into a pre-trained version decision model. The version decision model then determines the target repository version corresponding to the target feature information and outputs the target repository version. The determination of the target repository version corresponding to the target feature information through the version decision model will be described in detail below, but will not be elaborated upon in this embodiment.
[0027] In the above, the version decision model is actually a decision tree model, which can be trained in the following way: Retrieve historical information sets; Based on the preset splitting criteria and all historical feature information in the historical distribution information, feature splitting is performed starting from the root node to obtain leaf nodes, and all historical resource library versions corresponding to the historical feature information under the leaf nodes and all historical distribution results corresponding to each historical resource library version are associated with the obtained leaf nodes. Based on all the leaf nodes and their corresponding association information, a decision tree model is constructed.
[0028] Specifically, the preset splitting criteria can be the information gain splitting criterion or the Gini impurity splitting criterion. The node splitting is performed based on the characteristics that best distinguish the compatibility of different resource libraries. In this embodiment, the first-layer nodes are split according to the chip structure, the second layer according to the system version, and the third layer according to the memory capacity. Since leaf nodes are obtained by splitting features, each leaf node corresponds to historical feature information. Therefore, after obtaining the leaf nodes, based on the historical feature information corresponding to the leaf nodes, all historical resource library versions corresponding to that historical feature information and all historical distribution results corresponding to each historical resource library version can be determined from the historical distribution information. These determined historical resource library versions and all historical distribution results corresponding to each historical resource library version are then associated with the leaf nodes to facilitate the subsequent determination of the resource library corresponding to the resource library version adapted to the device, thereby ensuring the operational reliability of the device.
[0029] It should be noted that feature splitting based on preset splitting criteria can refer to existing technologies, which will not be elaborated here. After constructing the decision tree model, after determining the leaf node corresponding to a certain historical feature information, all historical resource library versions corresponding to that leaf node are determined as the candidate resource library version set, and all historical distribution results corresponding to each candidate resource library version in the candidate resource library version set are determined as the historical distribution result set.
[0030] S103: Distribute the target resource library corresponding to the target resource library version to the target device.
[0031] In this embodiment, the server stores a first association relationship, which stores multiple sets of correspondences between resource library versions and resource library download addresses. After determining the target resource library version, the server can query the first association relationship based on the target resource library version to obtain the download address of the target resource library. The server can then access the download address of the target resource library to download the target resource library corresponding to the target version. After obtaining the target resource library, it is directly sent to the target device, so that the target device, upon receiving the target resource library, stores it in a preset storage path, thereby completing the dynamic sending of the resource library from the server to the target device.
[0032] Specifically, after the target resource library is sent to the target device, for each resource library stored on the server, the usage information corresponding to the resource library is obtained. The usage information includes the third number of all devices using the resource library, the fourth number of all resource libraries sent within the preset time period, and the fifth number of all fault information of the resource library reported within the preset time period. Based on the third, fourth, and fifth numbers, determine the target score corresponding to the resource library; Based on the obtained target score, the resource library and the first association are processed to obtain an updated first association, and the above S101 step is performed based on the updated first association.
[0033] The preset time period can be set according to time requirements, for example, the preset time period is one week before the current time. In this embodiment, the preset time period is not limited. After obtaining the usage information corresponding to the resource library, a weighted sum can be determined based on the first preset weight corresponding to the third number, the second preset weight corresponding to the fourth number, and the third preset weight corresponding to the fifth number to obtain the target score of the resource library. When the target score is less than the first score threshold, it indicates that the resource library has been deprecated. Therefore, in order to reduce storage pressure, the resource library is deleted, and the correspondence between the download address of the resource library and the resource library version is removed from the first association relationship to obtain an updated first association relationship. When the target score is greater than or equal to the first score threshold, it indicates that the resource library is being used by different devices. Therefore, there is no need to process the resource library and the first association relationship, and the process can return to step S201. The first preset weight, the second preset weight, and the third preset weight can be set according to actual needs. In this embodiment, the specific values of the first preset weight, the second preset weight, and the third preset weight are not limited.
[0034] This embodiment provides a method for distributing resource libraries. By pre-training a version decision model based on historical distribution information, a resource library version compatible with the device is determined. When a resource library needs to be distributed to a target device, the target feature information corresponding to the target device is obtained. Based on the target feature information and the version decision model, a target resource library version compatible with the target device is determined, and the target resource library corresponding to the target resource library version is distributed to the target device. This avoids the problem of poor device compatibility caused by the inability to update the resource library due to changes in device features, and improves the operational reliability of the device.
[0035] refer to Figure 2 , Figure 2 This is a flowchart illustrating another method for distributing a resource library according to an embodiment of this application. The method for distributing a resource library according to an embodiment of this application includes the following steps: S201: When it is necessary to send a resource library to the target device, obtain the target feature information corresponding to the target device.
[0036] In this embodiment, step S201 is the same as step S101 described above. For details, please refer to step S101 described above. In this embodiment, it will not be repeated here.
[0037] S202: Input the target feature information into the version decision model.
[0038] S203: Receive the candidate resource library version set corresponding to the target feature information output by the version decision model, and the target probability corresponding to each candidate resource library version in the candidate resource library version set.
[0039] S204: Determine the highest target probability from all obtained target probabilities, and determine the candidate resource library version with the highest target probability as the target resource library version corresponding to the target feature information.
[0040] Regarding steps S202 to S204 above, the candidate resource library version set includes at least one candidate resource library version. All candidate resource library versions in this set can be understood as resources that the target device may be compatible with. The target probability characterizes the probability that the target device is compatible with the resource library corresponding to the candidate resource library version. The higher the target probability, the higher the compatibility. This target probability can be determined based on the aforementioned historical information.
[0041] After obtaining the target feature information, it can be input into the version decision model. Upon receiving the target feature information, the version decision model determines a set of candidate resource library versions that may be compatible with the target feature information, and determines the target probability for each candidate resource library version in the determined set. All the obtained target probabilities are compared to determine the highest target probability. The candidate resource library version corresponding to the highest target probability is actually the resource library version most compatible with the target feature information. Therefore, the candidate resource library version with the highest target probability is determined as the target resource library version corresponding to the target feature information. Based on this target resource library version, the target resource library corresponding to the target resource library version can be distributed to the target device, ensuring good compatibility with the target resource library and guaranteeing the reliability of the target device's operation.
[0042] For example, if the target feature information includes ARM chip architecture, Linux 5.15 system version, and 4GB memory capacity, and this target feature information is input into the version decision model, the version decision model determines that the candidate resource library version set corresponding to the target feature information includes candidate resource library version V2, candidate resource library version V3, and candidate resource library version V4. The target probability corresponding to candidate resource library version V2 is 70%, the target probability corresponding to candidate resource library version V3 is 90%, and the target probability corresponding to candidate resource library version V4 is 60%. Therefore, the highest target probability is 90%, so candidate resource library version V3 is determined as the target resource library version corresponding to the target feature information. In this way, this embodiment inputs the obtained target feature information into the version decision model so that the version decision model can determine all candidate resource library versions that are compatible with the target feature information and the target probability corresponding to each candidate resource library version. Based on all the obtained target probabilities, the most suitable target resource library version is determined, so that the target device has high compatibility with the target resource library corresponding to the target resource library version, ensuring the operational reliability of the target device.
[0043] In this embodiment, the version decision model is a decision tree model, which includes multiple leaf nodes. Each leaf node corresponds to historical feature information, and each leaf node corresponds to a candidate resource library version set. Each candidate resource library version in the candidate resource library version set corresponds to a historical distribution result set.
[0044] The training process of the decision tree model can be referred to the above description, and will not be further elaborated here. Each leaf node in the decision tree model is obtained by feature splitting based on historical feature information, so each leaf node corresponds to historical feature information. After obtaining each leaf node, for each leaf node, based on the historical feature information corresponding to the leaf node, all historical resource library versions corresponding to the historical feature information in the historical distribution information set are determined as the candidate resource library version set corresponding to the leaf node, and all historical distribution results corresponding to the candidate resource library versions in the historical distribution information set and the candidate resource library version set are determined as the historical distribution result set corresponding to the candidate resource library version.
[0045] The candidate resource library version set corresponding to the target feature information mentioned above is determined in the following way: Based on the target feature information and the historical feature information corresponding to the multiple leaf nodes included in the decision tree model, the target leaf point corresponding to the target feature information is determined from the multiple leaf nodes included in the decision tree model. The candidate resource library version set corresponding to the target leaf node is determined as the candidate resource library version set corresponding to the target feature information.
[0046] In this embodiment, after the decision tree model receives the target feature information, it performs feature splitting according to feature importance. Based on the historical feature information corresponding to multiple leaf nodes included in the decision tree model, it determines the leaf node corresponding to the historical feature information consistent with the target feature information from the multiple leaf nodes included in the decision tree model, and identifies the determined leaf node as the target leaf node. Thus, the candidate resource library version set corresponding to the target leaf node is determined as the candidate resource library version set corresponding to the target feature information. Through the above method, this embodiment provides a method for determining the candidate resource library version set corresponding to target feature information. Based on the target feature information and the decision tree model, it determines the candidate resource library version set that may be suitable for the target feature information. Based on the candidate resource library version set, it determines the target resource library version that is most suitable for the target feature information, ensuring high compatibility of the target device using the target resource library version and guaranteeing the operational reliability of the target device.
[0047] The target probability corresponding to each candidate repository version in the candidate repository version set above is determined in the following way: For each candidate resource library version in the candidate resource library version set, based on the historical distribution result set corresponding to the candidate resource library version, determine the first number of all historical distribution results in the historical distribution result set, and determine the second number of all historical distribution results in the historical distribution set that have been determined to be successfully distributed. Based on the first and second numbers, determine the target probability corresponding to the candidate resource library version.
[0048] In this embodiment, the first number is actually the total number of all historical delivery results included in the historical delivery result set, and the second number is actually the total number of all historical delivery results in the historical delivery result set that were successfully delivered. After obtaining the first and second numbers, the ratio between the second and first numbers is determined as the target probability corresponding to the candidate resource library version. Successful delivery can be referred to the above description, and will not be further elaborated in this embodiment. The target probability mentioned above can be expressed by the following formula:
[0049] In the above formula, This represents the target probability corresponding to the i-th candidate repository version in the candidate repository version set. This represents the second number corresponding to the i-th candidate repository version. This represents the first number corresponding to the i-th candidate repository version.
[0050] Through the above methods, this embodiment provides a method for determining the target probability. After determining the set of candidate resource library versions that may be compatible with the target feature information, the target probability corresponding to each candidate resource library version in the candidate resource library version set is determined. By using all the obtained target probabilities, the target resource library version that is most compatible with the target feature information is determined from the candidate resource library version set. This ensures that the target device has high compatibility when using the target resource library corresponding to the target resource library version, and guarantees the operational reliability of the target device.
[0051] S205: Distribute the target resource library corresponding to the target resource library version to the target device.
[0052] In one implementation, step S205, which involves sending the target resource library corresponding to the target resource library version to the target device, specifically includes: Get the server's preset waiting time and first request rate; Based on the preset waiting time and the first request rate, determine the target bandwidth required to send the target resource library corresponding to the target resource library version to the target device; Based on the target bandwidth, the target resource library corresponding to the target resource library version is distributed to the target device.
[0053] The preset waiting time represents the maximum allowed waiting time for the target resource library version to be sent to the target device. Setting the preset waiting time avoids transmission congestion in high-concurrency scenarios when sending the target resource library version. The preset waiting time can be set according to actual needs; this embodiment does not impose a specific limitation. The first request rate represents the number of all requests sent to the server per unit time, reflecting the current network concurrency pressure. The target bandwidth represents the network bandwidth required to send the target resource library version.
[0054] Specifically, to address the issue of high latency in high-concurrency scenarios caused by fixed-bandwidth transmission of the target resource library version, a method is proposed that obtains the server's preset waiting time and first request rate. Based on these parameters, the target bandwidth required for the server to distribute the target resource library version is dynamically determined, and the target resource library is then distributed to the target device according to the target bandwidth. The relationship between the target bandwidth, target waiting time, and first request rate can be expressed by the following formula:
[0055] In the above formula, Indicates the preset waiting time. Indicates the first request rate. Indicates the target bandwidth.
[0056] Through the above methods, this embodiment provides a way to determine the target bandwidth. By setting a preset waiting time and a first request rate, the target bandwidth required for the target resource library corresponding to the target resource library version is dynamically determined. Based on the target bandwidth, the target resource library corresponding to the target resource library version is delivered, avoiding the problem of large latency in high-concurrency scenarios caused by using fixed bandwidth to transmit the target resource library corresponding to the target resource library version, and improving the transmission efficiency in high-concurrency scenarios.
[0057] In the above, based on the target bandwidth, the target resource library version corresponding to the target resource library is distributed to the target device, specifically including: Determine the target comparison result between the first request rate and the first preset bandwidth; When the target comparison result includes a first request rate greater than a first preset bandwidth, determine the target number of target threads to be created; Create target threads corresponding to the number of targets; Based on the target bandwidth, the target resource library corresponding to the target resource library version is distributed to the target device using all the target threads created.
[0058] Specifically, the first preset bandwidth is equal to the product of the target bandwidth and a preset coefficient, where the preset coefficient is less than 1. In this embodiment, the preset coefficient is 1 / 2. To address the issue of insufficient processing capacity of a single thread in high-concurrency scenarios, after obtaining the target bandwidth, the first request rate is compared with the first preset bandwidth. If the first request rate is less than or equal to the first preset bandwidth, it indicates that the request rate does not exceed the single-threaded capacity. In this case, the target resource library corresponding to the target resource library version can be directly sent to the target device using the existing thread based on the determined target bandwidth. If the first request rate is greater than the first preset bandwidth, it indicates that the request volume far exceeds the single-threaded capacity. If the target resource library corresponding to the target resource library version is sent to the target device using the existing thread based on the determined target bandwidth, it will cause congestion and affect transmission efficiency. Therefore, when the first request rate is greater than the first preset bandwidth, the target number of target threads to be created is determined, and target threads corresponding to the target number are created. Thus, based on the target bandwidth, all created target threads are used to send the target resource library corresponding to the target resource library version to the target device, avoiding congestion during transmission. In this embodiment, by comparing the first request rate with the first preset bandwidth, it is determined whether the distribution of the target resource library using the original thread will cause congestion. If congestion occurs, the target number of target threads to be created is determined, thereby creating target threads corresponding to the target number. Based on the target bandwidth, all created target threads are used to complete the distribution of the target resource library, avoiding congestion and improving transmission efficiency in high-concurrency scenarios.
[0059] The above determination of the target number of target threads to be created specifically includes: Obtain the second preset bandwidth for the target thread to be created; Based on the target bandwidth and the second preset bandwidth, determine the target number of target threads to be created.
[0060] The second preset bandwidth is used to characterize the maximum bandwidth allowed for the target threads. In this embodiment, when determining the target number of target threads to be created, in order to avoid inaccurate determination of the target number leading to resource waste or congestion, after obtaining the target bandwidth, the ratio between the target bandwidth and the second preset bandwidth is determined. This ratio is used as the target number of target threads to be created, thereby creating target threads corresponding to the target number. This ensures that the number of target threads created matches the demand, reduces resource waste, and avoids congestion.
[0061] In another implementation, step S205 involves sending the target resource library corresponding to the target resource library version to the target device, specifically including: The target resource library corresponding to the target resource library version is compressed using a preset compression algorithm to obtain the compressed target resource library; The compressed target resource library is distributed to the target device.
[0062] In the above, the preset compression algorithm can be selected according to actual needs. For example, the preset compression algorithm can be the Huffman compression algorithm. This embodiment does not specifically limit the preset compression algorithm. When the target resource library corresponding to the target resource library version is sent to the target device, the preset compression algorithm can be used to compress the target resource library corresponding to the target resource library version to obtain a compressed target resource library. The compressed target resource library is then sent to the target device to reduce the resource size of the resource library, thereby reducing bandwidth usage and improving transmission efficiency. It should be noted that when sending the compressed target resource library to the target device, the target bandwidth required for sending the compressed target resource library can be determined based on the above method of determining the target bandwidth. Based on the determined target bandwidth, the compressed target resource library is then sent to the target device.
[0063] This embodiment provides a method for distributing resource libraries. By pre-training a version decision model based on historical distribution information, a resource library version compatible with the device is determined. When a resource library needs to be distributed to a target device, the target feature information corresponding to the target device is obtained. Based on the target feature information and the version decision model, a target resource library version compatible with the target device is determined, and the target resource library corresponding to the target resource library version is distributed to the target device. This avoids the problem of poor device compatibility caused by the inability to update the resource library due to changes in device features, and improves the operational reliability of the device.
[0064] refer to Figure 3 , Figure 3 This is a schematic diagram of a resource library distribution device provided in an embodiment of this application. The resource library distribution device provided in this embodiment is applied to a server and includes an acquisition module 10, a determination module 20, and a distribution module 30. The acquisition module 10 is used to acquire target feature information corresponding to the target device when a resource library needs to be distributed to a target device. The target feature information indicates the device feature information of the target device. The determination module 20 is used to determine the target resource library version corresponding to the target feature information based on the target feature information and a trained version decision model. The version decision model is trained using a historical distribution information set, where the historical distribution information indicates the correspondence between historical feature information corresponding to historical devices and historical distribution results. The historical distribution result is the result of distributing the historical resource library corresponding to the historical resource library version to the historical device under the historical feature information. The distribution module 30 is used to distribute the target resource library corresponding to the target resource library version to the target device.
[0065] In this embodiment, the determining module 20 is further configured to: The target feature information is input into the version decision model; The system receives the candidate resource library version set corresponding to the target feature information output by the version decision model and the target probability corresponding to each candidate resource library version in the candidate resource library version set. The target probability is used to characterize the probability that the target device is compatible with the resource library corresponding to the candidate resource library version. The highest target probability is determined from all the obtained target probabilities, and the candidate resource library version with the highest target probability is determined as the target resource library version corresponding to the target feature information.
[0066] In this embodiment, the version decision model is a decision tree model, which includes multiple leaf nodes. Each leaf node corresponds to the historical feature information, and each leaf node corresponds to a candidate resource library version set. Each candidate resource library version in the candidate resource library version set corresponds to a historical distribution result set.
[0067] In this embodiment, the determining module 20 is further configured to: Based on the target feature information and the historical feature information corresponding to the multiple leaf nodes included in the decision tree model, the target leaf node corresponding to the target feature information is determined from the multiple leaf nodes included in the decision tree model; The candidate resource library version set corresponding to the target leaf node is determined as the candidate resource library version set corresponding to the target feature information.
[0068] In this embodiment, the determining module 20 is further configured to: For each candidate resource library version in the candidate resource library version set, based on the historical distribution result set corresponding to the candidate resource library version, determine the first number of all historical distribution results in the historical distribution result set, and determine the second number of all historical distribution results in the historical distribution set that were successfully distributed; Based on the first number and the second number, the target probability corresponding to the candidate resource library version is determined.
[0069] In this embodiment, the sending module 30 is further configured to: Obtain the preset waiting time and the first request rate corresponding to the server. The preset waiting time is used to characterize the maximum waiting time allowed for the target resource library corresponding to the target resource library version to be sent to the target device. The first request rate is used to characterize the number of all requests sent to the server per unit time. Based on the preset waiting time and the first request rate, determine the target bandwidth required to send the target resource library corresponding to the target resource library version to the target device; Based on the target bandwidth, the target resource library corresponding to the target resource library version is distributed to the target device.
[0070] In this embodiment, the sending module 30 is further configured to: Determine the target comparison result between the first request rate and the first preset bandwidth, wherein the first preset bandwidth is equal to the product of the target bandwidth and a preset coefficient, and the preset coefficient is less than 1; When the target comparison result includes the first request rate being greater than the first preset bandwidth, the target number of target threads to be created is determined. Create the target threads corresponding to the specified number of targets; Based on the target bandwidth, the target resource library corresponding to the target resource library version is distributed to the target device using all the target threads created.
[0071] In this embodiment, the sending module 30 is further configured to: Determining the target number of target threads to be created includes: Obtain the second preset bandwidth of the target thread to be created, the second preset bandwidth being used to characterize the maximum allowed bandwidth of the target thread; Based on the target bandwidth and the second preset bandwidth, determine the target number of the target threads to be created.
[0072] This embodiment provides a resource library distribution device that pre-trains a version decision model based on historical distribution information to determine the resource library version compatible with the device. When a resource library needs to be distributed to a target device, the device obtains target feature information corresponding to the target device, and determines a target resource library version compatible with the target device based on the target feature information and the version decision model. This allows the target resource library corresponding to the target resource library version to be distributed to the target device, avoiding the problem of poor device compatibility caused by changes in device features preventing resource library updates, and improving the operational reliability of the device.
[0073] Figure 4 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Figure 4The server 400 shown includes: at least one processor 401, memory 402, at least one network interface 404, and other user interfaces 403. The various components in the server 400 are coupled together via a bus system 405. It is understood that the bus system 405 is used to implement communication between these components. In addition to a data bus, the bus system 405 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 4 The general designated all buses as Bus System 405.
[0074] The user interface 403 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0075] It is understood that the memory 402 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0076] In some implementations, memory 402 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 4021 and application program 4022.
[0077] The operating system 4021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 4022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 4022.
[0078] In this embodiment of the invention, the processor 401 executes the method steps provided in each method embodiment by calling the program or instructions stored in the memory 402, specifically the program or instructions stored in the application program 4022.
[0079] The methods disclosed in the above embodiments of the present invention can be applied to processor 401, or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 401 or by instructions in the form of software. The processor 401 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 402. Processor 401 reads the information in memory 402 and, in conjunction with its hardware, completes the steps of the above method.
[0080] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0081] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0082] The server provided in this embodiment can be as follows: Figure 4 The server shown can execute as follows: Figure 1 and Figure 2 All steps of the distribution method of the resource repository, thereby achieving... Figure 1 and Figure 2 For details on the technical effectiveness of the resource repository distribution method shown, please refer to [link / reference]. Figure 1 and Figure 2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0083] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; it may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and it may also include combinations of the above types of memory.
[0084] When one or more programs in the storage medium can be executed by one or more processors to implement the resource library distribution method described above, which is executed on the resource library distribution device side.
[0085] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0086] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0087] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for distributing a resource repository, characterized in that, Applied to the server side, the method includes: When it is necessary to send a resource library to a target device, obtain the target feature information corresponding to the target device, and the target feature information is used to indicate the device feature information of the target device; Based on the target feature information and the trained version decision model, the target resource library version corresponding to the target feature information is determined. The version decision model is trained using a historical distribution information set. The historical distribution information in the historical distribution information set is used to indicate the correspondence between the historical feature information corresponding to the historical device and the historical distribution result. The historical distribution result is the result of distributing the historical resource library corresponding to the historical resource library version to the historical device under the historical feature information. The target resource library corresponding to the target resource library version is distributed to the target device.
2. The method according to claim 1, characterized in that, The step of determining the target resource library version corresponding to the target feature information based on the target feature information and the trained version decision model includes: The target feature information is input into the version decision model; The system receives the candidate resource library version set corresponding to the target feature information output by the version decision model and the target probability corresponding to each candidate resource library version in the candidate resource library version set. The target probability is used to characterize the probability that the target device is compatible with the resource library corresponding to the candidate resource library version. The highest target probability is determined from all the obtained target probabilities, and the candidate resource library version with the highest target probability is determined as the target resource library version corresponding to the target feature information.
3. The method according to claim 2, characterized in that, The version decision model is a decision tree model, which includes multiple leaf nodes. Each leaf node corresponds to the historical feature information, and each leaf node corresponds to a candidate resource library version set. Each candidate resource library version in the candidate resource library version set corresponds to a historical distribution result set. The candidate resource library version set corresponding to the target feature information is determined in the following way: Based on the target feature information and the historical feature information corresponding to the multiple leaf nodes included in the decision tree model, the target leaf node corresponding to the target feature information is determined from the multiple leaf nodes included in the decision tree model; The candidate resource library version set corresponding to the target leaf node is determined as the candidate resource library version set corresponding to the target feature information; The target probability corresponding to each candidate resource repository version in the candidate resource repository version set is determined in the following way: For each candidate resource library version in the candidate resource library version set, based on the historical distribution result set corresponding to the candidate resource library version, determine the first number of all historical distribution results in the historical distribution result set, and determine the second number of all historical distribution results in the historical distribution set that were successfully distributed; Based on the first number and the second number, the target probability corresponding to the candidate resource library version is determined.
4. The method according to claim 1, characterized in that, The step of distributing the target resource library corresponding to the target resource library version to the target device includes: Obtain the preset waiting time and the first request rate corresponding to the server. The preset waiting time is used to characterize the maximum waiting time allowed for the target resource library corresponding to the target resource library version to be sent to the target device. The first request rate is used to characterize the number of all requests sent to the server per unit time. Based on the preset waiting time and the first request rate, determine the target bandwidth required to send the target resource library corresponding to the target resource library version to the target device; Based on the target bandwidth, the target resource library corresponding to the target resource library version is distributed to the target device.
5. The method according to claim 4, characterized in that, The step of distributing the target resource library corresponding to the target resource library version to the target device based on the target bandwidth includes: Determine the target comparison result between the first request rate and the first preset bandwidth, wherein the first preset bandwidth is equal to the product of the target bandwidth and a preset coefficient, and the preset coefficient is less than 1; When the target comparison result includes the first request rate being greater than the first preset bandwidth, the target number of target threads to be created is determined. Create the target threads corresponding to the specified target number; Based on the target bandwidth, the target resource library corresponding to the target resource library version is distributed to the target device using all the target threads created.
6. The method according to claim 5, characterized in that, Determining the target number of target threads to be created includes: Obtain the second preset bandwidth of the target thread to be created, the second preset bandwidth being used to characterize the maximum allowed bandwidth of the target thread; Based on the target bandwidth and the second preset bandwidth, determine the target number of the target threads to be created.
7. The method according to claim 1, characterized in that, The step of distributing the target resource library corresponding to the target resource library version to the target device includes: The target resource library corresponding to the target resource library version is compressed using a preset compression algorithm to obtain the compressed target resource library; The compressed target resource library is then distributed to the target device.
8. A resource database distribution device, characterized in that, The device, applied to the server side, includes: The acquisition module is used to acquire target feature information corresponding to the target device when it is necessary to send a resource library to the target device. The target feature information is used to indicate the device feature information of the target device. The determination module is used to determine the target resource library version corresponding to the target feature information based on the target feature information and the version decision model that has been trained. The version decision model is obtained by training using a historical distribution information set. The historical distribution information in the historical distribution information set is used to indicate the correspondence between the historical feature information corresponding to the historical device and the historical distribution result. The historical distribution result is the result of distributing the historical resource library corresponding to the historical resource library version to the historical device under the historical feature information. The distribution module is used to distribute the target resource library corresponding to the target resource library version to the target device.
9. A server-side component, characterized in that, include: A processor and a memory, the processor being configured to execute a resource library distribution program stored in the memory to implement the resource library distribution method according to any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the resource library distribution method according to any one of claims 1 to 7.