CN112559449B - Data conversion processing method and device and electronic equipment - Google Patents
Data conversion processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN112559449B CN112559449B CN202110196102.5A CN202110196102A CN112559449B CN 112559449 B CN112559449 B CN 112559449B CN 202110196102 A CN202110196102 A CN 202110196102A CN 112559449 B CN112559449 B CN 112559449B
- Authority
- CN
- China
- Prior art keywords
- courseware
- conversion
- target
- queue
- time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000006243 chemical reaction Methods 0.000 title claims abstract description 271
- 238000003672 processing method Methods 0.000 title abstract description 7
- 238000000034 method Methods 0.000 claims abstract description 94
- 230000008569 process Effects 0.000 claims abstract description 60
- 238000012545 processing Methods 0.000 claims abstract description 44
- 230000007704 transition Effects 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 19
- 230000008859 change Effects 0.000 claims description 16
- 238000012937 correction Methods 0.000 claims description 8
- 238000000611 regression analysis Methods 0.000 claims description 4
- 230000004048 modification Effects 0.000 claims 1
- 238000012986 modification Methods 0.000 claims 1
- 230000002159 abnormal effect Effects 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 239000000047 product Substances 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000001902 propagating effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 239000012467 final product Substances 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000012417 linear regression Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
- G06F16/116—Details of conversion of file system types or formats
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention provides a data conversion processing method, a data conversion processing device and electronic equipment, wherein the method comprises the following steps: acquiring a target courseware and determining the corresponding maximum conversion time length; when the target courseware is positioned at the head of the conversion queue, generating a target process and determining the conversion starting time; and if the difference between the current time and the conversion starting time is not less than the maximum conversion time length and the target process is converting the target courseware, ending the target process, deleting the target courseware from the conversion queue, and converting the target courseware based on the retry queue. By the technical scheme provided by the embodiment of the invention, if the target courseware can not be successfully converted within the time of the maximum conversion time, the target courseware is transferred from the conversion queue to the retry queue, so that the next courseware in the conversion queue can be converted, the conversion process of the subsequent courseware cannot be influenced by the excessive time occupied by the abnormal target courseware, and the blockage of the conversion queue can be avoided.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for data conversion processing, an electronic device, and a computer-readable storage medium.
Background
On-line education generally requires that a class be presented to students, for example, the class may provide a blackboard-like function, and the content of the class presented by the same class user is kept the same through a synchronization mechanism. Since courseware includes many forms of text files, pictures, slides, audio, video, etc., and each may also have a different format, for example, the text file may be excel, word, etc.
In order to facilitate students to watch courseware through a browser, on-line education requires fast conversion of courseware (text, pictures, slides, audio, video, etc.) uploaded by a user (typically a teacher) into a format interpretable by the browser, such as H5 courseware, etc. To ensure an excellent user experience, an efficient, uninterrupted transition service is needed.
However, the conversion process is time-consuming, and the conversion process may also need to rely on a plurality of third-party services (such as office word services), and if the courseware is large or the third-party services are abnormal, blocking of a courseware conversion queue is easily caused, thereby affecting that other courseware cannot be normally converted.
Disclosure of Invention
In order to solve the existing technical problem, embodiments of the present invention provide a method and an apparatus for data conversion processing, an electronic device, and a computer-readable storage medium.
In a first aspect, an embodiment of the present invention provides a method for data conversion processing, including:
acquiring a target courseware to be converted uploaded by a client, and determining the corresponding maximum conversion time according to the attribute information of the target courseware; the attribute information comprises courseware types and/or courseware sizes;
adding the target courseware to a conversion queue, wherein the conversion queue is a queue in which courseware at the head of the queue can be converted;
when the target courseware is positioned at the head of the conversion queue, generating a target process for converting the target courseware, and determining the starting conversion time of the target courseware;
and if the difference between the current time and the conversion starting time is not less than the maximum conversion time and the target process is converting the target courseware, ending the target process, deleting the target courseware from the conversion queue, adding the target courseware to a retry queue different from the conversion queue, and converting the target courseware based on the retry queue.
In a second aspect, an embodiment of the present invention further provides a data conversion processing apparatus, including:
the acquisition module is used for acquiring the target courseware to be converted uploaded by the client and determining the corresponding maximum conversion time according to the attribute information of the target courseware; the attribute information comprises courseware types and/or courseware sizes;
the adding module is used for adding the target courseware to a conversion queue, and the conversion queue is a queue in which courseware at the head of the queue can be converted;
the conversion module is used for generating a target process for converting the target courseware when the target courseware is positioned at the head of the conversion queue and determining the starting conversion time of the target courseware;
and the processing module is used for ending the target process, deleting the target courseware from the conversion queue, adding the target courseware into a retry queue different from the conversion queue, and converting the target courseware based on the retry queue if the difference between the current time and the conversion starting time is not less than the maximum conversion time length and the target process is converting the target courseware.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a bus, a transceiver, a memory, a processor, and a computer program stored on the memory and executable on the processor, where the transceiver, the memory, and the processor are connected via the bus, and when the computer program is executed by the processor, the method of any one of the foregoing data conversion processes is implemented.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the method for data conversion processing described in any one of the above.
According to the data conversion processing method, the data conversion processing device, the electronic equipment and the computer readable storage medium, when the target courseware needs to be converted, the corresponding maximum conversion time length is determined, and the target courseware is converted by generating the target processes corresponding to one; if the target courseware can not be successfully converted within the time of the maximum conversion duration, the target courseware is transferred from the conversion queue to the retry queue, so that the next courseware in the conversion queue can be converted, the conversion process of the subsequent courseware is not influenced by the excessive time occupied by the abnormal target courseware, and the blockage of the conversion queue can be avoided; and when the target courseware can not be converted in time, the one-to-one corresponding target process can be conveniently stopped, and the target process can not influence the conversion of other courseware.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present invention, the drawings required to be used in the embodiments or the background art of the present invention will be described below.
FIG. 1 is a flow chart illustrating a method of data conversion processing provided by an embodiment of the present invention;
fig. 2 is a schematic structural diagram illustrating an apparatus for data conversion processing according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device for executing a method of data conversion processing according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described below with reference to the drawings.
Fig. 1 is a flowchart illustrating a method for data conversion processing according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step 101: acquiring a target courseware to be converted uploaded by a client, and determining the corresponding maximum conversion time according to the attribute information of the target courseware; the attribute information includes a courseware type and/or a courseware size.
In the embodiment of the invention, the data conversion processing method is executed by a conversion server capable of converting courseware. When a user (such as a teacher) needs to convert a courseware, the user can upload the courseware to the conversion server through the client, and the courseware is called a target courseware. In addition, courseware, including target courseware, has corresponding attribute information, and the attribute information is concrete courseware type, courseware size, etc. The courseware type can be determined according to the format of courseware, such as text type, audio type, picture type and the like; the courseware size is the storage space occupied by the courseware. After determining the attribute information of the target courseware, the maximum transition duration of the target courseware may be determined. In general, the larger the courseware size is, the larger the maximum conversion time length is; different courseware types generally have different maximum transition durations due to the possibility of using different transition strategies or performing transitions based on different third party services.
Step 102: target courseware is added to the conversion queue, and the conversion queue is a queue at the head of the queue, wherein the courseware can be converted.
In the embodiment of the invention, as the conversion server may need to convert a plurality of courseware, the conversion server is provided with a conversion queue, the conversion queue is used for storing the courseware to be converted, and the conversion queue is essentially a queue, i.e. first in first out, the courseware stored in the conversion queue first can be taken out first for conversion, i.e. the courseware at the head of the queue in the conversion queue can be converted. And after the conversion server receives the target courseware, storing the target courseware into the corresponding conversion queue according to the sequence.
Step 103: and when the target courseware is positioned at the head of the conversion queue, generating a target process for converting the target courseware, and determining the conversion starting time of the target courseware.
In the embodiment of the invention, after the target courseware is added into the conversion queue, because the courseware at the head of the conversion queue can be converted, other courseware before the target courseware can be sequentially converted in the conversion queue; and when the target courseware is positioned at the head of the conversion queue, converting the target courseware. Specifically, the conversion server generates a process for converting the target courseware, i.e. a target process, and also determines a conversion start time of the target courseware, i.e. a time (server time) when the target process starts to convert the target courseware.
Step 104: and if the difference between the current time and the conversion starting time is not less than the maximum conversion time length and the target process is converting the target courseware, ending the target process, deleting the target courseware from the conversion queue, adding the target courseware to a retry queue different from the conversion queue, and converting the target courseware based on the retry queue.
In the embodiment of the invention, the target process is used for converting the target courseware, and after the target process is generated, the target process can convert the target courseware. Because the target courseware has a certain size, i.e. the courseware size has a certain value, the target course generally needs a period of time to completely convert the target courseware into the required courseware, such as H5 courseware. In this embodiment, a maximum conversion time length is preset, where the maximum conversion time length is greater than a theoretical time length for a target course to convert the target courseware (for example, an average value of conversion time lengths of previous course conversion similar to the target courseware, etc.), that is, in a normal situation, a time length required for successfully converting the target courseware is less than the maximum conversion time length. If the target process successfully converts the target courseware, the difference between the current time of the conversion server and the conversion starting time is smaller than the maximum conversion time length, that is, the time length for converting the target courseware is smaller than the maximum conversion time length, and the target process normally completes the conversion processing process.
Conversely, if the difference between the current time and the starting conversion time is not less than the maximum conversion time and the goal process is performing the conversion processing on the goal courseware, it indicates that the goal process has not successfully converted the goal courseware within the time of the maximum conversion time, which may be that the courseware size of the goal courseware is too large to complete the conversion process in a short time; or the third party service required in the conversion process is abnormal, so that the target courseware is not successfully converted currently. At this time, the target courseware is deleted from the conversion queue and is added to other queues different from the conversion queue, namely a retry queue; the retry queue in this embodiment is a queue that is set separately and is used to store an abnormal target courseware, and then perform conversion processing on the target courseware in other manners until the target courseware is successfully converted. Meanwhile, after the target courseware is deleted from the conversion queue, other courseware behind the target courseware is located at the head of the conversion queue, and then other courseware behind the target courseware can be converted, so that the conversion processing process of the subsequent courseware is not influenced. In addition, the target process also needs to be ended, and due to the one-to-one correspondence between the processes and the courseware, when the target courseware cannot be converted in time, the corresponding target process can be conveniently stopped, and the conversion of other courseware is not influenced.
Optionally, the method further comprises: and when the target courseware is successfully converted, feeding back a conversion success message to the client. Specifically, if the target course completes the conversion of the target courseware, and the difference between the current time and the conversion starting time is less than the maximum conversion time, it is indicated that the conversion of the target courseware is completed within the maximum conversion time, that is, it can be determined that the target courseware is successfully converted; in addition, the target process is ended and the target courseware is deleted from the conversion queue. Alternatively, if the target courseware is moved to the retry queue, if the target courseware in the retry queue is successfully converted, it can also be determined that the target courseware is successfully converted, and a conversion success message is fed back to the client.
The data conversion processing method provided by the embodiment of the invention determines the corresponding maximum conversion duration when the target courseware needs to be converted, and converts the target courseware by generating the target processes corresponding to one; if the target courseware can not be successfully converted within the time of the maximum conversion duration, the target courseware is transferred from the conversion queue to the retry queue, so that the next courseware in the conversion queue can be converted, the conversion process of the subsequent courseware is not influenced by the excessive time occupied by the abnormal target courseware, and the blockage of the conversion queue can be avoided; and when the target courseware can not be converted in time, the one-to-one corresponding target process can be conveniently stopped, and the target process can not influence the conversion of other courseware.
On the basis of the embodiment, the courseware uploading and courseware conversion of the client are executed asynchronously, namely, the courseware is converted after the courseware uploading is successful. In an embodiment of the present invention, the step 101 of "obtaining a target courseware to be converted uploaded by a client" includes:
step A1: and receiving an uploading request initiated by the client, wherein the uploading request is used for uploading the target courseware to be converted.
Step A2: and after the target courseware is successfully received, determining to obtain the target courseware, and feeding back an uploading success message to the client.
In the embodiment of the invention, the client uploads the target courseware to the conversion server by initiating an uploading request; after receiving the complete target courseware, the conversion server confirms that the target courseware is successfully received, and at the moment, the target courseware can be obtained. And the conversion server feeds back an upload success message to the client to inform the client. According to the embodiment, the processes of uploading and conversion are asynchronously executed, so that the phenomenon that the conversion process is meaningless due to the fact that the conversion is directly carried out due to unsuccessful uploading can be avoided. In addition, when the target courseware is added to the conversion queue in step 102, the target courseware is added according to the time sequence of successful uploading of the target courseware, that is, the courseware successfully uploaded is preferentially added.
Optionally, the attribute information of the courseware includes a courseware type and a courseware size, and the embodiment determines the corresponding maximum conversion time based on the courseware type and the courseware size of the target courseware. Specifically, the step 101 "determining the corresponding maximum conversion time length according to the attribute information of the target courseware" includes:
step B1: and determining historical courseware with the same courseware type as the target courseware, wherein the historical courseware is the courseware which is successfully converted.
In the embodiment of the invention, since the conversion time lengths of courseware of different courseware types may be different, the embodiment determines the maximum conversion time length of the target courseware based on historical courseware which has the same courseware type and is successfully converted. Specifically, the present embodiment predicts the conversion duration of the successful conversion of the target courseware, i.e. the successful conversion prediction duration, and then determines the maximum conversion duration of the target courseware based on the successful conversion prediction duration.
Step B2: and taking the historical courseware of which the difference between the courseware size and the courseware size of the target courseware is smaller than a preset value as effective historical courseware, performing regression analysis on the courseware sizes of the effective historical courseware and the successful conversion time length, and determining the change rate between the courseware sizes and the successful conversion time length.
Because the courseware sizes of the target courseware and the historical courseware are difficult to be the same, the successful conversion prediction time of the target courseware is difficult to be accurately determined directly according to the successful conversion time of the historical courseware. Further, although the larger the courseware size, the longer the successful transition duration is, in general, the two are not necessarily in a linear positive correlation, i.e. it is difficult to accurately determine the relationship between courseware size and successful transition duration.
In the embodiment of the invention, the historical courseware with the difference value between the courseware size and the courseware size of the target courseware smaller than the preset value is taken as the effective historical courseware, namely, the difference value between the courseware size of the effective historical courseware and the courseware size of the target courseware is smaller than the preset value, so that the courseware sizes of the effective historical courseware and the target courseware are basically similar, and the courseware sizes of all the effective historical courseware can be restricted in a smaller value range. Since the value range is relatively small, the courseware size and the successful conversion time length are basically in a linear relation in the value range, so that the change rate between the courseware size and the successful conversion time length can be accurately determined by performing regression analysis (linear regression analysis) on the courseware sizes and the successful conversion time lengths of a plurality of effective historical courseware. The "difference between a and B" in the present embodiment refers to the absolute value of a-B.
Step B3: and correcting the courseware size of the effective historical courseware to be the same as the courseware size of the target courseware, and determining the successful conversion time length after the effective historical courseware correction according to the change rate.
In the embodiment of the invention, the courseware size of the effective historical courseware is generally different from the courseware size of the target courseware, so that the required success conversion prediction time length cannot be determined directly through the success conversion time length of the effective historical courseware. In this embodiment, the courseware size of the effective historical courseware is corrected to be the same as the courseware size of the target courseware, so that the corrected effective historical courseware and the target courseware have the same attribute information, that is, the courseware type and the courseware size are the same. Meanwhile, the successful conversion duration of the effective historical courseware also required to be synchronously corrected. As described in step B2 above, since there is a linear positive correlation between the courseware size and the successful transition duration, the successful transition duration can be corrected synchronously according to the rate of change between the courseware size and the successful transition duration.
Alternatively, it is provided that,for the corrected successful transition duration for the ith active history courseware,for the successful transition duration of the ith active history courseware,for the courseware size of the ith active history courseware,the courseware size for the target courseware, and k is the rate of change between courseware size and the length of time of successful transition. The correction degree of the courseware size in the correction processDegree of correction of successful conversion durationThe two are also in linear relation, and the change rate between the two is also k, so. Therefore, the successful conversion time length after the correction of the effective historical courseware is as follows:. In this embodiment, the change rate is a ratio of a change amount of the successful conversion time length to a change amount of the courseware size.
Step B4: and taking the average value of the corrected successful conversion durations of the plurality of effective historical courseware as the successful conversion prediction duration of the target courseware, and taking the product of the successful conversion prediction duration and the adjustment coefficient and the smaller value of the preset maximum value as the maximum conversion duration of the target courseware, wherein the adjustment coefficient is more than 1.
In the embodiment of the invention, after the effective historical courseware is corrected, the successful conversion time length after the effective historical courseware is corrected can represent the time length required by the successful conversion of the target courseware, and the successful conversion prediction time length of the target courseware can be more accurately determined by averaging a plurality of corrected successful conversion time lengths. When the target courseware is converted, reasonable reasons inevitably exist to cause the conversion rate to be slower, so the adjustment coefficient is multiplied on the basis of the successful conversion prediction time length, and the maximum conversion time length of the target courseware is determined based on the final product. The adjustment coefficient is a value larger than 1, and specifically may be 1.5, 2, or the like.
In addition, in order to avoid setting an excessively large maximum conversion time length for a large courseware size, a maximum value is also preset in the embodiment, that is, the maximum value is preset, that is, the conversion time lengths of all courseware cannot exceed the preset maximum value. Specifically, the smaller value of the product of the prediction time length of successful conversion and the adjustment coefficient and the preset maximum value is used as the maximum conversion time length of the target courseware. For example, the prediction duration for successful transition isThe adjustment coefficient isIf the preset maximum value is MAX, the maximum conversion time length of the target courseware is MAX。
According to the embodiment of the invention, the value range of the courseware size of the effective historical courseware is restricted in a smaller range through the difference value of the courseware size is smaller than the preset value, and the courseware size and the successful conversion time length in the range basically accord with a linear relation, so that the effective historical courseware with different courseware sizes can be corrected to be the same as the courseware size of the target courseware, the corrected successful conversion time length is determined, the successful conversion prediction time length of the target courseware can be accurately determined, and the accuracy of the maximum conversion time length is improved; and the maximum value of the maximum conversion time length can be further limited by presetting the maximum value, so that the phenomenon that the overlarge maximum conversion time length is set for the larger courseware size can be avoided, and other courseware can be ensured to be converted in time.
On the basis of the above embodiment, the method further includes:
step C1: the maximum queue length of the conversion queue is preset.
Step C2: and if the current queue length of the conversion queue is larger than the maximum queue length, carrying out capacity expansion processing, and transferring part of courseware in the conversion queue to a server after capacity expansion for processing.
In the embodiment of the invention, when the number of courseware uploaded by one or more clients is large, the conversion queue of the conversion server is too long, and at the moment, courseware behind the conversion queue can not be converted in time. The present embodiment also sets a limit for the conversion queue, i.e., sets a maximum queue length. If the current queue length of the conversion queue is smaller than the maximum queue length, the process is normally executed, and the newly received courseware can be added into the conversion queue. If the current queue length of the conversion queue is greater than the maximum queue length, it is indicated that the conversion queue is too long, and there may be a large number of courseware to be converted at this time. The queue length (including the current queue length and the maximum queue length) may be the number of courseware in the conversion queue, or the sum of the courseware sizes of all courseware in the conversion queue.
The method for data conversion processing provided by the embodiment of the present invention is described above in detail, and the method can also be implemented by a corresponding apparatus.
Fig. 2 is a schematic structural diagram illustrating an apparatus for data conversion processing according to an embodiment of the present invention. As shown in fig. 2, the data conversion processing apparatus includes:
the acquisition module 21 is configured to acquire a target courseware to be converted and uploaded by a client, and determine a corresponding maximum conversion time according to attribute information of the target courseware; the attribute information comprises courseware types and/or courseware sizes;
an adding module 22, configured to add the target courseware to a conversion queue, where the conversion queue is a queue in which courseware at the head of the queue can be converted;
the conversion module 23 is configured to generate a target process for converting the target courseware when the target courseware is located at the head of the conversion queue, and determine a starting conversion time of the target courseware;
and a processing module 24, configured to, if the difference between the current time and the conversion starting time is not less than the maximum conversion time and the target process is performing conversion processing on the target courseware, end the target process, delete the target courseware from the conversion queue, add the target courseware to a retry queue different from the conversion queue, and convert the target courseware based on the retry queue.
On the basis of the above embodiment, the obtaining module 21 obtains the target courseware to be converted uploaded by the client, including:
receiving an uploading request initiated by a client, wherein the uploading request is used for uploading a target courseware to be converted;
and after the target courseware is successfully received, determining to obtain the target courseware, and feeding back an uploading success message to the client.
On the basis of the above embodiment, the determining, by the obtaining module 21, the corresponding maximum conversion time length according to the attribute information of the target courseware includes:
determining historical courseware with the same courseware type as the target courseware, wherein the historical courseware is a courseware which is successfully converted;
taking the historical courseware with the difference value between the courseware size and the courseware size of the target courseware smaller than a preset value as effective historical courseware, performing regression analysis on the courseware sizes of the effective historical courseware and the successful conversion time length, and determining the change rate between the courseware sizes and the successful conversion time length;
correcting the courseware size of the effective historical courseware to be the same as the courseware size of the target courseware, and determining the successful conversion time length after the effective historical courseware correction according to the change rate;
and taking the average value of the corrected successful conversion durations of the plurality of the effective historical courseware as the successful conversion prediction duration of the target courseware, and taking the product of the successful conversion prediction duration and an adjustment coefficient and the smaller value of a preset maximum value as the maximum conversion duration of the target courseware, wherein the adjustment coefficient is more than 1.
On the basis of the above embodiment, the successful conversion duration after the correction of the effective historical courseware is as follows:
(ii) a Wherein,for the corrected successful transition duration for the ith active history courseware,for the successful transition duration of the ith active history courseware,for the courseware size of the ith active history courseware,the courseware size for the target courseware, and k is the rate of change between courseware size and the length of time of successful transition.
On the basis of the above embodiment, the apparatus further includes: a feedback module; the feedback module is configured to:
if the target course conversion is completed and the difference between the current time and the conversion starting time is less than the maximum conversion time length, determining that the target course is successfully converted, ending the target course, deleting the target course from the conversion queue, and feeding back a conversion success message to the client;
or when the target courseware in the retry queue is successfully converted, feeding back a conversion success message to the client.
On the basis of the above embodiment, the apparatus further includes: a capacity expansion module; the capacity expansion module is used for:
presetting the maximum queue length of the conversion queue;
and if the current queue length of the conversion queue is greater than the maximum queue length, carrying out capacity expansion processing, and transferring part of courseware in the conversion queue to a server after capacity expansion for processing.
In addition, an embodiment of the present invention further provides an electronic device, which includes a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the transceiver, the memory, and the processor are connected via the bus, and when the computer program is executed by the processor, each process of the data conversion processing method embodiment is implemented, and the same technical effect can be achieved, and details are not described here to avoid repetition.
Specifically, referring to fig. 3, an embodiment of the present invention further provides an electronic device, which includes a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150, and a user interface 1160.
In an embodiment of the present invention, the electronic device further includes: a computer program stored on the memory 1150 and executable on the processor 1120, the computer program, when executed by the processor 1120, implementing the various processes of the method embodiments of data conversion processing described above.
A transceiver 1130 for receiving and transmitting data under the control of the processor 1120.
In embodiments of the invention in which a bus architecture (represented by bus 1110) is used, bus 1110 may include any number of interconnected buses and bridges, with bus 1110 connecting various circuits including one or more processors, represented by processor 1120, and memory, represented by memory 1150.
The bus 1110 may also connect various other circuits such as peripherals, voltage regulators, or power management circuits to provide an interface between the bus 1110 and the transceiver 1130, as is well known in the art. Therefore, the embodiments of the present invention will not be further described.
The transceiver 1130 may be one element or may be multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. For example: the transceiver 1130 receives external data from other devices, and the transceiver 1130 transmits data processed by the processor 1120 to other devices. Depending on the nature of the computer system, a user interface 1160 may also be provided, such as: touch screen, physical keyboard, display, mouse, speaker, microphone, trackball, joystick, stylus.
It is to be appreciated that in embodiments of the invention, the memory 1150 may further include memory located remotely with respect to the processor 1120, which may be coupled to a server via a network. One or more portions of the above-described networks may be an ad hoc network (ad hoc network), an intranet (intranet), an extranet (extranet), a Virtual Private Network (VPN), a Local Area Network (LAN), a Wireless Local Area Network (WLAN), a Wide Area Network (WAN), a Wireless Wide Area Network (WWAN), a Metropolitan Area Network (MAN), the Internet (Internet), a Public Switched Telephone Network (PSTN), a plain old telephone service network (POTS), a cellular telephone network, a wireless fidelity (Wi-Fi) network, and combinations of two or more of the above. For example, the cellular telephone network and the wireless network may be a global system for Mobile Communications (GSM) system, a Code Division Multiple Access (CDMA) system, a Worldwide Interoperability for Microwave Access (WiMAX) system, a General Packet Radio Service (GPRS) system, a Wideband Code Division Multiple Access (WCDMA) system, a Long Term Evolution (LTE) system, an LTE Frequency Division Duplex (FDD) system, an LTE Time Division Duplex (TDD) system, a long term evolution-advanced (LTE-a) system, a Universal Mobile Telecommunications (UMTS) system, an enhanced Mobile Broadband (eMBB) system, a mass Machine Type Communication (mtc) system, an Ultra Reliable Low Latency Communication (urrllc) system, or the like.
It is to be understood that the memory 1150 in embodiments of the present invention can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. Wherein the nonvolatile memory includes: Read-Only Memory (ROM), Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or Flash Memory.
The volatile memory includes: random Access Memory (RAM), which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as: static random access memory (Static RAM, SRAM), Dynamic random access memory (Dynamic RAM, DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct memory bus RAM (DRRAM). The memory 1150 of the electronic device described in the embodiments of the invention includes, but is not limited to, the above and any other suitable types of memory.
In an embodiment of the present invention, memory 1150 stores the following elements of operating system 1151 and application programs 1152: an executable module, a data structure, or a subset thereof, or an expanded set thereof.
Specifically, the operating system 1151 includes various system programs such as: a framework layer, a core library layer, a driver layer, etc. for implementing various basic services and processing hardware-based tasks. Applications 1152 include various applications such as: media Player (Media Player), Browser (Browser), for implementing various application services. A program implementing a method of an embodiment of the invention may be included in application program 1152. The application programs 1152 include: applets, objects, components, logic, data structures, and other computer system executable instructions that perform particular tasks or implement particular abstract data types.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements each process of the method embodiment of data conversion processing, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The computer-readable storage medium includes: permanent and non-permanent, removable and non-removable media may be tangible devices that retain and store instructions for use by an instruction execution apparatus. The computer-readable storage medium includes: electronic memory devices, magnetic memory devices, optical memory devices, electromagnetic memory devices, semiconductor memory devices, and any suitable combination of the foregoing. The computer-readable storage medium includes: phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), non-volatile random access memory (NVRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic tape cartridge storage, magnetic tape disk storage or other magnetic storage devices, memory sticks, mechanically encoded devices (e.g., punched cards or raised structures in a groove having instructions recorded thereon), or any other non-transmission medium useful for storing information that may be accessed by a computing device. As defined in embodiments of the present invention, the computer-readable storage medium does not include transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses traveling through a fiber optic cable), or electrical signals transmitted through a wire.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, electronic device and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electrical, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to solve the problem to be solved by the embodiment of the invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be substantially or partially contributed by the prior art, or all or part of the technical solutions may be embodied in a software product stored in a storage medium and including instructions for causing a computer device (including a personal computer, a server, a data center, or other network devices) to execute all or part of the steps of the methods of the embodiments of the present invention. And the storage medium includes various media that can store the program code as listed in the foregoing.
In the description of the embodiments of the present invention, it should be apparent to those skilled in the art that the embodiments of the present invention can be embodied as methods, apparatuses, electronic devices, and computer-readable storage media. Thus, embodiments of the invention may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), a combination of hardware and software. Furthermore, in some embodiments, embodiments of the invention may also be embodied in the form of a computer program product in one or more computer-readable storage media having computer program code embodied in the medium.
The computer-readable storage media described above may take any combination of one or more computer-readable storage media. The computer-readable storage medium includes: an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium include: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only Memory (ROM), an erasable programmable read-only Memory (EPROM), a Flash Memory, an optical fiber, a compact disc read-only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any combination thereof. In embodiments of the invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, device, or apparatus.
The computer program code embodied on the computer readable storage medium may be transmitted using any appropriate medium, including: wireless, wire, fiber optic cable, Radio Frequency (RF), or any suitable combination thereof.
Computer program code for carrying out operations for embodiments of the present invention may be written in assembly instructions, Instruction Set Architecture (ISA) instructions, machine related instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or in one or more programming languages, including an object oriented programming language, such as: java, Smalltalk, C + +, and also include conventional procedural programming languages, such as: c or a similar programming language. The computer program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be over any of a variety of networks, including: a Local Area Network (LAN) or a Wide Area Network (WAN), which may be connected to the user's computer, may be connected to an external computer.
The method, the device and the electronic equipment are described through the flow chart and/or the block diagram.
It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions. These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing apparatus to function in a particular manner. Thus, the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
The above description is only a specific implementation of the embodiments of the present invention, but the scope of the embodiments of the present invention is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the embodiments of the present invention, and all such changes or substitutions should be covered by the scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method of data conversion processing, comprising:
acquiring a target courseware to be converted uploaded by a client, and determining the corresponding maximum conversion time according to the attribute information of the target courseware; the attribute information comprises courseware types and/or courseware sizes;
adding the target courseware to a conversion queue, wherein the conversion queue is a queue in which courseware at the head of the queue can be converted;
when the target courseware is positioned at the head of the conversion queue, generating a target process for converting the target courseware, and determining the starting conversion time of the target courseware;
if the difference between the current time and the conversion starting time is not less than the maximum conversion time and the target process is converting the target courseware, ending the target process, deleting the target courseware from the conversion queue, adding the target courseware to a retry queue different from the conversion queue, and converting the target courseware based on the retry queue;
and if the target course is converted to finish the target courseware and the difference between the current time and the conversion starting time is less than the maximum conversion time length, determining that the target courseware is successfully converted, ending the target course, and deleting the target courseware from the conversion queue.
2. The method of claim 1, wherein the obtaining the target courseware to be converted uploaded by the client comprises:
receiving an uploading request initiated by a client, wherein the uploading request is used for uploading a target courseware to be converted;
and after the target courseware is successfully received, determining to obtain the target courseware, and feeding back an uploading success message to the client.
3. The method of claim 1, wherein determining a corresponding maximum transition time based on the attribute information of the target courseware comprises:
determining historical courseware with the same courseware type as the target courseware, wherein the historical courseware is a courseware which is successfully converted;
taking the historical courseware with the difference value between the courseware size and the courseware size of the target courseware smaller than a preset value as effective historical courseware, performing regression analysis on the courseware sizes of the effective historical courseware and the successful conversion time length, and determining the change rate between the courseware sizes and the successful conversion time length;
correcting the courseware size of the effective historical courseware to be the same as the courseware size of the target courseware, and determining the successful conversion time length after the effective historical courseware correction according to the change rate;
taking the average value of the corrected successful conversion durations of the plurality of effective historical courseware as the successful conversion prediction duration of the target courseware, and taking the product of the successful conversion prediction duration and an adjustment coefficient and the smaller value of a preset maximum value as the maximum conversion duration of the target courseware, wherein the adjustment coefficient is more than 1; wherein, the conversion duration of all courseware can not exceed the preset maximum value.
4. The method of claim 3, wherein the duration of successful transition after the active history courseware modification is:
(ii) a Wherein,for the corrected successful transition duration for the ith active history courseware,for the successful transition duration of the ith active history courseware,for the courseware size of the ith active history courseware,the courseware size for the target courseware, and k is the rate of change between courseware size and the length of time of successful transition.
5. The method of claim 1, further comprising:
if the target courseware in the conversion queue is successfully converted, feeding back a conversion success message to the client;
or when the target courseware in the retry queue is successfully converted, feeding back a conversion success message to the client.
6. The method of any one of claims 1-5, further comprising:
presetting the maximum queue length of the conversion queue;
and if the current queue length of the conversion queue is greater than the maximum queue length, carrying out capacity expansion processing, and transferring part of courseware in the conversion queue to a server after capacity expansion for processing.
7. An apparatus for data conversion processing, comprising:
the acquisition module is used for acquiring the target courseware to be converted uploaded by the client and determining the corresponding maximum conversion time according to the attribute information of the target courseware; the attribute information comprises courseware types and/or courseware sizes;
the adding module is used for adding the target courseware to a conversion queue, and the conversion queue is a queue in which courseware at the head of the queue can be converted;
the conversion module is used for generating a target process for converting the target courseware when the target courseware is positioned at the head of the conversion queue and determining the starting conversion time of the target courseware;
a processing module, configured to, if a difference between the current time and the conversion starting time is not less than the maximum conversion time and the target process is performing conversion processing on the target courseware, end the target process, delete the target courseware from the conversion queue, add the target courseware to a retry queue different from the conversion queue, and convert the target courseware based on the retry queue;
and the feedback module is used for determining that the target courseware is successfully converted, ending the target process and deleting the target courseware from the conversion queue if the target course conversion is completed and the difference between the current time and the conversion starting time is less than the maximum conversion time length.
8. The apparatus of claim 7, wherein the obtaining module obtains the target courseware to be converted uploaded by the client comprises:
receiving an uploading request initiated by a client, wherein the uploading request is used for uploading a target courseware to be converted;
and after the target courseware is successfully received, determining to obtain the target courseware, and feeding back an uploading success message to the client.
9. An electronic device comprising a bus, a transceiver, a memory, a processor and a computer program stored on the memory and executable on the processor, the transceiver, the memory and the processor being connected via the bus, characterized in that the computer program realizes the steps in the method of data conversion processing according to any of claims 1 to 6 when executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps in the method of data conversion processing according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110196102.5A CN112559449B (en) | 2021-02-22 | 2021-02-22 | Data conversion processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110196102.5A CN112559449B (en) | 2021-02-22 | 2021-02-22 | Data conversion processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112559449A CN112559449A (en) | 2021-03-26 |
CN112559449B true CN112559449B (en) | 2021-05-07 |
Family
ID=75036039
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110196102.5A Active CN112559449B (en) | 2021-02-22 | 2021-02-22 | Data conversion processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112559449B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160147579A1 (en) * | 2014-11-26 | 2016-05-26 | Rockwell Automation Technologies, Inc. | Event Generation Management For An Industrial Controller |
CN112183797A (en) * | 2020-09-27 | 2021-01-05 | 广州宸祺出行科技有限公司 | Server restart order dispatching method and system |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109582393B (en) * | 2018-12-06 | 2022-03-15 | 国家电网有限公司 | Network courseware making method and device |
CN110688604A (en) * | 2019-10-24 | 2020-01-14 | 广东力拓网络科技有限公司 | System for editing courseware on line |
CN112364275A (en) * | 2020-11-10 | 2021-02-12 | 平安普惠企业管理有限公司 | Page loading method, device, equipment and storage medium |
-
2021
- 2021-02-22 CN CN202110196102.5A patent/CN112559449B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160147579A1 (en) * | 2014-11-26 | 2016-05-26 | Rockwell Automation Technologies, Inc. | Event Generation Management For An Industrial Controller |
CN112183797A (en) * | 2020-09-27 | 2021-01-05 | 广州宸祺出行科技有限公司 | Server restart order dispatching method and system |
Also Published As
Publication number | Publication date |
---|---|
CN112559449A (en) | 2021-03-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2955713A1 (en) | Synchronous audio playback method, apparatus and system | |
CN112383807B (en) | Online education method and device and electronic equipment | |
US20150117513A1 (en) | Bandwidth reduction system and method | |
CN112422591B (en) | Method and device for transmitting video stream data and electronic equipment | |
CN112565834B (en) | Method and device for controlling output data and electronic equipment | |
CN108495239B (en) | Method, device, equipment and storage medium for accurately and synchronously playing audio among multiple equipment | |
CN110086549B (en) | Audio data transmission method and device | |
US20180103078A1 (en) | System and method for sharing multimedia content with synched playback controls | |
WO2017049766A1 (en) | Method and device for outputting voice information | |
CN110809189A (en) | Video playing method and device, electronic equipment and computer readable medium | |
US20170195384A1 (en) | Video Playing Method and Electronic Device | |
WO2018223966A1 (en) | Bsr transmission method, related device, and system | |
CN110009101B (en) | Method and apparatus for generating a quantized neural network | |
CN113660153A (en) | Message processing method, device, equipment and storage medium | |
CN111263220B (en) | Video processing method and device, electronic equipment and computer readable storage medium | |
CN112559449B (en) | Data conversion processing method and device and electronic equipment | |
CN103152606A (en) | Video file processing method, device and system | |
EP3993430A1 (en) | Method for encoding live broadcast data and electronic device | |
CN113342424A (en) | Method and device for loading H5 resource and electronic equipment | |
CN111478916B (en) | Data transmission method, device and storage medium based on video stream | |
CN113423009B (en) | Video progress adjusting method and device and electronic equipment | |
CN112764709B (en) | Sound card data processing method and device and electronic equipment | |
CN111526381B (en) | Method and device for optimizing live broadcast resources and electronic equipment | |
US20140064695A1 (en) | Apparatus and method for controlling a video | |
CN113934728A (en) | Data processing method, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |