CN112486843A - Data processing method and device, electronic equipment and computer storage medium - Google Patents

Data processing method and device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN112486843A
CN112486843A CN202011497102.0A CN202011497102A CN112486843A CN 112486843 A CN112486843 A CN 112486843A CN 202011497102 A CN202011497102 A CN 202011497102A CN 112486843 A CN112486843 A CN 112486843A
Authority
CN
China
Prior art keywords
code
submitted
hash value
time
hash
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.)
Pending
Application number
CN202011497102.0A
Other languages
Chinese (zh)
Inventor
王祥
张亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202011497102.0A priority Critical patent/CN112486843A/en
Publication of CN112486843A publication Critical patent/CN112486843A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler

Abstract

The application provides a data processing method, a data processing device, electronic equipment and a computer storage medium, wherein the method comprises the following steps: acquiring at least one code to be submitted; then, calculating to obtain the hash value of each code to be submitted; judging whether the hash value of each code to be submitted is in a hash library or not; the hash library comprises at least one hash value and an execution result corresponding to each hash value; if the hash value of the code to be submitted is judged to be in the hash library, feeding back an execution result corresponding to the hash value of the code to be submitted; and if the hash value of the code to be submitted is judged not to be in the hash library, executing the code to be submitted in a code execution queue to generate an execution result for executing the code to be submitted. The method achieves the aim of quickly processing the code to be submitted.

Description

Data processing method and device, electronic equipment and computer storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus, an electronic device, and a computer storage medium.
Background
At present, the programming test and evaluation are usually performed by an Online programming evaluation system (OJ). The online programming evaluation system compiles and runs codes submitted by users, compares the codes with standard input and output cases, and determines obtained scores.
As a user may repeatedly submit a large amount of similar and invalid codes in the examination and test processes, a large amount of resources of the online programming evaluation system are occupied, the system runs slowly, and the normal operation of the online programming evaluation system is influenced.
Disclosure of Invention
In view of this, the present application provides a data processing method, an apparatus, an electronic device, and a computer storage medium, which are used to quickly process a code that needs to be submitted.
A first aspect of the present application provides a data processing method, including:
acquiring at least one code to be submitted;
calculating to obtain a hash value of each code to be submitted;
judging whether the hash value of each code to be submitted is in a hash library or not; the hash library comprises at least one hash value and an execution result corresponding to each hash value;
if the hash value of the code to be submitted is judged to be in the hash library, feeding back an execution result corresponding to the hash value of the code to be submitted;
and if the hash value of the code to be submitted is judged not to be in the hash library, executing the code to be submitted in a code execution queue, and generating an execution result for executing the code to be submitted.
Optionally, before executing the code to be submitted in the code execution queue and generating an execution result of executing the code to be submitted, the method further includes:
judging whether each code to be submitted is a code submitted for the first time aiming at the target title; the target topic is a topic to which the code to be submitted belongs;
if the code to be submitted is judged to be the code submitted for the first time aiming at the target title, recording the time of the code to be submitted, and setting the quality parameter of the code to be submitted as an initial value;
if the code to be submitted is judged not to be the code submitted for the first time aiming at the target subject, setting the quality parameter of the code to be submitted according to the code to be submitted and the code submitted for the target subject at the last time;
wherein the executing the code to be submitted in the queue and generating an execution result of executing the code to be submitted includes:
and sequentially executing each code to be submitted according to the quality parameter of each code to be submitted, and generating an execution result of each code to be submitted.
Optionally, the setting, according to the code to be submitted and the code submitted for the target topic last time, a quality parameter of the code to be submitted includes:
comparing the code to be submitted with the code submitted for the target subject last time, and determining the degree of change of the code to be submitted and the code submitted for the target subject last time;
setting quality parameters of the codes to be submitted according to the change degree; wherein, the higher the degree of change is, the larger the quality parameter of the code to be submitted is; the smaller the degree of change, the smaller the quality parameter of the code to be submitted.
Optionally, the setting, according to the code to be submitted and the code submitted for the target topic last time, a quality parameter of the code to be submitted includes:
inquiring the interval time between the code to be submitted and the last submitted code aiming at the target title;
setting quality parameters of the codes to be submitted according to the interval time; wherein the longer the interval time is, the larger the quality parameter of the code to be submitted is; the shorter the interval time is, the smaller the quality parameter of the code to be submitted is.
Optionally, the setting, according to the code to be submitted and the code submitted for the target topic last time, a quality parameter of the code to be submitted includes:
comparing the code to be submitted with the code submitted for the target subject last time, and determining the degree of change of the code to be submitted and the code submitted for the target subject last time;
inquiring the interval time between the code to be submitted and the last submitted code aiming at the target title;
setting quality parameters of the codes to be submitted according to the change degrees and the interval time; wherein, the higher the degree of change is, and the longer the interval time is, the larger the quality parameter of the code to be submitted is; the smaller the change degree is, and the shorter the interval time is, the smaller the quality parameter of the code to be submitted is; the change degree is high, but the interval time is short, and the quality parameter of the code to be submitted is set according to the change degree; the change degree is small, but the interval time is long, and the quality parameter of the code to be submitted is set according to the time interval.
Optionally, the to-be-submitted code includes a time parameter, where the time parameter is used to indicate the latest submission time of the to-be-submitted code, and the executing step is to sequentially execute each of the to-be-submitted codes according to the quality parameter of each of the to-be-submitted codes, and generate an execution result of each of the to-be-submitted codes, and includes:
inquiring the time parameter of each code to be submitted in the code execution queue at preset time intervals;
and preferentially executing the code to be submitted which is about to reach the latest submission time in the code execution queue, and generating an execution result of the code to be submitted which is about to reach the latest submission time.
Optionally, after the executing the code to be submitted in the code execution queue and generating the execution result of executing the code to be submitted, the method further includes:
and storing the hash value of the code to be submitted and the execution result of the code to be submitted into the hash library.
A second aspect of the present application provides a data processing apparatus, including:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring at least one code to be submitted;
the calculation unit is used for calculating and obtaining the hash value of each code to be submitted;
the first judgment unit is used for judging whether the hash value of each code to be submitted is in a hash library or not; the hash library comprises at least one hash value and an execution result corresponding to each hash value;
the feedback unit is used for feeding back an execution result corresponding to the hash value of the code to be submitted in the hash library if the first judgment unit judges that the hash value of the code to be submitted is in the hash library;
and the generating unit is used for executing the code to be submitted in a code execution queue if the first judging unit judges that the hash value of the code to be submitted is not in the hash library, and generating an execution result for executing the code to be submitted.
Optionally, the data processing apparatus further includes:
the second judging unit is used for judging whether each code to be submitted is a code submitted for the first time aiming at the target title; the target topic is a topic to which the code to be submitted belongs;
a recording unit, configured to record a time of a code to be submitted and set a quality parameter of the code to be submitted as an initial value if the second determination unit determines that the code to be submitted is a code submitted for the first time for the target title;
a setting unit, configured to set a quality parameter of the code to be submitted according to the code to be submitted and a code submitted last time for the target topic if the code to be submitted is not the code submitted first time for the target topic, which is judged by the second judging unit;
wherein the generating unit is configured to:
and sequentially executing each code to be submitted according to the quality parameter of each code to be submitted, and generating an execution result of each code to be submitted.
Optionally, the setting unit includes:
the first determining unit is used for comparing the code to be submitted with the code submitted for the target subject last time and determining the degree of change of the code to be submitted with the code submitted for the target subject last time;
the first setting subunit is used for setting the quality parameter of the code to be submitted according to the change degree; wherein, the higher the degree of change is, the larger the quality parameter of the code to be submitted is; the smaller the degree of change, the smaller the quality parameter of the code to be submitted.
Optionally, the setting unit includes:
the first query unit is used for querying the interval time between the code to be submitted and the code submitted for the target topic at the last time;
the second setting subunit is used for setting the quality parameters of the codes to be submitted according to the interval time; wherein the longer the interval time is, the larger the quality parameter of the code to be submitted is; the shorter the interval time is, the smaller the quality parameter of the code to be submitted is.
Optionally, the setting unit includes:
the second determining unit is used for comparing the code to be submitted with the code submitted for the target subject last time and determining the degree of change of the code to be submitted with the code submitted for the target subject last time;
the second query unit is used for querying the interval time between the code to be submitted and the code submitted for the target topic at the last time;
the third setting subunit is used for setting the quality parameters of the codes to be submitted according to the change degrees and the interval time; wherein, the higher the degree of change is, and the longer the interval time is, the larger the quality parameter of the code to be submitted is; the smaller the change degree is, and the shorter the interval time is, the smaller the quality parameter of the code to be submitted is; the change degree is high, but the interval time is short, and the quality parameter of the code to be submitted is set according to the change degree; the change degree is small, but the interval time is long, and the quality parameter of the code to be submitted is set according to the time interval.
Optionally, the code to be submitted includes a time parameter, where the time parameter is used to indicate the latest submission time of the code to be submitted, and the generating unit includes:
the third query unit is used for querying the time parameter of each code to be submitted in the code execution queue at preset time intervals;
and the generating subunit is used for preferentially executing the code to be submitted which is to reach the latest submission time in the code execution queue and generating an execution result of the code to be submitted which is to reach the latest submission time.
Optionally, the data processing apparatus further includes:
and the storage unit is used for storing the hash value of the code to be submitted and the execution result of the code to be submitted into the hash library.
A third aspect of the present application provides an electronic device comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of the first aspects.
A fourth aspect of the present application provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of the first aspect.
According to the scheme, in the data processing method, the data processing device, the electronic equipment and the computer storage medium, the processing method obtains at least one code to be submitted; then calculating to obtain the hash value of each code to be submitted; judging whether the hash value of each code to be submitted is in a hash library or not; the hash library comprises at least one hash value and an execution result corresponding to each hash value; if the hash value of the code to be submitted is judged to be in the hash library, feeding back an execution result corresponding to the hash value of the code to be submitted; and if the hash value of the code to be submitted is judged not to be in the hash library, executing the code to be submitted in a code execution queue to generate an execution result for executing the code to be submitted. The method achieves the aim of quickly processing the code to be submitted.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a detailed flowchart of a data processing method according to an embodiment of the present application;
fig. 2 is a detailed flowchart of a data processing method according to another embodiment of the present application;
fig. 3 is a detailed flowchart of a data processing method according to another embodiment of the present application;
fig. 4 is a detailed flowchart of a data processing method according to another embodiment of the present application;
fig. 5 is a detailed flowchart of a data processing method according to another embodiment of the present application;
fig. 6 is a detailed flowchart of a data processing method according to another embodiment of the present application;
fig. 7 is a schematic diagram of a data processing apparatus according to another embodiment of the present application;
fig. 8 is a schematic diagram of a data processing apparatus according to another embodiment of the present application;
fig. 9 is a schematic view of an electronic device implementing a data processing method according to another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first", "second", and the like, referred to in this application, are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence of functions performed by these devices, modules or units, but the terms "include", or any other variation thereof are intended to cover a non-exclusive inclusion, so that a process, method, article, or apparatus that includes a series of elements includes not only those elements but also other elements that are not explicitly listed, or includes elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
An embodiment of the present application provides a data processing method, as shown in fig. 1, which specifically includes the following steps:
s101, obtaining at least one code to be submitted.
It should be noted that the obtained at least one code to be submitted may be multiple codes to be submitted that are uploaded by the same user, or multiple codes to be submitted that are uploaded by different users, which is not limited herein.
It should be further noted that the system can identify the user to which each code to be submitted belongs according to the user identifier; and the title identifier, the purpose identifier, etc. identify the type of each code to be submitted, which is not limited herein.
And S102, calculating to obtain the hash value of each code to be submitted.
It should be noted that, but not limited to, each code to be submitted may be calculated by a preset hash algorithm to obtain a hash value of each code to be submitted.
S103, judging whether the hash value of each code to be submitted is in the hash library.
The hash library comprises at least one hash value and an execution result corresponding to each hash value.
It should be noted that, the manner of determining whether the hash value of each code to be submitted is in the hash library may be, but is not limited to, querying whether the hash value of the code to be submitted exists in the hash library.
Specifically, for the hash value of each code to be submitted, whether the hash value of the code to be submitted is in the hash library is judged, and if the hash value of the code to be submitted is in the hash library, the step S104 is executed; if the hash value of the code to be submitted is not in the hash library, step S105 is executed.
And S104, feeding back an execution result corresponding to the hash value of the code to be submitted.
It should be noted that, because the hash value of the code to be submitted is in the hash library, and according to the consistency of the hash algorithm, it is indicated that the user has submitted the code before, the code does not need to be executed again in the code execution queue, and the execution result of the code submitted before is directly fed back.
It can be understood that the user who previously submitted the code is not necessarily the user who submitted the code to be submitted this time.
Specifically, the execution result corresponding to the hash value of the code to be submitted is searched in the hash library and fed back.
And S105, executing the code to be submitted in the code execution queue, and generating an execution result of executing the code to be submitted.
It should be noted that, because the hash value of the code to be submitted is in the hash library, and according to the consistency of the hash algorithm, it is indicated that a user has not submitted the code before, the code to be submitted needs to be executed for the first time in the code execution queue, and an execution result of executing the code to be submitted needs to be generated.
Optionally, in another embodiment of the present application, an implementation after step S105 includes:
and storing the hash value of the code to be submitted and the execution result of the code to be submitted into a hash library.
It can be understood that after the hash value of the code to be submitted and the execution result of the code to be submitted are stored in the hash library, when a new code to be submitted is obtained subsequently, whether the hash value of the new code to be submitted is consistent with the hash value of the stored code to be submitted at this time can be calculated, and if so, the execution result of the code to be submitted is fed back as the obtained execution result of the new code to be submitted.
According to the scheme, in the data processing method provided by the application, at least one code to be submitted is acquired; then calculating to obtain the hash value of each code to be submitted; judging whether the hash value of each code to be submitted is in a hash library or not; the hash library comprises at least one hash value and an execution result corresponding to each hash value; if the hash value of the code to be submitted is judged to be in the hash library, feeding back an execution result corresponding to the hash value of the code to be submitted; and if the hash value of the code to be submitted is judged not to be in the hash library, executing the code to be submitted in the code execution queue, and generating an execution result for executing the code to be submitted. The method achieves the aim of quickly processing the code to be submitted.
Optionally, in another embodiment of the application, an implementation manner of the data processing method, as shown in fig. 2, includes:
s201, obtaining at least one code to be submitted.
It should be noted that the specific implementation process of step S201 is the same as the specific implementation process of step S101, and reference may be made to this.
S202, calculating to obtain the hash value of each code to be submitted.
It should be noted that the specific implementation process of step S202 is the same as the specific implementation process of step S102, and reference may be made to this process.
S203, judging whether the hash value of each code to be submitted is in the hash library.
It should be noted that the specific implementation process of step S203 is the same as the specific implementation process of step S103, and can be referred to each other.
The hash library comprises at least one hash value and an execution result corresponding to each hash value.
Specifically, if the hash value of the code to be submitted is determined to be in the hash library, step S204 is executed; if the hash value of the code to be submitted is not in the hash library, step S205 is executed.
And S204, feeding back an execution result corresponding to the hash value of the code to be submitted.
It should be noted that the specific implementation process of step S204 is the same as the specific implementation process of step S104, and reference may be made to this process.
S205, judging whether each code to be submitted is a code submitted for the first time aiming at the target title.
And the target topic is the topic to which the code to be submitted belongs.
Specifically, if it is determined that the code to be submitted is the first submitted code for the target topic, step S206 is executed; if the code to be submitted is not the first submitted code for the target topic, step S207 is executed.
S206, recording the time of the code to be submitted, and setting the quality parameter of the code to be submitted as an initial value.
The initial value may be an initial value calculated by a technician through multiple tests, or may be adjusted by a worker according to an actual application situation, which is not limited herein.
And S207, setting quality parameters of the codes to be submitted according to the codes to be submitted and the codes submitted aiming at the target topics last time.
Optionally, in another embodiment of the present application, an implementation manner of step S207, as shown in fig. 3, includes:
s301, comparing the code to be submitted with the code submitted for the target topic at the last time, and determining the change degree of the code to be submitted and the code submitted for the target topic at the last time.
The degree of change may be, but is not limited to, a degree of difference, similarity, etc. between the code to be submitted and the code submitted for the target topic last time, and is not limited herein.
It should be noted that the degree of change can be distinguished by, but not limited to, simple levels, such as a degree of change 1 level, a degree of change 2 level, and a degree of change 3 level, wherein the degree of change of the degree of change 3 level is greater than the degree of change 2 level.
For example: dividing the code to be submitted into a plurality of sections according to the paragraphs, for example, 10 sections, respectively judging the paragraph corresponding to each section and the code submitted for the target topic last time, assuming that 8 sections are consistent, it indicates that the code to be submitted is 80% similar to the code submitted for the target topic last time, and it can be understood that the more similar, the lower the change degree, and the change degree can be determined as level 1.
S302, setting quality parameters of the codes to be submitted according to the change degree.
The higher the change degree is, the larger the quality parameter of the code to be submitted is; the smaller the degree of change, the smaller the quality parameter of the code to be submitted.
For example: when the degree of change is 1 level, setting the quality parameter of the code to be submitted to be 30(100 full); when the degree of change is 2 level, setting the quality parameter of the code to be submitted to be 50(100 full); when the degree of variation is level 3, the quality parameter of the code to be submitted is set to 80(100 full).
Optionally, in another embodiment of the present application, an implementation manner of step S207, as shown in fig. 4, includes:
s401, inquiring the interval time between the code to be submitted and the code submitted aiming at the target topic last time.
S402, setting quality parameters of the codes to be submitted according to the interval time.
Wherein, the longer the interval time is, the larger the quality parameter of the code to be submitted is; the shorter the interval, the smaller the quality parameter of the code to be submitted.
For example: if the interval time is 1 hour, setting the quality parameter of the code to be submitted to be 100(100 full); if the interval time is half an hour, setting the quality parameter of the code to be submitted to be 50; the interval time is 15 minutes, the quality parameter of the code to be submitted is set to 25, etc.
Optionally, in another embodiment of the present application, an implementation manner of step S207, as shown in fig. 5, includes:
s501, comparing the code to be submitted with the code submitted for the target topic at the last time, and determining the change degree of the code to be submitted and the code submitted for the target topic at the last time.
It should be noted that the specific implementation process of step S501 is the same as the specific implementation process of step S301, and reference may be made to this.
S502, inquiring the interval time between the code to be submitted and the code submitted aiming at the target topic last time.
It should be noted that the specific implementation process of step S502 is the same as the specific implementation process of step S401, and reference may be made to this.
S503, setting the quality parameters of the codes to be submitted according to the change degree and the interval time.
The higher the change degree is, and the longer the interval time is, the larger the quality parameter of the code to be submitted is; the smaller the change degree is and the shorter the interval time is, the smaller the quality parameter of the code to be submitted is; the change degree is high, but the interval time is short, and the quality parameters of the codes to be submitted are set according to the change degree; the change degree is small, but the interval time is long, and the quality parameters of the codes to be submitted are set according to the time interval.
And S208, sequentially executing each code to be submitted according to the quality parameter of each code to be submitted, and generating an execution result of each code to be submitted.
Optionally, in another embodiment of the present application, a time parameter is included in the code to be submitted, and the time parameter is used to indicate the latest submission time of the code to be submitted, and an implementation of step S208 is shown in fig. 6, and includes:
s601, inquiring the time parameter of each code to be submitted in the code execution queue at preset time intervals.
The preset time may be calculated by a technician through multiple tests, or may be adjusted by a worker according to an actual application situation, which is not limited herein.
S602, preferentially executing the code to be submitted which is about to reach the latest submission time in the code execution queue, and generating an execution result of the code to be submitted which is about to reach the latest submission time.
It will be appreciated that even if the quality parameter of the code to be submitted that will reach the latest submission time is 10, the quality parameter of the code to be submitted that is currently in the front of the code execution queue is 100, and the code to be submitted that will reach the latest submission time will still be preferentially executed in the code execution queue.
According to the scheme, in the data processing method provided by the application, at least one code to be submitted is acquired; then calculating to obtain the hash value of each code to be submitted; judging whether the hash value of each code to be submitted is in a hash library or not; the hash library comprises at least one hash value and an execution result corresponding to each hash value; if the hash value of the code to be submitted is judged to be in the hash library, feeding back an execution result corresponding to the hash value of the code to be submitted; if the Hash value of the code to be submitted is judged not to be in the Hash library, judging whether each code to be submitted is a code submitted for the first time aiming at the target title, if the code to be submitted is judged to be the code submitted for the first time aiming at the target title, recording the time of the code to be submitted, and setting the quality parameter of the code to be submitted as an initial value; if the code to be submitted is judged not to be the code submitted for the first time aiming at the target question, setting the quality parameter of the code to be submitted according to the code to be submitted and the code submitted for the target question at the last time; and finally, sequentially executing each code to be submitted according to the quality parameter of each code to be submitted, and generating an execution result of each code to be submitted. The method achieves the aim of quickly processing the code to be submitted.
Another embodiment of the present application provides a data processing apparatus, as shown in fig. 7, including:
an obtaining unit 701, configured to obtain at least one code to be submitted.
A calculating unit 702, configured to calculate a hash value of each code to be submitted.
A first determining unit 703 is configured to determine whether the hash value of each code to be submitted is in the hash library.
The hash library comprises at least one hash value and an execution result corresponding to each hash value.
A feedback unit 704, configured to feed back, if the first determining unit 703 determines that the hash value of the code to be submitted is in the hash library, an execution result corresponding to the hash value of the code to be submitted.
The generating unit 705 is configured to execute the code to be submitted in the code execution queue if the first determining unit 703 determines that the hash value of the code to be submitted is not in the hash library, and generate an execution result of executing the code to be submitted.
For a specific working process of the unit disclosed in the above embodiment of the present application, reference may be made to the content of the corresponding method embodiment, as shown in fig. 1, which is not described herein again.
Optionally, in another embodiment of the present application, the data processing apparatus may further include:
and the storage unit is used for storing the hash value of the code to be submitted and the execution result of the code to be submitted into the hash library.
For specific working processes of the units disclosed in the above embodiments of the present application, reference may be made to the contents of the corresponding method embodiments, which are not described herein again.
According to the scheme, in the data processing device provided by the application, the obtaining unit 701 obtains at least one code to be submitted; then, the calculating unit 702 calculates to obtain a hash value of each code to be submitted; the first determining unit 703 determines whether the hash value of each code to be submitted is in the hash library; the hash library comprises at least one hash value and an execution result corresponding to each hash value; if the first determining unit 703 determines that the hash value of the code to be submitted is in the hash library, the feedback unit 704 feeds back an execution result corresponding to the hash value of the code to be submitted; if the first determining unit 703 determines that the hash value of the code to be submitted is not in the hash library, the generating unit 705 executes the code to be submitted in the code execution queue, and generates an execution result of executing the code to be submitted. The method achieves the aim of quickly processing the code to be submitted.
Optionally, in another embodiment of the present application, an implementation manner of the data processing apparatus, as shown in fig. 8, includes:
an obtaining unit 801, configured to obtain at least one code to be submitted.
The calculating unit 802 is configured to calculate a hash value of each code to be submitted.
A first determining unit 803, configured to determine whether the hash value of each code to be submitted is in the hash library.
The hash library comprises at least one hash value and an execution result corresponding to each hash value.
A feedback unit 804, configured to feed back, if the first determining unit 803 determines that the hash value of the code to be submitted is in the hash library, an execution result corresponding to the hash value of the code to be submitted.
A second determining unit 805, configured to determine whether each code to be submitted is a code submitted for the first time for the target topic if the first determining unit 803 determines that the hash value of the code to be submitted is not in the hash library.
And the target topic is the topic to which the code to be submitted belongs.
A recording unit 806, configured to record a time of the code to be submitted if the second determining unit 805 determines that the code to be submitted is the first submitted code for the target title, and set a quality parameter of the code to be submitted as an initial value.
A setting unit 807, configured to set a quality parameter of the code to be submitted according to the code to be submitted and the code submitted last time for the target topic if the second determining unit 805 determines that the code to be submitted is not the code submitted first time for the target topic.
Optionally, in another embodiment of the present application, an implementation manner of the setting unit 807 includes:
and the first determining unit is used for comparing the code to be submitted with the code submitted aiming at the target topic last time and determining the change degree of the code to be submitted and the code submitted aiming at the target topic last time.
And the first setting subunit is used for setting the quality parameter of the code to be submitted according to the change degree.
The higher the change degree is, the larger the quality parameter of the code to be submitted is; the smaller the degree of change, the smaller the quality parameter of the code to be submitted.
For a specific working process of the unit disclosed in the above embodiment of the present application, reference may be made to the content of the corresponding method embodiment, as shown in fig. 3, which is not described herein again.
Optionally, in another embodiment of the present application, an implementation manner of the setting unit 807 includes:
and the first query unit is used for querying the interval time between the code to be submitted and the code submitted aiming at the target topic last time.
And the second setting subunit is used for setting the quality parameters of the codes to be submitted according to the interval time.
Wherein, the longer the interval time is, the larger the quality parameter of the code to be submitted is; the shorter the interval, the smaller the quality parameter of the code to be submitted.
For a specific working process of the unit disclosed in the above embodiment of the present application, reference may be made to the content of the corresponding method embodiment, as shown in fig. 4, which is not described herein again.
Optionally, in another embodiment of the present application, an implementation manner of the setting unit 807 includes:
and the second determining unit is used for comparing the code to be submitted with the code submitted aiming at the target topic last time and determining the change degree of the code to be submitted and the code submitted aiming at the target topic last time.
And the second query unit is used for querying the interval time between the code to be submitted and the code submitted aiming at the target topic last time.
And the third setting subunit is used for setting the quality parameters of the codes to be submitted according to the change degree and the interval time.
The higher the change degree is, and the longer the interval time is, the larger the quality parameter of the code to be submitted is; the smaller the change degree is and the shorter the interval time is, the smaller the quality parameter of the code to be submitted is; the change degree is high, but the interval time is short, and the quality parameters of the codes to be submitted are set according to the change degree; the change degree is small, but the interval time is long, and the quality parameters of the codes to be submitted are set according to the time interval.
For a specific working process of the unit disclosed in the above embodiment of the present application, reference may be made to the content of the corresponding method embodiment, as shown in fig. 5, which is not described herein again.
The generating unit 808 is configured to sequentially execute each code to be submitted according to the size of the quality parameter of each code to be submitted, and generate an execution result of each code to be submitted.
For a specific working process of the unit disclosed in the above embodiment of the present application, reference may be made to the content of the corresponding method embodiment, as shown in fig. 2, which is not described herein again.
Optionally, in another embodiment of the present application, a time parameter is included in the code to be submitted, and the time parameter is used to indicate a latest submission time of the code to be submitted, then an implementation manner of the generating unit 808 includes:
and the third query unit is used for querying the time parameter of each code to be submitted in the code execution queue at preset time intervals.
And the generating subunit is used for preferentially executing the code to be submitted which is about to reach the latest submission time in the code execution queue and generating an execution result of the code to be submitted which is about to reach the latest submission time.
For a specific working process of the unit disclosed in the above embodiment of the present application, reference may be made to the content of the corresponding method embodiment, as shown in fig. 6, which is not described herein again.
According to the scheme, in the data processing device provided by the application, the obtaining unit 801 obtains at least one code to be submitted; then the calculating unit 802 calculates to obtain a hash value of each code to be submitted; the first judgment unit 803 judges whether the hash value of each code to be submitted is in the hash library; the hash library comprises at least one hash value and an execution result corresponding to each hash value; if the first determining unit 803 determines that the hash value of the code to be submitted is in the hash library, the feedback unit 804 feeds back an execution result corresponding to the hash value of the code to be submitted; if the first determining unit 803 determines that the hash value of the code to be submitted is not in the hash library, the second determining unit 805 determines whether each code to be submitted is a code submitted for the first time for the target topic, and if the second determining unit 805 determines that the code to be submitted is a code submitted for the first time for the target topic, the recording unit 806 records the time of the code to be submitted and sets the quality parameter of the code to be submitted as an initial value; if the second determining unit 805 determines that the code to be submitted is not the first submitted code for the target topic, the setting unit 807 sets the quality parameter of the code to be submitted according to the code to be submitted and the last submitted code for the target topic; finally, the generating unit 808 sequentially executes each code to be submitted according to the quality parameter of each code to be submitted, and generates an execution result of each code to be submitted. The method achieves the aim of quickly processing the code to be submitted.
Another embodiment of the present application provides an electronic device, as shown in fig. 9, including:
one or more processors 901.
Storage 902 having one or more programs stored thereon.
The one or more programs, when executed by the one or more processors 901, cause the one or more processors 901 to implement a method as in any one of the above embodiments.
Another embodiment of the present application provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method as described in any of the above embodiments.
In the above embodiments disclosed in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present disclosure may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part. The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a live broadcast device, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those skilled in the art can make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for processing data, comprising:
acquiring at least one code to be submitted;
calculating to obtain a hash value of each code to be submitted;
judging whether the hash value of each code to be submitted is in a hash library or not; the hash library comprises at least one hash value and an execution result corresponding to each hash value;
if the hash value of the code to be submitted is judged to be in the hash library, feeding back an execution result corresponding to the hash value of the code to be submitted;
and if the hash value of the code to be submitted is judged not to be in the hash library, executing the code to be submitted in a code execution queue, and generating an execution result for executing the code to be submitted.
2. The processing method according to claim 1, wherein before executing the to-be-committed code in the code execution queue and generating an execution result of executing the to-be-committed code, the method further comprises:
judging whether each code to be submitted is a code submitted for the first time aiming at the target title; the target topic is a topic to which the code to be submitted belongs;
if the code to be submitted is judged to be the code submitted for the first time aiming at the target title, recording the time of the code to be submitted, and setting the quality parameter of the code to be submitted as an initial value;
if the code to be submitted is judged not to be the code submitted for the first time aiming at the target subject, setting the quality parameter of the code to be submitted according to the code to be submitted and the code submitted for the target subject at the last time;
wherein the executing the code to be submitted in the queue and generating an execution result of executing the code to be submitted includes:
and sequentially executing each code to be submitted according to the quality parameter of each code to be submitted, and generating an execution result of each code to be submitted.
3. The processing method according to claim 2, wherein the setting of the quality parameter of the code to be submitted according to the code to be submitted and the code submitted for the target topic last time comprises:
comparing the code to be submitted with the code submitted for the target subject last time, and determining the degree of change of the code to be submitted and the code submitted for the target subject last time;
setting quality parameters of the codes to be submitted according to the change degree; wherein, the higher the degree of change is, the larger the quality parameter of the code to be submitted is; the smaller the degree of change, the smaller the quality parameter of the code to be submitted.
4. The processing method according to claim 2, wherein the setting of the quality parameter of the code to be submitted according to the code to be submitted and the code submitted for the target topic last time comprises:
inquiring the interval time between the code to be submitted and the last submitted code aiming at the target title;
setting quality parameters of the codes to be submitted according to the interval time; wherein the longer the interval time is, the larger the quality parameter of the code to be submitted is; the shorter the interval time is, the smaller the quality parameter of the code to be submitted is.
5. The processing method according to claim 2, wherein the setting of the quality parameter of the code to be submitted according to the code to be submitted and the code submitted for the target topic last time comprises:
comparing the code to be submitted with the code submitted for the target subject last time, and determining the degree of change of the code to be submitted and the code submitted for the target subject last time;
inquiring the interval time between the code to be submitted and the last submitted code aiming at the target title;
setting quality parameters of the codes to be submitted according to the change degrees and the interval time; wherein, the higher the degree of change is, and the longer the interval time is, the larger the quality parameter of the code to be submitted is; the smaller the change degree is, and the shorter the interval time is, the smaller the quality parameter of the code to be submitted is; the change degree is high, but the interval time is short, and the quality parameter of the code to be submitted is set according to the change degree; the change degree is small, but the interval time is long, and the quality parameter of the code to be submitted is set according to the time interval.
6. The processing method according to claim 2, wherein the code to be submitted includes a time parameter, the time parameter is used to indicate a latest submission time of the code to be submitted, and the executing of each code to be submitted is performed in sequence according to a quality parameter of each code to be submitted, so as to generate an execution result of each code to be submitted, including:
inquiring the time parameter of each code to be submitted in the code execution queue at preset time intervals;
and preferentially executing the code to be submitted which is about to reach the latest submission time in the code execution queue, and generating an execution result of the code to be submitted which is about to reach the latest submission time.
7. The processing method according to claim 1, wherein after the executing the to-be-committed code in the code execution queue and generating the execution result of the executing the to-be-committed code, the method further comprises:
and storing the hash value of the code to be submitted and the execution result of the code to be submitted into the hash library.
8. An apparatus for processing data, comprising:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring at least one code to be submitted;
the calculation unit is used for calculating and obtaining the hash value of each code to be submitted;
the first judgment unit is used for judging whether the hash value of each code to be submitted is in a hash library or not; the hash library comprises at least one hash value and an execution result corresponding to each hash value;
the feedback unit is used for feeding back an execution result corresponding to the hash value of the code to be submitted in the hash library if the first judgment unit judges that the hash value of the code to be submitted is in the hash library;
and the generating unit is used for executing the code to be submitted in a code execution queue if the first judging unit judges that the hash value of the code to be submitted is not in the hash library, and generating an execution result for executing the code to be submitted.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-7.
10. A computer storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method of any of claims 1 to 7.
CN202011497102.0A 2020-12-17 2020-12-17 Data processing method and device, electronic equipment and computer storage medium Pending CN112486843A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011497102.0A CN112486843A (en) 2020-12-17 2020-12-17 Data processing method and device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011497102.0A CN112486843A (en) 2020-12-17 2020-12-17 Data processing method and device, electronic equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN112486843A true CN112486843A (en) 2021-03-12

Family

ID=74917303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011497102.0A Pending CN112486843A (en) 2020-12-17 2020-12-17 Data processing method and device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN112486843A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708897A (en) * 2015-11-17 2017-05-24 阿里巴巴集团控股有限公司 Quality assurance method, device and system for data warehouse
CN107992404A (en) * 2016-10-26 2018-05-04 中兴通讯股份有限公司 A kind of Software Automatic Testing Method and device
CN110825427A (en) * 2019-10-12 2020-02-21 重庆金融资产交易所有限责任公司 Code management method, device, server and storage medium
CN111258966A (en) * 2020-01-14 2020-06-09 软通动力信息技术有限公司 Data deduplication method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708897A (en) * 2015-11-17 2017-05-24 阿里巴巴集团控股有限公司 Quality assurance method, device and system for data warehouse
CN107992404A (en) * 2016-10-26 2018-05-04 中兴通讯股份有限公司 A kind of Software Automatic Testing Method and device
CN110825427A (en) * 2019-10-12 2020-02-21 重庆金融资产交易所有限责任公司 Code management method, device, server and storage medium
CN111258966A (en) * 2020-01-14 2020-06-09 软通动力信息技术有限公司 Data deduplication method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US8825684B2 (en) Arrangement for comparing content identifiers of files
CN107404541B (en) Method and system for selecting neighbor node in peer-to-peer network transmission
CN108989468B (en) Trust network construction method and device
KR101852527B1 (en) Method for Dynamic Simulation Parameter Calibration by Machine Learning
CN111562884A (en) Data storage method and device and electronic equipment
CN112486843A (en) Data processing method and device, electronic equipment and computer storage medium
CN110580265B (en) ETL task processing method, device, equipment and storage medium
CN109858632B (en) Method and device for determining threshold
CN113111351A (en) Test method, test device and computer-readable storage medium
WO2020107368A1 (en) Information recommending method and apparatus, and device and readable storage medium
US20210382872A1 (en) Blockchain-based Data Storage Method, Related Device and Storage Medium
KR101563628B1 (en) Error detection method, error detection apparatus and error detection system for bibliographic data of books
CN113672389A (en) Server compatibility method, system, equipment and computer readable storage medium
CN114154087A (en) Time blind comment detection method, device, equipment and readable storage medium
CN111491060B (en) Information click log and ticket splicing method and device
CN112115158A (en) SQL statement execution time recording method, device, equipment and readable storage medium
CN110008269B (en) Data reflow method, device, equipment and system
CN110083517B (en) User image confidence optimization method and device
CN112311755A (en) Industrial control protocol reverse analysis method and device
CN113038283A (en) Video recommendation method and device and storage medium
CN115208938B (en) User behavior control method and device and computer readable storage medium
CN109637586B (en) Method and device for correcting sequencing depth
CN109584959B (en) Method and device for correcting sequencing depth
CN112084349B (en) Knowledge base expansion method and device, electronic equipment and computer storage medium
JP6756680B2 (en) Information processing equipment, information processing methods, and information processing programs

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