A compiling system and method for Chinese programming language
By calculating and analyzing the compilation evaluation data and difficulty fluctuations of text paragraphs, and performing balanced processing, the problem of long compilation time for existing compilers when processing large-capacity and multi-paragraph text is solved, improving compilation efficiency and meeting the timeliness of users.
Patent Information
- Application Number
- CN202410844254.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-06-27
AI Technical Summary
When existing compilers process large-capacity and multi-paragraph text, the compilation time is long, unable to meet user needs, and cannot reasonably divide the text, resulting in the compilation work being unable to be completed within the preset time.
By obtaining the compilation evaluation data of the paragraph, calculate the total difficulty value of the target text, determine the compilation time estimation, and generate a signal of whether the compilation time is reasonable. Based on the signal of unreasonable compilation time, obtain the difficulty fluctuation value of the text paragraph, conduct judgment and analysis, obtain the text distribution signal, and balance the compilation of the target text to complete the compilation work.
By balancing the difficulty of processing text paragraphs, the compilation efficiency of large-capacity and multi-paragraph texts is improved, so that the compilation work can be completed within a predetermined time to meet the needs of users.
Smart Images

Figure CN118733004B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of compilation technology, and in particular to a compilation system and method for a Chinese programming language. Background Art
[0002] Chinese patent CN114675831 B discloses a compilation system and method for a programming language, which includes an interaction module, a compilation module, a pre-execution module and an execution module. The compilation module and the pre-execution module convert received rule codes into process codes, and then the execution module executes the code to obtain the result, so that the user only needs to input the rule code into the compilation system of the programming language to finally obtain the solution result;
[0003] In the prior art, during the language compilation process, there will be compilation work for large-capacity, multi-paragraph texts. When a specific compiler is used to perform the work, the compilation time will be long and will not meet user needs. In addition, the compiler cannot reasonably divide the text to complete the corresponding compilation work within the preset time. Summary of the invention
[0004] The purpose of the present invention is to provide a compilation system and method for the Chinese programming language. The technical problem solved by the present invention is that when a large-capacity, multi-paragraph text is compiled and a specific compiler is used to perform the work, the compilation time will be long and it does not meet the user's needs.
[0005] The purpose of the present invention can be achieved through the following technical solutions:
[0006] A compiling method for a Chinese programming language comprises the following steps:
[0007] Step 1: Based on the target text, obtain the compilation evaluation data of the paragraph;
[0008] The compilation evaluation data includes the compilation magnitude value and the compilation quality value;
[0009] Step 2: Based on the compiled evaluation data of the paragraphs, obtain the total difficulty value of the target text;
[0010] Step 3: Determine the compilation time estimate based on the total difficulty value of the target text and generate a signal whether the compilation time is reasonable;
[0011] The signal of whether the compilation is reasonable includes a signal of reasonable compilation time and a signal of unreasonable compilation time;
[0012] Step 4: Based on the unreasonable compilation time signal, obtain the difficulty fluctuation value of the text paragraph, and perform judgment analysis to obtain the text distribution signal;
[0013] Step 5: Based on the text distribution signal, the compilation of the target text is balanced to complete the compilation work.
[0014] As a further solution of the present invention: in step 1, the compilation level value is obtained in the following manner:
[0015] Perform paragraph recognition and division on the target text to obtain several groups of text paragraphs;
[0016] Then, based on the divided text paragraphs, the number of words in each text paragraph is obtained and marked as the compilation level value.
[0017] As a further solution of the present invention: the way to obtain the compileability level value is:
[0018] According to the divided text paragraphs, the sentences of each text paragraph are obtained, the number of grammatical types of each sentence is obtained, marked as the compileability level value of each sentence, and the compileability level value of each sentence in the text paragraph is added and summed to obtain the compileability level value.
[0019] As a further solution of the present invention: in step 2, the first difficulty influence value and the second difficulty influence value of the target text are obtained and marked as ZYn1 and ZYn2 respectively, and the total difficulty value ZZN of the target text is calculated by the formula ZZN=a1*ZYn1+a2*ZYn2; wherein a1 and a2 are both weight ratio coefficients.
[0020] As a further solution of the present invention: the process of obtaining the first difficulty impact value of the target text is:
[0021] Obtaining a compilation level value and a compilation level value, adding up the compilation level values corresponding to all paragraphs in the target text, and obtaining a first difficulty impact value of the target text;
[0022] The process of obtaining the second difficulty impact value of the target text is as follows:
[0023] The compilability level values corresponding to all paragraphs in the target text are added together to obtain the second difficulty impact value of the target text.
[0024] As a further solution of the present invention: obtaining a total difficulty value of the target text, and outputting a compilation time estimate based on a preset energy efficiency model;
[0025] Compare the compile time estimate with the preset compile time estimate:
[0026] If the estimated compile time is greater than or equal to the preset estimated compile time, an unreasonable compile time signal is generated;
[0027] If the compile time estimate is less than a preset compile time estimate, a compile time reasonable signal is generated.
[0028] As a further solution of the present invention: when a signal indicating unreasonable compilation time is obtained, the compilation level value and the compilability level value of the same paragraph are obtained, and the sum is added to obtain the difficulty value of the text paragraph;
[0029] The total difficulty value ZZN of the target text is calculated by ratio with the number of divided text paragraphs to obtain the average difficulty value of the target text;
[0030] The difficulty value of each text paragraph is calculated by difference with the difficulty mean of the target text to obtain the difficulty deviation of each text paragraph, and the variance of the difficulty deviation of all text paragraphs is calculated to obtain the difficulty fluctuation value of the text paragraph;
[0031] Comparing the difficulty fluctuation value of the text paragraph with the difficulty fluctuation threshold of the text paragraph;
[0032] If the difficulty fluctuation value of the text paragraph is greater than or equal to the difficulty fluctuation value of the text paragraph, a paragraph difficulty uneven signal is generated;
[0033] If the difficulty fluctuation value of a text paragraph is less than the difficulty fluctuation value of a text paragraph, a paragraph difficulty uniform signal is generated.
[0034] As a further solution of the present invention: based on the uniform signal of paragraph difficulty, the equalization process is:
[0035] Obtaining a compile time estimate and a preset compile time estimate, calculating a ratio of the compile time estimate to the preset compile time estimate to obtain a compile split value;
[0036] And obtain the number of text paragraphs, calculate the ratio of the number of text paragraphs to the compilation segmentation value, and obtain the compilation division value; based on the compilation division value, obtain the paragraph integration value by rounding down, and divide the target text along the paragraph order according to the paragraph integration value to obtain each paragraph to be compiled.
[0037] As a further solution of the present invention: based on the uneven signal of paragraph difficulty, the equalization process is as follows:
[0038] Merge all the paragraphs in the target text to get the whole text;
[0039] Obtaining a compile time estimate and a preset compile time estimate, calculating a ratio of the compile time estimate to the preset compile time estimate to obtain a compile node value;
[0040] Then obtain the total difficulty value ZZN of the target text, calculate the ratio of the total difficulty value ZZN of the target text to the compilation node value, and obtain the segment difficulty standard value;
[0041] According to the standard value of segment difficulty, the entire text is re-divided into paragraphs to obtain the paragraphs to be compiled.
[0042] A compilation system for Chinese programming language, the system comprising:
[0043] Text collection module: based on the target text, obtains paragraph compilation evaluation data;
[0044] The compilation evaluation data includes the compilation magnitude value and the compilation quality value;
[0045] Text analysis module: based on the compiled evaluation data of the paragraphs, obtain the total difficulty value of the target text;
[0046] Reasonable judgment module: The total difficulty value of the target text determines the compilation time estimate and generates a signal whether the compilation time is reasonable;
[0047] The signal of whether the compilation is reasonable includes a signal of reasonable compilation time and a signal of unreasonable compilation time;
[0048] Text distribution module: Based on the unreasonable compilation time signal, obtain the difficulty fluctuation value of the text paragraph, and perform judgment analysis to obtain the text distribution signal;
[0049] Text equalization module: Based on the text distribution signal, the compilation of the target text is equalized to complete the compilation work.
[0050] Beneficial effects of the present invention:
[0051] The present invention obtains paragraph compilation evaluation data based on the target text; obtains the total difficulty value of the target text based on the paragraph compilation evaluation data; determines the compilation time estimation based on the total difficulty value of the target text, and generates a signal whether the compilation time is reasonable; the present invention divides the text content into paragraphs, and then performs quantitative and qualitative analysis based on the words and grammar of each paragraph to obtain the compilation difficulty for evaluating the target text (the compilation difficulty refers to the time-consuming compilation during the compilation process), thereby evaluating the compilation time of the target text to determine whether it meets the user's needs;
[0052] The present invention obtains the difficulty fluctuation value of the text paragraph based on the unreasonable signal of the compilation time, and performs judgment and analysis to obtain the text distribution signal; based on the text distribution signal, the compilation of the target text is balanced to complete the compilation work; based on the situation that the compiler cannot complete the compilation work of the target file within the predetermined time, the present invention divides the paragraph difficulty of the target file, so that the target text is balancedly re-divided into paragraphs, and the corresponding number of compilers are matched according to the number of re-divided paragraphs, and each re-divided paragraph is compiled simultaneously, so that the target file can complete the compilation process within the predetermined time, and the premise of the simultaneous compilation is not to change the target text order and to ensure that the compilation difficulty of each new paragraph is similar, thereby greatly improving the efficiency of the compilation work of large-capacity and multi-paragraph texts. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The present invention will be further described below in conjunction with the accompanying drawings.
[0054] Figure 1 is a flowchart of Embodiment 1 of the present invention;
[0055] Figure 2 is a flowchart of Embodiment 2 of the present invention;
[0056] Figure 3 It is a system block diagram of embodiment 3 of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] Example 1
[0059] See also Figure 1 As shown, the present invention is a compilation system and method of a Chinese programming language, comprising the following steps:
[0060] Step 1: Based on the target text, obtain the compilation evaluation data of the paragraph;
[0061] The compilation evaluation data includes the compilation magnitude value and the compilation quality value;
[0062] In some implementation schemes, paragraph recognition and division are performed on the target text to obtain a plurality of groups of text paragraphs;
[0063] Then, according to the divided text paragraphs, the number of words in each text paragraph is obtained and marked as the compilation level value;
[0064] And, according to the divided text paragraphs, obtain the sentences of each text paragraph, obtain the number of grammatical types of each sentence, mark them as the compilability level value of each sentence, add and sum the compilability level values of each sentence in the text paragraph, and obtain the compilability level value;
[0065] What needs to be explained is that: grammar includes tense, voice, and mood;
[0066] For example, if a sentence in a text paragraph includes two tenses, three voices, and one mood, the compilability level of the sentence is 6 (i.e., 2+3+1=6);
[0067] When the current Chinese programming language compiler is compiling, the number of words that need to be compiled and the grammatical complexity of the compiled words and sentences will affect the efficiency of the compiler, resulting in a long time required;
[0068] Step 2: Based on the compiled evaluation data of the paragraphs, obtain the total difficulty value of the target text;
[0069] In some implementation schemes, the compilation level value and the compilability level value are obtained, and the compilation level values corresponding to all paragraphs in the target text are added together to obtain a first difficulty impact value of the target text;
[0070] Add up the translation level values corresponding to all paragraphs in the target text to obtain the second difficulty impact value of the target text;
[0071] The first difficulty influence value and the second difficulty influence value of the target text are obtained, and marked as ZYn1 and ZYn2 respectively. The total difficulty value ZZN of the target text is calculated by the formula ZZN=a1*ZYn1+a2*ZYn2; wherein a1 and a2 are weight ratio coefficients, a1+a2=1, a1 is 0.14, a2 is 0.86, and the values of a1 and a2 represent the proportion of the first difficulty influence value and the second difficulty influence value to the total difficulty value of the target text;
[0072] What needs to be solved is: the first difficulty impact value of the target text, which reflects the translation difficulty of the compiler from the total number of words that the Chinese programming language compiler needs to compile and process during the compilation work, that is, the greater the first difficulty impact value, the greater the total difficulty value of the target text;
[0073] The second difficulty impact value of the target text reflects the translation difficulty of the compiler, which is based on the complexity of words that the compiler of the Chinese programming language needs to compile and process during compilation. That is, the larger the second difficulty impact value, the greater the total difficulty value of the target text;
[0074] Step 3: The total difficulty value of the target text is used to determine the compilation time estimate and generate a signal whether the compilation time is reasonable;
[0075] The signal of whether the compilation is reasonable includes a signal of reasonable compilation time and a signal of unreasonable compilation time;
[0076] In some implementation schemes, a total difficulty value of the target text is obtained, and a compilation time estimate is output based on a preset energy efficiency model;
[0077] Compare the compile time estimate with the preset compile time estimate:
[0078] If the estimated compile time is greater than or equal to the preset estimated compile time, an unreasonable compile time signal is generated;
[0079] If the compilation time estimate is less than the preset compilation time estimate, a compilation time reasonableness signal is generated;
[0080] Specifically, the construction process of the preset energy efficiency model is as follows:
[0081] With the compilation completion time as the X-axis and the total difficulty value of the target text as the Y-axis, a two-dimensional coordinate system is constructed, the compilation completion time and the total difficulty value obtained in the compiler experiment phase of compiling the Chinese programming language are substituted into the two-dimensional coordinate system, and a curve is drawn to obtain a preset energy efficiency model;
[0082] The default compile time estimate is set as follows:
[0083] It can be set according to the needs of the user, for example, the user can set it to 3min, 6min, 8min, etc. according to the progress of the project;
[0084] It should be explained that the unreasonable compilation time signal means that the current target text takes a long time to be processed through the compilation work, which exceeds the time requirement set by the user, that is, the target text is unreasonable in terms of timeliness and does not meet the needs of the user;
[0085] The signal of reasonable compilation time indicates that the current target text takes a short time to be processed through the compilation work and does not exceed the time requirement set by the user, that is, the target text is reasonable in terms of timeliness and meets the needs of the user;
[0086] The technical solution of the embodiment of the present invention is as follows: based on the target text, obtaining the compilation evaluation data of the paragraph; based on the compilation evaluation data of the paragraph, obtaining the total difficulty value of the target text; the total difficulty value of the target text is used to determine the compilation time estimation, and to generate a signal whether the compilation time is reasonable; the present invention divides the text content into paragraphs, and then performs quantitative and qualitative analysis based on the words and grammar of each paragraph to obtain the compilation difficulty for evaluating the target text (the compilation difficulty refers to the time-consuming compilation during the compilation process), thereby evaluating the compilation time of the target text to determine whether it meets the user's needs.
[0087] Example 2
[0088] See also Figure 2 As shown, the present invention is a compilation system and method of a Chinese programming language, comprising the following steps:
[0089] Step 4: Based on the unreasonable compilation time signal, obtain the difficulty fluctuation value of the text paragraph, and perform judgment analysis to obtain the text distribution signal;
[0090] In some implementation schemes, when an unreasonable compilation time signal is obtained, the compilation level value and the compilability level value of the same paragraph are obtained, and the sum is added to obtain the difficulty value of the text paragraph;
[0091] The total difficulty value ZZN of the target text is calculated by ratio with the number of divided text paragraphs to obtain the average difficulty value of the target text;
[0092] The difficulty value of each text paragraph is calculated by difference with the difficulty mean of the target text to obtain the difficulty deviation of each text paragraph, and the variance of the difficulty deviation of all text paragraphs is calculated to obtain the difficulty fluctuation value of the text paragraph;
[0093] Comparing the difficulty fluctuation value of the text paragraph with the difficulty fluctuation threshold of the text paragraph;
[0094] If the difficulty fluctuation value of a text paragraph is greater than or equal to the difficulty fluctuation value of a text paragraph, it means that the difficulty levels of the target text paragraphs are not similar during the translation process, and the time consumption is uneven, so an uneven paragraph difficulty signal is generated;
[0095] If the difficulty fluctuation value of a text paragraph is less than the difficulty fluctuation value of a text paragraph, it means that the difficulty levels of the target text paragraphs are similar and the translation time is uniform, so a uniform paragraph difficulty signal is generated;
[0096] Step 5: Based on the text distribution signal, the compilation of the target text is balanced to complete the compilation work;
[0097] In some embodiments, based on the paragraph difficulty average signal, the equalization process is:
[0098] Obtaining a compile time estimate and a preset compile time estimate, calculating a ratio of the compile time estimate to the preset compile time estimate to obtain a compile split value;
[0099] and obtaining the number of text paragraphs, calculating the ratio of the number of text paragraphs to the compilation segmentation value to obtain the compilation division value; based on the compilation division value, obtaining the paragraph integration value by rounding down, and dividing the target text along the paragraph order according to the paragraph integration value to obtain each paragraph to be compiled;
[0100] For example, if the number of text paragraphs is 35, the compilation segmentation value is 8.4, and 35 / 8.4≈4.17, that is, the compilation division value is 4.17, and by rounding down, the paragraph integration value is 4, and every 5 paragraphs are taken as a whole, 9 paragraphs to be compiled are obtained, and the last paragraph to be compiled includes paragraphs 33-35;
[0101] Based on the uneven signal of paragraph difficulty, the equalization process is:
[0102] Merge all the paragraphs in the target text to get the whole text;
[0103] Obtaining a compile time estimate and a preset compile time estimate, calculating a ratio of the compile time estimate to the preset compile time estimate to obtain a compile node value;
[0104] Then obtain the total difficulty value ZZN of the target text, calculate the ratio of the total difficulty value ZZN of the target text to the compilation node value, and obtain the segment difficulty standard value;
[0105] According to the segment difficulty standard value, the entire text is re-divided into paragraphs to obtain each paragraph to be compiled (that is, the compilation difficulty of each paragraph to be compiled is the same, and the time consumed for compilation will also be the same);
[0106] Based on the above obtained sections to be compiled, a corresponding compiler is matched to compile each section to be compiled simultaneously;
[0107] The technical solution of the embodiment of the present invention is as follows: based on the unreasonable signal of compilation time, the difficulty fluctuation value of the text paragraph is obtained, and judgment and analysis are performed to obtain the text distribution signal; based on the text distribution signal, the compilation of the target text is balanced to complete the compilation work; based on the situation that the compiler cannot complete the compilation work of the target file within the predetermined time, the paragraph difficulty of the target file is divided, so that the target text is balancedly re-divided into paragraphs, and the corresponding number of compilers are matched according to the number of re-divided paragraphs, and each re-divided paragraph is compiled simultaneously, so that the target file can complete the compilation process within the predetermined time, and the premise of the simultaneous compilation is not to change the target text order and to ensure that the compilation difficulty of each new paragraph is similar, thereby greatly improving the efficiency of the compilation work of large-capacity, multi-paragraph text.
[0108] Example 3
[0109] See also Figure 1 As shown, the present invention is a compilation system for a Chinese programming language, the system comprising:
[0110] Text collection module: perform paragraph recognition and division on the target text to obtain several groups of text paragraphs;
[0111] Then, according to the divided text paragraphs, the number of words in each text paragraph is obtained and marked as the compilation level value;
[0112] And, according to the divided text paragraphs, obtain the sentences of each text paragraph, obtain the number of grammatical types of each sentence, mark them as the compilability level value of each sentence, add and sum the compilability level values of each sentence in the text paragraph, and obtain the compilability level value;
[0113] Text analysis module: obtains the compilation level value and the compilation level value, adds up the compilation level values corresponding to all paragraphs in the target text, and obtains the first difficulty impact value of the target text;
[0114] Add up the translation level values corresponding to all paragraphs in the target text to obtain the second difficulty impact value of the target text;
[0115] The first difficulty influence value and the second difficulty influence value of the target text are obtained, and marked as ZYn1 and ZYn2 respectively. The total difficulty value ZZN of the target text is calculated by the formula ZZN=a1*ZYn1+a2*ZYn2; wherein a1 and a2 are weight ratio coefficients, a1+a2=1, a1 is 0.14, a2 is 0.86, and the values of a1 and a2 represent the proportion of the first difficulty influence value and the second difficulty influence value to the total difficulty value of the target text;
[0116] Reasonable judgment module: obtains the total difficulty value of the target text, and outputs the compilation time estimate based on the preset energy efficiency model;
[0117] Compare the compile time estimate with the preset compile time estimate:
[0118] If the estimated compile time is greater than or equal to the preset estimated compile time, an unreasonable compile time signal is generated;
[0119] If the compilation time estimate is less than the preset compilation time estimate, a compilation time reasonableness signal is generated;
[0120] Text distribution module: When an unreasonable compilation time signal is obtained, the compilation level value and compilation level value of the same paragraph are obtained, and the sum is added to obtain the difficulty value of the text paragraph;
[0121] The total difficulty value ZZN of the target text is calculated by ratio with the number of divided text paragraphs to obtain the average difficulty value of the target text;
[0122] The difficulty value of each text paragraph is calculated by difference with the difficulty mean of the target text to obtain the difficulty deviation of each text paragraph, and the variance of the difficulty deviation of all text paragraphs is calculated to obtain the difficulty fluctuation value of the text paragraph;
[0123] Comparing the difficulty fluctuation value of the text paragraph with the difficulty fluctuation threshold of the text paragraph;
[0124] If the difficulty fluctuation value of a text paragraph is greater than or equal to the difficulty fluctuation value of a text paragraph, it means that the difficulty levels of the target text paragraphs are not similar during the translation process, and the time consumption is uneven, so an uneven paragraph difficulty signal is generated;
[0125] If the difficulty fluctuation value of a text paragraph is less than the difficulty fluctuation value of a text paragraph, it means that the difficulty levels of the target text paragraphs are similar and the translation time is uniform, so a uniform paragraph difficulty signal is generated;
[0126] Text equalization module: Based on the paragraph difficulty uniformity signal, the equalization process is as follows:
[0127] Obtaining a compile time estimate and a preset compile time estimate, calculating a ratio of the compile time estimate to the preset compile time estimate to obtain a compile split value;
[0128] and obtaining the number of text paragraphs, calculating the ratio of the number of text paragraphs to the compilation segmentation value to obtain the compilation division value; based on the compilation division value, obtaining the paragraph integration value by rounding down, and dividing the target text along the paragraph order according to the paragraph integration value to obtain each paragraph to be compiled;
[0129] Based on the uneven signal of paragraph difficulty, the equalization process is:
[0130] Merge all the paragraphs in the target text to get the whole text;
[0131] Obtaining a compile time estimate and a preset compile time estimate, calculating a ratio of the compile time estimate to the preset compile time estimate, and obtaining a compile node value;
[0132] Then obtain the total difficulty value ZZN of the target text, calculate the ratio of the total difficulty value ZZN of the target text to the compilation node value, and obtain the segment difficulty standard value;
[0133] According to the segment difficulty standard value, the entire text is re-divided into paragraphs to obtain each paragraph to be compiled (that is, the compilation difficulty of each paragraph to be compiled is the same, and the time consumed for compilation will also be the same);
[0134] Based on the above obtained sections to be compiled, a corresponding compiler is matched to compile each section to be compiled simultaneously.
[0135] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0136] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A compiling method for a Chinese programming language, characterized in that: The following steps are involved: Step 1: Based on the target text, obtain the compilation evaluation data of the paragraph; The compilation evaluation data includes the compilation magnitude value and the compilation quality value; Step 2: Based on the compiled evaluation data of the paragraphs, obtain the total difficulty value of the target text; Step 3: Determine the compilation time estimate based on the total difficulty value of the target text and generate a signal whether the compilation time is reasonable; The signal of whether the compilation is reasonable includes a signal of reasonable compilation time and a signal of unreasonable compilation time; Step 4: Based on the unreasonable compilation time signal, obtain the difficulty fluctuation value of the text paragraph, and perform judgment analysis to obtain the text distribution signal; Step 5: Based on the text distribution signal, the compilation of the target text is balanced to complete the compilation work; In step 1, the compilation level value is obtained as follows: Perform paragraph recognition and division on the target text to obtain several groups of text paragraphs; Then, according to the divided text paragraphs, the number of words in each text paragraph is obtained and marked as the compilation level value; The way to obtain the compile level value is: According to the divided text paragraphs, sentences in each text paragraph are obtained, the number of grammatical types of each sentence is obtained, and the number of grammatical types of each sentence is marked as the compilability level value of each sentence, and the compilability level value of each sentence in the text paragraph is added and summed to obtain the compilability level value; In step 2, the first difficulty influence value and the second difficulty influence value of the target text are obtained and marked as ZYn1 and ZYn2 respectively, and the total difficulty value ZZN of the target text is calculated by the formula ZZN=a1*ZYn1+a2*ZYn2; wherein a1 and a2 are weight ratio coefficients; The process of obtaining the first difficulty impact value of the target text is as follows: Obtaining a compilation level value and a compilation level value, adding up the compilation level values corresponding to all paragraphs in the target text, and obtaining a first difficulty impact value of the target text; The process of obtaining the second difficulty impact value of the target text is as follows: The compilability level values corresponding to all paragraphs in the target text are added together to obtain the second difficulty impact value of the target text.
2. The compiling method of a Chinese programming language according to claim 1, characterized in that: In step 3, the total difficulty value of the target text is obtained, and the compilation time estimation is output based on the preset energy efficiency model; Compare the compile time estimate with the preset compile time estimate: If the estimated compile time is greater than or equal to the preset estimated compile time, an unreasonable compile time signal is generated; If the compile time estimate is less than a preset compile time estimate, a compile time reasonable signal is generated.
3. The compiling method of a Chinese programming language according to claim 1, characterized in that: In step 4, when a signal indicating unreasonable compilation time is obtained, the compilation level value and the compilation level value of the same paragraph are obtained, and the sum is added to obtain the difficulty value of the text paragraph; The total difficulty value ZZN of the target text is calculated by ratio with the number of divided text paragraphs to obtain the average difficulty value of the target text; The difficulty value of each text paragraph is calculated by difference with the difficulty mean of the target text to obtain the difficulty deviation of each text paragraph, and the variance of the difficulty deviation of all text paragraphs is calculated to obtain the difficulty fluctuation value of the text paragraph; Comparing the difficulty fluctuation value of the text paragraph with the difficulty fluctuation threshold of the text paragraph; If the difficulty fluctuation value of the text paragraph is greater than or equal to the difficulty fluctuation value of the text paragraph, a paragraph difficulty uneven signal is generated; If the difficulty fluctuation value of a text paragraph is less than the difficulty fluctuation value of a text paragraph, a paragraph difficulty uniform signal is generated.
4. The compiling method of a Chinese programming language according to claim 1, characterized in that: In step 5, based on the paragraph difficulty uniformity signal, the equalization process is: Obtaining a compile time estimate and a preset compile time estimate, calculating a ratio of the compile time estimate to the preset compile time estimate to obtain a compile split value; and obtaining the number of text paragraphs, calculating the ratio of the number of text paragraphs to the compilation segmentation value to obtain the compilation segmentation value; Based on the compilation division value, a paragraph integration value is obtained by rounding down. According to the paragraph integration value, the target text is divided along the paragraph sequence to obtain each paragraph to be compiled.
5. The compiling method of a Chinese programming language according to claim 4, characterized in that: Based on the uneven signal of paragraph difficulty, the equalization process is: Merge all the paragraphs in the target text to get the whole text; Obtaining a compile time estimate and a preset compile time estimate, calculating a ratio of the compile time estimate to the preset compile time estimate to obtain a compile node value; Then obtain the total difficulty value ZZN of the target text, calculate the ratio of the total difficulty value ZZN of the target text to the compilation node value, and obtain the segment difficulty standard value; According to the standard value of segment difficulty, the entire text is re-divided into paragraphs to obtain the paragraphs to be compiled.
6. A compilation system for Chinese programming language, characterized in that: The system is used to execute the method described in any one of claims 1 to 5, and the system comprises: Text collection module: based on the target text, obtains paragraph compilation evaluation data; The compilation evaluation data includes the compilation magnitude value and the compilation quality value; The compilation level value is obtained as follows: Perform paragraph recognition and division on the target text to obtain several groups of text paragraphs; Then, according to the divided text paragraphs, the number of words in each text paragraph is obtained and marked as the compilation level value; The way to obtain the compile level value is: According to the divided text paragraphs, sentences in each text paragraph are obtained, the number of grammatical types of each sentence is obtained, and the number of grammatical types of each sentence is marked as the compilability level value of each sentence, and the compilability level value of each sentence in the text paragraph is added and summed to obtain the compilability level value; Text analysis module: based on the compiled evaluation data of the paragraphs, obtain the total difficulty value of the target text; Obtain the first difficulty influence value and the second difficulty influence value of the target text, and mark them as ZYn1 and ZYn2 respectively, and calculate the total difficulty value ZZN of the target text by the formula ZZN=a1*ZYn1+a2*ZYn2; wherein a1 and a2 are weight ratio coefficients; The process of obtaining the first difficulty impact value of the target text is as follows: Obtaining a compilation level value and a compilation level value, adding up the compilation level values corresponding to all paragraphs in the target text, and obtaining a first difficulty impact value of the target text; The process of obtaining the second difficulty impact value of the target text is as follows: Add up the translation level values corresponding to all paragraphs in the target text to obtain the second difficulty impact value of the target text; Reasonable judgment module: The total difficulty value of the target text determines the compilation time estimate and generates a signal whether the compilation time is reasonable; The signal of whether the compilation is reasonable includes a signal of reasonable compilation time and a signal of unreasonable compilation time; Text distribution module: Based on the unreasonable compilation time signal, obtain the difficulty fluctuation value of the text paragraph, and perform judgment analysis to obtain the text distribution signal; Text equalization module: Based on the text distribution signal, the compilation of the target text is equalized to complete the compilation work.
Citation Information
Patent Citations
A compilation system and method for a programming language
CN114675831B
Computer system with Chinese programming monolithic processor
CN1100543A
XML text data translation method and device, electronic equipment and storage medium
CN113378585A