Certificate generation rate adjusting method and device, processor and electronic equipment

In the deep learning inference service, the generation rate is dynamically adjusted based on the license and encoding time of the target database, which solves the problem of inefficient text encoding caused by excessive request data or too fast frequency of client, and achieves more efficient text encoding processing.

CN120050043APending Publication Date: 2025-05-27INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202412000544.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In the deep learning inference service deployed locally, the client sends too much or the frequency is too fast, resulting in the text encoding service being unable to process in time, resulting in data accumulation, the return content timeout is discarded by the client, and may even lead to the text encoding service process crash and data loss, thereby reducing the text encoding efficiency.

Method used

Responsive to the initialization of the target encoding system, an encoding request is received, and the permission information of the target encoding system to the target text is determined based on the current license in the target database. Record the encoding time of the target encoding system encoding the target text, and adjust the generation rate of the current license based on the encoding time to obtain the target generation rate.

Benefits of technology

By dynamically adjusting the license generation rate, ensuring the encoding progress of the target text, avoiding the return content timeout being abandoned by the client, and the text encoding service process crashes and data loss, improving the efficiency of text encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050043A_ABST
    Figure CN120050043A_ABST
Patent Text Reader

Abstract

The invention discloses a certificate generation rate adjusting method and device, a processor and electronic equipment, and relates to the field of resource scheduling. The method comprises the steps that in response to the fact that a target coding system completes initialization, a coding request is received, and the coding request is used for requesting the target coding system to code a target text; in response to the coding request, determining permission information of the target coding system to the target text based on a current license in a target database; in response to the permission information representing that the target coding system has the permission of coding the target text, recording the coding duration of coding the target text by the target coding system; and adjusting the current generation rate of the current license based on the coding duration to obtain the target generation rate of the current license. Through the text coding method and device, the technical problem of low text coding efficiency is solved, and the technical effect of improving the text coding efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of resource scheduling, and in particular to a rate adjustment method, device, processor and electronic device for generating a certificate. Background Art

[0002] In the locally deployed deep learning inference service, if the client sends a large amount of request data or the frequency is too fast, the text encoding service will not be able to process it in time, and the data will accumulate in the waiting queue. If the data accumulates, on the one hand, the returned content will time out and be abandoned by the client, and on the other hand, the text encoding service process may crash and data may be lost due to the long queue, resulting in low efficiency of text encoding.

[0003] Currently, no effective solution has been proposed to the above-mentioned technical problem of low efficiency of text encoding. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, processor and electronic device for adjusting the rate of certificate generation, so as to at least solve the technical problem of low efficiency of text encoding.

[0005] According to one aspect of an embodiment of the present invention, a method for adjusting the rate of certificate generation is provided, the method comprising: in response to a target coding system having completed initialization, receiving an encoding request, wherein the encoding request is used to request the target coding system to encode a target text; in response to the encoding request, determining the target coding system's permission information for the target text based on a current license certificate in a target database, wherein the permission information is used to indicate whether the target coding system has the permission to encode the target text, and the current license certificate is used to indicate a token to be allocated to the target text in the target database; in response to the permission information indicating that the target coding system has the permission to encode the target text, recording the encoding time for the target coding system to encode the target text; based on the encoding time, adjusting the current generation rate of the current license certificate to obtain a target generation rate of the current license certificate.

[0006] Optionally, in response to the encoding request, based on the current license certificate in the target database, the target encoding system's permission information for the target text is determined, including: in response to the encoding request, determining a first quantity of the current license certificate; and determining the permission information based on the first quantity.

[0007] Optionally, based on the first quantity, determine the permission information, including: in response to the first quantity being greater than the quantity threshold, determine the permission information; in response to the first quantity being less than or equal to the quantity threshold, wait for the license certificate to be filled in the target database; after the license certificate has been filled in the target database, determine the second quantity of the license certificate; in response to the second quantity being greater than the quantity threshold, determine the permission information, where the generation time of the license certificate is later than the generation time of the current license certificate.

[0008] Optionally, in response to the first quantity being greater than the quantity threshold, determine the permission information, including: in response to the first quantity being greater than the quantity threshold, assign the current license certificate to the target text; in response to the target text having the current license certificate, determine that the permission information indicates that the target coding system has the permission to encode the target text.

[0009] Optionally, in response to the second quantity being greater than the quantity threshold, determine the permission information, including: in response to the second quantity being greater than the quantity threshold, assign the license certificate to the target text; in response to the target text having the license certificate, determine that the permission information indicates that the target coding system has the permission to encode the target text.

[0010] Optionally, based on the encoding duration, adjust the current generation rate of the current license certificate to obtain the target generation rate of the current license certificate, including: determine the encoding duration as the average delay duration of the target coding system; determine the duration difference between the average delay duration and the target delay duration; based on the duration difference, adjust the current generation rate to obtain the target generation rate.

[0011] Optionally, based on the duration difference, adjust the current generation rate to obtain the target generation rate, including: obtain the integral term and the differential term corresponding to the duration difference, where the integral term is obtained by integrating the duration difference, and the differential term is obtained by differentiating the duration difference; determine the first weight of the duration difference, the second weight of the integral term, and the third weight of the differential term, where the first weight is used to control the proportion of the duration difference in the duration difference, the integral term, and the differential term, the second weight is used to control the proportion of the integral term in the duration difference, the integral term, and the differential term, and the third weight is used to control the proportion of the differential term in the duration difference, the integral term, and the differential term; use the first weight, the second weight, and the third weight to fuse the duration difference, the integral term, and the differential term to obtain the adjustment parameter; use the adjustment parameter to adjust the current generation rate to obtain the target generation rate.

[0012] According to one aspect of the embodiments of the present invention, a rate adjustment device for certificate generation is provided. The device may include: a receiving unit, configured to receive an encoding request in response to the completion of initialization of a target encoding system, where the encoding request is used to request the target encoding system to encode a target text; a determining unit, configured to determine, in response to the encoding request, permission information of the target encoding system for the target text based on a current license certificate in a target database, where the permission information is used to indicate whether the target encoding system has the permission to encode the target text, and the current license certificate is used to represent a token to be allocated to the target text in the target database; a recording unit, configured to record the encoding duration of the target encoding system for the target text in response to the permission information indicating that the target encoding system has the permission to encode the target text; and an adjusting unit, configured to adjust the current generation rate of the current license certificate based on the encoding duration to obtain a target generation rate of the current license certificate.

[0013] According to another aspect of the embodiments of the present invention, a processor is further provided. The processor is configured to run a program, where when the program is run by the processor, the steps of the rate adjustment method for certificate generation in the embodiments of the present invention are executed.

[0014] According to another aspect of the embodiments of the present invention, an electronic device is further provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps of the rate adjustment method for certificate generation in various embodiments of the present invention.

[0015] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored program, where when the program runs, it controls the device where the computer-readable storage medium is located to execute the steps of the rate adjustment method for certificate generation in the embodiments of the present invention.

[0016] According to another aspect of the embodiments of the present invention, a computer program product is further provided. The computer program product includes a computer program, where when the computer program is executed by a processor, the steps of the rate adjustment method for certificate generation in the embodiments of the present invention are implemented.

[0017] According to another aspect of the embodiments of the present invention, a computer program product is further provided, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the steps of the rate adjustment method for certificate generation in the embodiments of the present invention are implemented.

[0018] According to another aspect of the embodiments of the present invention, an embodiment of the present application further provides a computer program. When the computer program is executed by a processor, the steps of the rate adjustment method for certificate generation in the above embodiments of the present invention are implemented.

[0019] In an embodiment of the present invention, in the case where text needs to be encoded, in response to the target encoding system having completed initialization, an encoding request can be received. In the case of receiving the above-mentioned encoding request, according to the current license certificate in the target database, it can be determined whether the target encoding system has the permission to encode the target text. In the case of determining that the target encoding system has the permission to encode the target text, according to the recorded encoding duration of the target encoding system for encoding the target text, by adjusting the current generation rate of the current license certificate, the target generation rate of the current license certificate can be obtained. Since the present application uses the encoding duration of the target encoding system for encoding the target text to dynamically adjust the current generation rate of the current license certificate, the encoding progress of the target text can be guaranteed, thereby achieving the purpose of avoiding the returned content being discarded by the client due to timeout, as well as the text encoding service process crashing and data loss, thus solving the technical problem of low efficiency of text encoding, and further achieving the technical effect of improving the efficiency of text encoding. Brief Description of the Drawings

[0020] The drawings described herein are used to provide a further understanding of the present invention, and constitute a part of this application. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0021] Figure 1 is a hardware structure block diagram of a terminal device for implementing a method for adjusting the rate of certificate generation according to an embodiment of the present application;

[0022] Figure 2 is a flowchart of a method for adjusting the rate of certificate generation according to an embodiment of the present invention;

[0023] Figure 3(a) is a schematic diagram of a device for dynamically adjusting and monitoring concurrent access of a deep learning inference service based on discrete PID control and token bucket according to an embodiment of the present invention;

[0024] Figure 3(b) is a flowchart of a method for dynamically adjusting and monitoring concurrent access of a deep learning inference service based on discrete PID control and token bucket according to an embodiment of the present invention;

[0025] Figure 4 is a schematic diagram of a device for adjusting the rate of certificate generation according to an embodiment of the present invention. Detailed Description of the Embodiments

[0026] The embodiments of the present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0027] It should be noted that the terms "first", "second", etc. in the description, claims, and the above-mentioned drawings of this application are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence.

[0028] The method embodiments provided in the embodiments of this application can be executed on a terminal device or a similar computing device. Taking the operation on a terminal device as an example, Figure 1 is a hardware structure block diagram of a terminal device for implementing a rate adjustment method for certificate generation in the embodiments of this application. As Figure 1 shown, the terminal device may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microcontroller unit (abbreviated as MCU) or a field-programmable gate array (abbreviated as FPGA)) and a memory 104 for storing data. Among them, the above-mentioned terminal device may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned terminal device. For example, the terminal device may further include more or fewer components than those shown in Figure 1 the figure, or have a different configuration from that shown in Figure 1 the figure.

[0029] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the resource operation method of the virtual machine in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the terminal device through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and their combinations.

[0030] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of a terminal device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] Under the above operating environment, this application provides a method for running resources of a virtual machine as shown in Figure 2 the following. Figure 2 It is a flowchart of a rate adjustment method for certificate generation according to an embodiment of the present invention. The method may include the following steps:

[0032] Step S201, in response to the target coding system having completed initialization, receive a coding request.

[0033] In the technical solution provided in step S201 of the present invention above, the above-mentioned coding request can be used to request the target coding system to encode the target text. Among them, the above-mentioned target text can be obtained by performing block processing on the initial text and encoding the block-processed initial text, and the above-mentioned target text can be presented in the form of a vector.

[0034] In this embodiment, in response to the target coding system having completed initialization, receive a coding request. Optionally, in this embodiment, when the initialization information configuration of the target coding system is completed, monitor the request sent to the target coding system, and a monitoring result can be obtained. The monitoring result can be used to indicate whether the above-mentioned request is a coding request. If the obtained monitoring result indicates that the above-mentioned request is a coding request, then receive the coding request.

[0035] Optionally, if the obtained monitoring result indicates that the above-mentioned request is not a coding request, continue to monitor the request sent to the target coding system until the obtained monitoring result indicates that the request is a coding request, and then receive the coding request.

[0036] It should be noted that the above initialization information may include: the capacity (pool_size) of the thread pool of the target encoding system, the initial generation rate (initial_rate) of the current license certificate, the lower limit of the generation rate (min_rate), the upper limit of the generation rate (max_rate), the target latency (target_latency) of the target encoding system, and the capacity of the container, etc. Among them, the lower limit and the upper limit of the generation rate can be used to control the current generation rate of the current license certificate, the target latency can be used to evaluate the average latency of the target encoding system, and the container can be used to store the current license certificate. For example, if the current license certificate is a token, the container can be a token bucket, and the capacity of the container can be the capacity of the token bucket (bucket_size). This is only an example here and is not specifically limited.

[0037] Step S202, in response to an encoding request, based on the current license certificate in the target database, determine the permission information of the target encoding system for the target text.

[0038] In the technical solution provided in step S202 of the present invention above, the above permission information can be used to indicate whether the target encoding system has the permission to encode the target text. The above current license certificate can be used to represent the token to be allocated to the target text in the target database.

[0039] In this embodiment, the above target database may include a container for storing the current license certificate. For example, the container can be a token bucket.

[0040] In this embodiment, after responding to the initialization of the target encoding system and receiving the encoding request, in response to the encoding request, based on the current license certificate in the target database, determine the permission information of the target encoding system for the target text. Optionally, based on receiving the above encoding request, in the target database, according to the number of current license certificates, it can be determined whether to allocate the current license certificate to the target text. According to the status of allocating the current license certificate to the target text, the permission information of the target encoding system for the target text can be determined. That is, if the status of allocating the current license certificate to the target text is that the current license certificate has been allocated to the target text, it can be determined that the above permission information indicates that the target encoding system has the permission to encode the target text.

[0041] Optionally, if the status of allocating the current license certificate to the target text is that the current license certificate has not been allocated to the target text, wait until the container finishes filling the license certificate, then resume allocating the license certificate to the target text, and in the case where the license certificate has been allocated to the target text, it can be determined that the above permission information indicates that the target encoding system has the permission to encode the target text.

[0042] Step S203: In response to the permission information indicating that the target encoding system has the permission to encode the target text, record the encoding duration of the target encoding system for encoding the target text.

[0043] In the technical solution provided in step S203 of the present invention, after responding to the encoding request and determining the permission information of the target encoding system for the target text based on the current license certificate in the target database, in response to the permission information indicating that the target encoding system has the permission to encode the target text, record the encoding duration of the target encoding system for encoding the target text. Optionally, based on the determined permission information, perform text analysis on the content indicated by the determined permission information. If it is analyzed that the permission information indicates that the target encoding system has the permission to encode the target text, the encoding duration of the target encoding system for encoding the target text can be recorded, where the encoding duration can be used to represent the duration from the start to the end of encoding the target text by the target encoding system.

[0044] Step S204: Based on the encoding duration, adjust the current generation rate of the current license certificate to obtain the target generation rate of the current license certificate.

[0045] In the technical solution provided in step S204 of the present invention, the current generation rate of the current license certificate can be used to represent how fast the current license certificate is generated over time. For example, the current generation rate of the current license certificate can be represented by current_rate. This is only for illustrative purposes and is not specifically limited.

[0046] In this embodiment, after responding to the permission information indicating that the target encoding system has the permission to encode the target text and recording the encoding duration of the target encoding system for encoding the target text, based on the encoding duration, adjust the current generation rate of the current license certificate to obtain the target generation rate of the current license certificate. Optionally, based on recording the encoding duration of the target encoding system for encoding the target text, the average delay duration of the target encoding system can be determined. According to the relationship between the average delay duration and the target delay duration, adjust the current generation rate of the current license certificate, and the target generation rate of the current license certificate can be obtained.

[0047] Optionally, according to the relationship between the average delay duration and the target delay duration, the current generation rate of the current license certificate can be adjusted to obtain the target generation rate of the current license certificate. That is to say, if the average delay duration is less than or equal to the target delay duration, the current generation rate can be maintained or the current generation rate can be increased to obtain the target generation rate; if the average delay duration is greater than the target delay duration, the current generation rate can be decreased to obtain the target generation rate.

[0048] In the above steps S201 to S204 of the present application, when text encoding is required, in response to the target encoding system having completed initialization, an encoding request can be received. When the above encoding request is received, according to the current license certificate in the target database, it can be determined whether the target encoding system has the permission to encode the target text. When it is determined that the target encoding system has the permission to encode the target text, according to the recorded encoding duration of the target encoding system for encoding the target text, by adjusting the current generation rate of the current license certificate, the target generation rate of the current license certificate can be obtained. Since the present application uses the encoding duration of the target encoding system for encoding the target text to dynamically adjust the current generation rate of the current license certificate, the encoding progress of the target text can be guaranteed, thereby achieving the purpose of avoiding the return content from timing out and being discarded by the client, as well as the text encoding service process crashing and data loss, thus solving the technical problem of low text encoding efficiency, and further achieving the technical effect of improving the text encoding efficiency.

[0049] The above method of this embodiment will be further introduced below.

[0050] As an optional embodiment, in step S202, in response to the encoding request, based on the current license certificate in the target database, determining the permission information of the target encoding system for the target text includes: in response to the encoding request, determining the first quantity of the current license certificate; and determining the permission information based on the first quantity.

[0051] In this embodiment, after receiving the encoding request in response to the target encoding system having completed initialization, in response to the encoding request, the first quantity of the current license certificate is determined. Optionally, in this embodiment, based on receiving the above encoding request, the quantity of the current license certificate in the target database is counted, and the first quantity of the current license certificate can be obtained.

[0052] In this embodiment, after determining the first quantity of the current license certificate in response to an encoding request, permission information is determined based on the first quantity. Optionally, in this embodiment, based on the determined first quantity of the current license certificate, the first quantity of the current license certificate is compared with a quantity threshold to obtain a first comparison result, where the first comparison result can be used to represent the relationship between the first quantity and the quantity threshold, and the quantity threshold can be, but is not limited to, 0, 1, etc. According to the obtained first comparison result, the permission information of the target encoding system for the target text can be determined, thereby achieving the purpose of determining whether the target encoding system has the permission to encode the target text, and further achieving the technical effect of ensuring the smoothness of the encoding to be performed on the target text.

[0053] Optionally, according to the obtained first comparison result, the permission information of the target encoding system for the target text can be determined. That is, if the obtained first comparison result indicates that the first quantity is greater than the quantity threshold, the current license certificate can be allocated to the target text, thereby determining the permission information of the target encoding system for the target text; if the obtained first comparison result indicates that the first quantity is less than or equal to the quantity threshold, after waiting for the container to complete license certificate filling, resume allocating the license certificate to the target text, and in the case where the license certificate has been allocated to the target text, it can be determined that the above permission information indicates that the target encoding system has the permission to encode the target text.

[0054] As an optional embodiment, determining the permission information based on the first quantity includes: in response to the first quantity being greater than the quantity threshold, determining the permission information; in response to the first quantity being less than or equal to the quantity threshold, waiting for license certificates to be filled in the target database; after license certificates have been filled in the target database, determining the second quantity of the license certificates; in response to the second quantity being greater than the quantity threshold, determining the permission information.

[0055] In this embodiment, after determining the first quantity of the current license certificate in response to an encoding request, in response to the first quantity being greater than the quantity threshold, the permission information is determined. Optionally, in this embodiment, based on the determined first quantity of the current license certificate, the first quantity of the current license certificate is compared with the quantity threshold to obtain a first comparison result. If the obtained first comparison result indicates that the first quantity is greater than the quantity threshold, the current license certificate can be allocated to the target text, thereby determining the permission information of the target encoding system for the target text, thereby achieving the purpose of determining whether the target encoding system has the permission to encode the target text, and further achieving the technical effect of ensuring the smoothness of the encoding to be performed on the target text.

[0056] In this embodiment, the generation time of the above license certificate can be later than the generation time of the current license certificate.

[0057] In this embodiment, after determining the first quantity of the current license certificate in response to an encoding request, in response to the first quantity being less than or equal to the quantity threshold, wait for the license certificate to be filled in the target database; after the license certificate has been filled in the target database, determine the second quantity of the license certificate; in response to the second quantity being greater than the quantity threshold, determine the permission information. Optionally, based on determining the first quantity of the current license certificate, this embodiment compares the first quantity of the current license certificate with the quantity threshold to obtain a first comparison result. If the obtained first comparison result indicates that the first quantity is less than or equal to the quantity threshold, wait for the license certificate to be filled in the target database. After the license certificate has been filled in the target database, count the quantity of the license certificate to obtain a second quantity. Compare the obtained second quantity with the quantity threshold to obtain a second comparison result, where the second comparison result can be used to represent the relationship between the second quantity and the quantity threshold. If the obtained second comparison result indicates that the second quantity is greater than the quantity threshold, the license certificate can be allocated to the target text, thereby determining the permission information, so as to achieve the purpose of determining whether the target encoding system has the permission to encode the target text, and further realizing the technical effect of ensuring the smoothness of the encoding to be performed on the target text.

[0058] As an optional embodiment, in response to the first quantity being greater than the quantity threshold, determining the permission information includes: in response to the first quantity being greater than the quantity threshold, allocate the current license certificate to the target text; in response to the target text having the current license certificate, determine that the permission information indicates that the target encoding system has the permission to encode the target text.

[0059] In this embodiment, after determining the first quantity of the current license certificate in response to an encoding request, in response to the first quantity being greater than the quantity threshold, allocate the current license certificate to the target text. Optionally, based on determining the first quantity of the current license certificate, this embodiment compares the first quantity of the current license certificate with the quantity threshold to obtain a first comparison result. If the obtained first comparison result indicates that the first quantity is greater than the quantity threshold, the current license certificate can be allocated to the target text, so as to achieve the purpose of authorizing the encoding permission for the target encoding system.

[0060] In this embodiment, after allocating the current license certificate to the target text in response to the first quantity being greater than the quantity threshold, in response to the target text having the current license certificate, it is determined that the permission information indicates that the target coding system has the permission to encode the target text. Optionally, based on allocating the current license certificate to the target text in this embodiment, it is determined whether the target text has the current license certificate. If it is determined that the target text has the current license certificate, it can be determined that the permission information indicates that the target coding system has the permission to encode the target text, thereby achieving the purpose of being able to determine that the target coding system has the permission to encode the target text, and further achieving the technical effect of being able to ensure the smoothness of encoding the target text to be encoded.

[0061] As an alternative embodiment, in response to the second quantity being greater than the quantity threshold, determining the permission information includes: in response to the second quantity being greater than the quantity threshold, allocating a license certificate to the target text; in response to the target text matching the license certificate, determining that the permission information indicates that the target coding system has the permission to encode the target text.

[0062] In this embodiment, after determining the first quantity of the current license certificate in response to the encoding request, in response to the second quantity being greater than the quantity threshold, a license certificate is allocated to the target text. Optionally, based on determining the first quantity of the current license certificate in this embodiment, the first quantity of the current license certificate is compared with the threshold, and a first comparison result can be obtained. If the obtained first comparison result indicates that the first quantity is greater than the threshold, a license certificate can be allocated to the target text, thereby achieving the purpose of being able to authorize the encoding permission for the target coding system.

[0063] In this embodiment, after allocating a license certificate to the target text in response to the second quantity being greater than the quantity threshold, in response to the target text matching the license certificate, it is determined that the permission information indicates that the target coding system has the permission to encode the target text. Optionally, based on allocating the license certificate to the target text in this embodiment, it is determined whether the target text matches the license certificate. If it is determined that the target text matches the license certificate, it can be determined that the permission information indicates that the target coding system has the permission to encode the target text, thereby achieving the purpose of being able to determine that the target coding system has the permission to encode the target text, and further achieving the technical effect of being able to ensure the smoothness of encoding the target text to be encoded.

[0064] As an alternative embodiment, based on the encoding duration, adjusting the current generation rate of the current license certificate to obtain the target generation rate of the current license certificate includes: determining the encoding duration as the average delay duration of the target coding system; determining the duration difference between the average delay duration and the target delay duration; based on the duration difference, adjusting the current generation rate to obtain the target generation rate.

[0065] In this embodiment, the above-mentioned average delay duration can be represented by latency_avg.

[0066] In this embodiment, in response to the permission information indicating that the target encoding system has the permission to encode the target text, after recording the encoding duration of the target encoding system for encoding the target text, the encoding duration is determined as the average delay duration of the target encoding system. Optionally, based on the recorded encoding duration of the target encoding system for encoding the target text, the recorded encoding duration is determined as the average delay duration of the target encoding system for encoding the text. For example, if the recorded encoding duration is 4S, then the average delay duration is 4S. The duration here is only for illustration and is not specifically limited.

[0067] In this embodiment, the above-mentioned target delay duration can be represented by target_latency. The above-mentioned duration difference can be represented by error.

[0068] In this embodiment, after determining the encoding duration as the average delay duration of the target encoding system, the duration difference between the average delay duration and the target delay duration is determined. Optionally, based on the determined average delay duration of the target encoding system, the difference between the average delay duration and the target delay duration is calculated, and the duration difference between the average delay duration and the target delay duration can be obtained, so as to achieve the purpose of determining whether the average delay duration is consistent with the target delay duration.

[0069] Optionally, the determination of the duration difference between the average delay duration and the target delay duration can be achieved through the following formula (1):

[0070] error = latency_avg - target_latency (1)

[0071] In this embodiment, after determining the duration difference between the average delay duration and the target delay duration, based on the duration difference, the current generation rate is adjusted to obtain the target generation rate. Optionally, based on the determined duration difference between the average delay duration and the target delay duration, if the above duration difference is negative or 0, the current generation rate can be maintained or the current generation rate can be increased to obtain the target generation rate. If the above duration difference is positive, the current generation rate can be decreased to obtain the target generation rate, so as to achieve the purpose of adjusting the generation rate of the token, and further achieve the technical effect of improving the efficiency of text encoding.

[0072] As an alternative embodiment, based on the duration difference, adjust the current generation rate to obtain the target generation rate, including: obtaining the integral term and the differential term corresponding to the duration difference; determining the first weight of the duration difference, the second weight of the integral term, and the third weight of the differential term; using the first weight, the second weight, and the third weight to fuse the duration difference, the integral term, and the differential term to obtain an adjustment parameter; using the adjustment parameter to adjust the current generation rate to obtain the target generation rate.

[0073] In this embodiment, the above-mentioned integral term corresponding to the duration difference can be obtained by integrating the duration difference, and the above-mentioned differential term corresponding to the duration difference can be obtained by differentiating the duration difference. For example, the above-mentioned integral term corresponding to the duration difference can be represented by error_sum, and the above-mentioned differential term corresponding to the duration difference can be represented by error_diff.

[0074] In this embodiment, the above-mentioned first weight can be used to control the proportion of the duration difference among the duration difference, the integral term, and the differential term, the above-mentioned second weight can be used to control the proportion of the integral term among the duration difference, the integral term, and the differential term, and the above-mentioned third weight can be used to control the proportion of the differential term among the duration difference, the integral term, and the differential term. For example, the above-mentioned first weight of the duration difference can be represented by Kp, the above-mentioned second weight of the integral term can be represented by Ki, and the above-mentioned second weight of the differential term can be represented by Kd.

[0075] In this embodiment, after obtaining the duration difference between the average delay duration and the target delay duration, determine the integral term and the differential term corresponding to the duration difference; determine the first weight of the duration difference, the second weight of the integral term, and the third weight of the differential term. Optionally, based on the determined duration difference between the average delay duration and the target delay duration, integrating the duration difference can obtain the integral term corresponding to the duration difference, differentiating the duration difference can obtain the differential term corresponding to the duration difference, and from the target coding system, the first weight of the duration difference, the second weight of the integral term, and the third weight of the differential term can be obtained.

[0076] In this embodiment, the above-mentioned adjustment parameter can be used to represent the rate adjustment amount of the current generation rate. For example, the above-mentioned adjustment parameter can be represented by rate_adjustment, and the above-mentioned target generation rate can be represented by new_rate.

[0077] In this embodiment, after obtaining the first weight of the duration difference, the second weight of the integral term, and the third weight of the differential term, the first weight, the second weight, and the third weight are used to fuse the duration difference, the integral term, and the differential term to obtain an adjustment parameter; the adjustment parameter is used to adjust the current generation rate to obtain a target generation rate. Optionally, based on the determination of the first weight, the second weight, and the third weight, the first weight and the duration difference are summed to obtain a first sum between the first weight and the duration difference, the second weight and the integral term are summed to obtain a second sum between the second weight and the integral term, and the third weight and the differential term are summed to obtain a third sum between the third weight and the differential term. Fusing the above first sum, second sum, and third sum can obtain an adjustment parameter. Calculating the difference between the current generation rate and the obtained adjustment parameter can obtain the difference between the current generation rate and the adjustment parameter, and adjusting the current generation rate to the obtained difference can obtain the target generation rate, thereby achieving the purpose of adjusting the generation rate of tokens, and further realizing the technical effect of improving the efficiency of text encoding.

[0078] Optionally, fusing the above first sum, second sum, and third sum can obtain an adjustment parameter, and calculating the difference between the current generation rate and the obtained adjustment parameter can be achieved through the following formulas (2) and (3):

[0079] rate_adjustment = Kp * error + Ki * error_sum + Kd * error_diff (2)

[0080] new_rate = current_rate - rate_adjustment (3)

[0081] Optionally, according to the magnitude of the adjustment parameter, gradually decreasing or increasing the current generation rate can obtain the target generation rate. That is to say, if the adjustment parameter is positive or 0, then according to the magnitude of the adjustment parameter, gradually decreasing the current generation rate can obtain the target generation rate; if the adjustment parameter is negative, then according to the magnitude of the adjustment parameter, gradually increasing the current generation rate can obtain the target generation rate.

[0082] In an embodiment of the present invention, in the case where it is necessary to encode the text, in response to the target encoding system having completed initialization, an encoding request can be received. In the case of receiving the above encoding request, it can be determined whether the target encoding system has the authority to encode the target text according to the current license certificate in the target database. In the case of determining that the target encoding system has the authority to encode the target text, the target generation rate of the current license certificate can be obtained by adjusting the current generation rate of the current license certificate according to the recorded encoding time of the target encoding system encoding the target text. Since the present application utilizes the encoding time of the target encoding system encoding the target text to dynamically adjust the current generation rate of the current license certificate, the encoding progress of the target text can be guaranteed, thereby achieving the purpose of avoiding the return content timeout and being abandoned by the client, as well as the crash of the text encoding service process and data loss, thereby solving the technical problem of low efficiency of text encoding, and then achieving the technical effect of improving the efficiency of text encoding.

[0083] The technical solution of the embodiment of the present invention is illustrated below in conjunction with preferred implementation modes.

[0084] In the locally deployed deep learning inference service, if the client sends a large amount of request data or the frequency is too fast, the text encoding service will not be able to process it in time, and the data will accumulate in the waiting queue. If the data accumulates, on the one hand, the returned content will time out and be abandoned by the client, and on the other hand, the text encoding service process may crash and data may be lost due to the long queue, resulting in low efficiency of text encoding.

[0085] In order to solve the above technical problems, an embodiment of the present invention proposes a rate adjustment method for certificate generation. In the case where text needs to be encoded, in response to the target encoding system having completed initialization, an encoding request can be received. In the case of receiving the above encoding request, it can be determined whether the target encoding system has the authority to encode the target text according to the current license certificate in the target database. In the case of determining that the target encoding system has the authority to encode the target text, the target generation rate of the current license certificate can be obtained by adjusting the current generation rate of the current license certificate according to the recorded encoding time of the target encoding system to encode the target text, thereby achieving the purpose of avoiding the return content timeout and being abandoned by the client, as well as the crash of the text encoding service process and data loss, thereby solving the technical problem of low efficiency of text encoding, and further achieving the technical effect of improving the efficiency of text encoding.

[0086] In this embodiment, a dynamic concurrency adjustment and monitoring device for deep learning inference services based on discrete proportional-integral-derivative control (PID for short) and token bucket can execute a dynamic concurrency adjustment and monitoring method for deep learning inference services based on discrete PID control and token bucket. For example, FIG. 3(a) is a schematic diagram of a dynamic concurrency adjustment and monitoring device for deep learning inference services based on discrete PID control and token bucket according to an embodiment of the present invention. As shown in FIG. 3(a), the device may include: a client (epaichat) 301 and a server (rag-service) 302. Among them, the client 301 may include a task processor 3011, a PID controller 3012, a monitoring system 3013, and a token generator 3014.

[0087] In this embodiment, the above-mentioned client 301 can batch convert a text array into vectors by calling the interface of the above-mentioned server 302, merge approximate vectors by corresponding methods according to different chunking algorithms, and store them in a storage space (Elasticsearch).

[0088] In this embodiment, the above-mentioned task processor 3011 can be used to process newly arrived text encoding tasks, be responsible for sending requests to rag-service, and process the vectors returned by rag-service. Among them, the text encoding tasks can be executed by threads in a thread pool with a fixed size (for example, usually larger than the upper limit of the token bucket), and the concurrency is controlled by the token bucket.

[0089] In this embodiment, the above-mentioned PID controller 3012 can be used to calculate the PID control quantity according to the request latency, and dynamically adjust the current generation rate of tokens through the discrete PID algorithm.

[0090] In this embodiment, the above-mentioned monitoring system 3013 can be used to collect performance metrics, record historical data, and expose the data externally through an interface to facilitate users to obtain the running efficiency and status of text encoding tasks. Optionally, the monitoring system can be used to continuously record the following information: request latency history (latency_history), rate adjustment history (rate_history), and the usage status of the token bucket (token_bucket.qsize()). Among them, the above information can be used for system tuning and performance analysis. When a new request arrives, the system processes it according to the following steps: first, try to obtain a token. After obtaining the token, submit the request to the thread pool for processing, send the request to rag-service, and store the returned vector result in Elasticsearch.

[0091] In this embodiment, the above-mentioned token generator 3014 can be used to generate new tokens according to the current generation rate (current_rate) of the tokens to ensure the capacity of the token bucket, and can also be used to dynamically adjust the current generation rate according to the rate adjustment amount calculated by the PID controller 3012.

[0092] In this embodiment, when implementing the dynamic concurrency adjustment and monitoring method for deep learning inference services based on discrete PID control and token bucket, the generation rate of tokens can be adjusted. For example, FIG. 3(b) is a flowchart of a dynamic concurrency adjustment and monitoring method for deep learning inference services based on discrete PID control and token bucket according to an embodiment of the present invention. As shown in FIG. 3(b), the method may include the following steps:

[0093] Step S311, receiving a new text encoding task.

[0094] In the technical solution provided in step S311 of the present invention, the target encoding system is initialized. For example, the capacity (pool_size) of the thread pool is set to 100, the initial generation rate (initial_rate) of the tokens is set to 1.0 per second, the lower limit of the generation rate (also referred to as the minimum rate) min_rate is set to 1.0 per second, the upper limit of the generation rate (also referred to as the maximum rate) max_rate is set to 100.0 per second, the capacity (bucket_size) of the token bucket is set to 100, and the target latency (target_latency) target_latency is set to 16 seconds. In addition, the PID controller parameters are also initialized. For example, Kp is initialized to 0.5, Ki is initialized to 0.1, Kd is initialized to 0.05, error_sum is initialized to 0, and last_error is initialized to 0. The values here are only for illustration and are not specifically limited.

[0095] In this embodiment, when a text encoding task arrives, the token generator and the PID controller are started, and when the text encoding task ends, the token generator and the PID controller are paused.

[0096] After receiving a new text encoding task, it enters step S312 to determine whether there are tokens in the token bucket.

[0097] If there are no tokens in the token bucket, it enters step S313 to wait for tokens. If there are tokens in the token bucket, it enters steps S314, S315, S316, and S317 to obtain tokens, send the request to the thread pool, record the latency duration of the request return, and obtain the historical latency record.

[0098] In the technical solution provided in step S314 of the present invention above, the above request may be an encoding request.

[0099] In this embodiment, after the task processor receives the chunk string array passed by the previous system, it obtains 1 token from the token bucket. If the acquisition fails, it waits until the token bucket is filled and then tries again. If the acquisition is successful, it sends an encoding request to the rag-service.

[0100] For example, in the input field of the request body content of the above task processor, 128 strings are taken as a batch. The batch size of the epaichat sending request should be greater than or equal to the batch size of the rag-service processing the request. Here, the batch size of the rag-service is set and fixed at 32.

[0101] When obtaining the historical delay record, enter steps S318, S319, S320, S321, S322, S323, and S324 to obtain the status of the token bucket, obtain the average delay duration, calculate the error between the average delay duration and the target delay duration, calculate the PID control quantity, adjust the current generation rate of the token, and record the adjusted current generation rate.

[0102] In the technical solution provided in step S322 of the present invention above, when a request with a batch quantity of 128 strings arrives at the rag-service, the rag-service performs text encoding in batches of 32 and returns after completing 4 batches. Assuming that the processing time for a single batch is 1 second, this request will return after about 4 seconds. Therefore, the 4th request in the rag-service buffer queue will return after about 16 seconds. Therefore, when the buffer queue length stabilizes at around 4, the PID controller will reach a steady state after several time steps, that is, keep the average delay duration (current_latency) near the target delay duration (target_latency). Synchronously with the above process, the PID controller can calculate the PID control quantity according to the request delay and dynamically adjust the current generation rate (current_rate) of the token through the discrete PID algorithm.

[0103] It should be noted that in the request processing flow, the target encoding system can be used to maintain a thread pool (ThreadPool) of a fixed size (e.g., size N) and a token bucket (TokenBucket) with a capacity of M. When a new request arrives, a token needs to be obtained from the token bucket first before it can be submitted to the thread pool for execution. If the token bucket is empty, it needs to wait. The above mechanism can ensure that the concurrency of the target encoding system does not exceed the expected range.

[0104] In this embodiment, the token generator generates tokens at a variable rate and puts them into the token bucket. The token generation interval τ can be determined by the current rate current_rate: τ = 1 / current_rate. Among them, the value range of current_rate is [min_rate, max_rate], and the initial value of current_rate can be denoted as initial_rate. The PID controller dynamically adjusts the current generation rate of the tokens by monitoring the request delay. Among them, within each control period T, using the above formula (1), the error between the average delay duration and the target delay duration can be calculated; through the above formulas (2) and (3), the PID control algorithm can be used to calculate the rate adjustment amount, and according to the rate adjustment amount, the current generation rate of the tokens can be adjusted to obtain the target generation rate of the tokens.

[0105] Optionally, to ensure the stability of the target encoding system, restrictions are set on the integral term and the rate adjustment amount: the range of the integral term is restricted to error_sum = max(-10, min(10, error_sum)), and the range of the target generation rate is restricted to new_rate = max(min_rate, min(max_rate, new_rate)).

[0106] After obtaining the status of the token bucket and recording the adjusted current generation rate, steps S325 and S326 are entered to calculate statistical metrics and output monitoring data.

[0107] In the technical solution provided in step S326 of the present invention above, the control monitoring system can obtain the status of the token bucket, obtain historical delay records, and record the adjusted current generation rate through the interface with the task processor.

[0108] After recording the adjusted current generation rate, step S327 is entered to calculate the current production interval of the tokens.

[0109] After calculating the current production interval of the tokens, step S328 is entered to determine whether the token bucket is full.

[0110] In the technical solution provided in step S328 of the present invention, the token generator is controlled to generate new tokens according to the current generation rate (current_rate) and ensure the capacity of the token bucket.

[0111] If the token bucket is full, step S327 is entered. If the token bucket is not full, steps S329 and S330 are entered to generate new tokens and put the generated new tokens into the token bucket.

[0112] In this embodiment, in the case where text needs to be encoded, in response to the target encoding system having completed initialization, an encoding request can be received. In the case of receiving the above encoding request, according to the current license certificate in the target database, it can be determined whether the target encoding system has the permission to encode the target text. In the case where it is determined that the target encoding system has the permission to encode the target text, according to the recorded encoding duration of the target encoding system for encoding the target text, by adjusting the current generation rate of the current license certificate, the target generation rate of the current license certificate can be obtained. Since the present application uses the encoding duration of the target encoding system for encoding the target text to dynamically adjust the current generation rate of the current license certificate, it can ensure the encoding progress of the target text, thereby achieving the purpose of avoiding the returned content from timing out and being discarded by the client, as well as the text encoding service process crashing and data loss, thus solving the technical problem of low efficiency of text encoding, and further achieving the technical effect of improving the efficiency of text encoding.

[0113] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application.

[0114] In this embodiment, a resource operation device for a virtual machine is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the terms "unit" and "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0115] Figure 4It is a schematic diagram of a resource operation device of a virtual machine according to an embodiment of the present invention. As Figure 4 shown, the certificate generation rate adjustment device 400 may include: a receiving unit 401, a determining unit 402, a recording unit 403, and an adjusting unit 404.

[0116] The receiving unit 401 is configured to receive an encoding request in response to the target encoding system having completed initialization, where the encoding request is used to request the target encoding system to encode the target text.

[0117] The determining unit 402 is configured to determine, in response to the encoding request, permission information of the target encoding system for the target text based on the current license certificate in the target database, where the permission information is used to indicate whether the target encoding system has the permission to encode the target text, and the current license certificate is used to represent the token to be allocated to the target text in the target database.

[0118] The recording unit 403 is configured to record the encoding duration of the target encoding system for the target text in response to the permission information indicating that the target encoding system has the permission to encode the target text.

[0119] The adjusting unit 404 is configured to adjust the current generation rate of the current license certificate based on the encoding duration to obtain the target generation rate of the current license certificate.

[0120] Optionally, the determining unit 402 may include: a first determining module configured to determine a first quantity of the current license certificate in response to the encoding request; a second determining module configured to determine the permission information based on the first quantity.

[0121] Optionally, the second determining module may include: a first determining sub-module configured to determine the permission information in response to the first quantity being greater than a quantity threshold; a second determining sub-module configured to wait for a license certificate to be filled in the target database in response to the first quantity being less than or equal to the quantity threshold; after the license certificate has been filled in the target database, determine a second quantity of the license certificate; and determine the permission information in response to the second quantity being greater than the quantity threshold, where the generation time of the license certificate is later than the generation time of the current license certificate.

[0122] Optionally, the first determining sub-module may implement determining the permission information in response to the first quantity being greater than the quantity threshold by performing the following steps: in response to the first quantity being greater than the quantity threshold, allocate the current license certificate to the target text; and in response to the target text having the current license certificate, determine that the permission information indicates that the target encoding system has the permission to encode the target text.

[0123] Optionally, the second determination sub-module may implement determining permission information in response to the second quantity being greater than the threshold by performing the following steps: in response to the second quantity being greater than the quantity threshold, assign a license certificate to the target text; in response to the target text having a license certificate, determine that the permission information indicates that the target coding system has the permission to encode the target text.

[0124] Optionally, the adjustment unit 404 may include: a third determination module, configured to determine the encoding duration as the average delay duration of the target coding system; a fourth determination module, configured to determine the duration difference between the average delay duration and the target delay duration; and an adjustment module, configured to adjust the current generation rate based on the duration difference to obtain the target generation rate.

[0125] Optionally, the adjustment module may include: an acquisition sub-module, configured to acquire an integral term and a differential term corresponding to the duration difference, where the integral term is obtained by performing an integration process on the duration difference, and the differential term is obtained by performing a differentiation process on the duration difference; a third determination sub-module, configured to determine a first weight of the duration difference, a second weight of the integral term, and a third weight of the differential term, where the first weight is used to control the proportion of the duration difference among the duration difference, the integral term, and the differential term, the second weight is used to control the proportion of the integral term among the duration difference, the integral term, and the differential term, and the third weight is used to control the proportion of the differential term among the duration difference, the integral term, and the differential term; a fusion sub-module, configured to fuse the duration difference, the integral term, and the differential term by using the first weight, the second weight, and the third weight to obtain an adjustment parameter; and a fourth determination sub-module, configured to adjust the current generation rate by using the adjustment parameter to obtain the target generation rate.

[0126] In this embodiment, the following units are deployed in the rate adjustment device for certificate generation: a receiving unit, configured to receive an encoding request in response to the target coding system having completed initialization, where the encoding request is used to request the target coding system to encode the target text; a determination unit, configured to determine the permission information of the target coding system for the target text based on the current license certificate in the target database in response to the encoding request, where the permission information is used to indicate whether the target coding system has the permission to encode the target text, and the current license certificate is used to represent the token to be allocated to the target text in the target database; a recording unit, configured to record the encoding duration of the target coding system for encoding the target text in response to the permission information indicating that the target coding system has the permission to encode the target text; and an adjustment unit, configured to adjust the current generation rate of the current license certificate based on the encoding duration to obtain the target generation rate of the current license certificate, thereby achieving the purpose of avoiding the returned content from timing out and being discarded by the client, as well as the text encoding service process crashing and data loss, thus solving the technical problem of low efficiency of text encoding, and further achieving the technical effect of improving the efficiency of text encoding.

[0127] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.

[0128] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is set to execute the steps in any one of the above method embodiments when running.

[0129] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disk, magnetic disk or optical disc, etc., various media that can store computer programs.

[0130] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is set to run the computer program to execute the steps in any one of the above method embodiments.

[0131] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device. Wherein, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0132] An embodiment of the present application further provides a computer program product. The above computer program product includes a computer program, and the steps in any one of the above method embodiments are implemented when the computer program is executed by a processor.

[0133] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and the steps in any one of the above method embodiments are implemented when the computer program is executed by a processor.

[0134] An embodiment of the present application further provides a computer program. The computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above method embodiments.

[0135] The specific examples in this embodiment can refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0136] Obviously, those skilled in the art should understand that the various modules or steps of the present application described above can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order from here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.

[0137] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application shall be included within the protection scope of the present application.

Claims

1. A method for adjusting the rate of certificate generation, characterized in that: include: In response to the target coding system having completed initialization, receiving a coding request, wherein the coding request is used to request the target coding system to encode the target text; In response to the encoding request, determining the permission information of the target encoding system to the target text based on the current license certificate in the target database, wherein the permission information is used to indicate whether the target encoding system has the permission to encode the target text, and the current license certificate is used to indicate the token to be allocated to the target text in the target database; In response to the permission information indicating that the target coding system has the permission to encode the target text, recording the encoding time for the target coding system to encode the target text; Based on the encoding duration, the current generation rate of the current license certificate is adjusted to obtain a target generation rate of the current license certificate.

2. The method according to claim 1, characterized in that In response to the encoding request, determining the authority information of the target encoding system for the target text based on the current license certificate in the target database, including: In response to the encoded request, determining a first quantity of the current license certificates; Based on the first number, the permission information is determined.

3. The method according to claim 2, characterized in that Determining the permission information based on the first quantity includes: In response to the first quantity being greater than a quantity threshold, determining the permission information; In response to the first quantity being less than or equal to the quantity threshold, waiting for the license certificates to be filled in the target database; after the license certificates have been filled in the target database, determining a second quantity of the license certificates; in response to the second quantity being greater than the quantity threshold, determining the permission information, wherein the generation time of the license certificate is later than the generation time of the current license certificate.

4. The method according to claim 3, characterized in that In response to the first quantity being greater than a quantity threshold, determining the permission information includes: In response to the first quantity being greater than a quantity threshold, the current license certificate is assigned to the target text; in response to the target text matching the current license certificate, it is determined that the permission information indicates that the target encoding system has permission to encode the target text.

5. The method according to claim 3, characterized in that: In response to the second number being greater than the number threshold, determining the permission information includes: In response to the second quantity being greater than the quantity threshold, the license certificate is assigned to the target text; in response to the target text matching the license certificate, it is determined that the permission information indicates that the target encoding system has the permission to encode the target text.

6. The method according to claim 1, characterized in that Based on the encoding duration, adjusting the current generation rate of the current license certificate to obtain the target generation rate of the current license certificate includes: Determine the encoding duration as the average delay duration of the target encoding system; Determine the time difference between the average delay time and the target delay time; Based on the time difference, the current generation rate is adjusted to obtain the target generation rate.

7. The method according to claim 6, characterized in that Based on the time difference, adjusting the current generation rate to obtain the target generation rate includes: Obtaining an integral term and a differential term corresponding to the time difference, wherein the integral term is obtained by integrating the time difference, and the differential term is obtained by differentiating the time difference; Determine a first weight of the duration difference, a second weight of the integral term, and a third weight of the differential term, wherein the first weight is used to control the proportion of the duration difference in the duration difference, the integral term, and the differential term, the second weight is used to control the proportion of the integral term in the duration difference, the integral term, and the differential term, and the third weight is used to control the proportion of the differential term in the duration difference, the integral term, and the differential term; Using the first weight, the second weight and the third weight, the duration difference, the integral term and the differential term are integrated to obtain an adjustment parameter; The current generation rate is adjusted using the adjustment parameters to obtain the target generation rate.

8. A device for adjusting the rate of certificate generation, characterized in that: include: A receiving unit, configured to receive an encoding request in response to the target encoding system having completed initialization, wherein the encoding request is used to request the target encoding system to encode the target text; a determining unit, configured to determine, in response to the encoding request, permission information of the target encoding system to the target text based on a current license certificate in a target database, wherein the permission information is used to indicate whether the target encoding system has permission to encode the target text, and the current license certificate is used to indicate a token to be allocated to the target text in the target database; a recording unit, configured to record, in response to the permission information indicating that the target coding system has permission to encode the target text, an encoding time duration for the target coding system to encode the target text; The adjusting unit is used to adjust the current generation rate of the current license certificate based on the encoding duration to obtain the target generation rate of the current license certificate.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the rate adjustment method for certificate generation described in any one of claims 1 to 7 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the rate adjustment method for certificate generation described in any one of claims 1 to 7 are implemented.