CN114065190A - High-availability and high-safety algorithm automatic online test system - Google Patents
High-availability and high-safety algorithm automatic online test system Download PDFInfo
- Publication number
- CN114065190A CN114065190A CN202010763042.6A CN202010763042A CN114065190A CN 114065190 A CN114065190 A CN 114065190A CN 202010763042 A CN202010763042 A CN 202010763042A CN 114065190 A CN114065190 A CN 114065190A
- Authority
- CN
- China
- Prior art keywords
- test
- service
- server
- main
- data
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 119
- 238000011156 evaluation Methods 0.000 claims abstract description 41
- 244000035744 Hura crepitans Species 0.000 claims abstract description 11
- 230000001360 synchronised effect Effects 0.000 claims abstract description 8
- 230000036541 health Effects 0.000 claims description 6
- 238000012795 verification Methods 0.000 claims description 4
- 238000000034 method Methods 0.000 description 6
- 238000012423 maintenance Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 241000251468 Actinopterygii Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012854 evaluation process Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 231100000989 no adverse effect Toxicity 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 238000012549 training Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/52—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
- G06F21/53—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Debugging And Monitoring (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
Abstract
The invention discloses an algorithm automatic online test system with high availability and high safety, which comprises a main server, a test server and a load balancer, wherein the load balancer is used as a middle bridge between the main server and the test server; the main server includes: main service, synchronous service, test queue; the test server includes: synchronous service, safe sandbox, tester middle layer service. The invention can satisfy the requirement of massive submission in a short time, simultaneously ensures that the system resource occupation is not too large, and compresses the resource occupation of the system to the minimum under the condition of small usage amount. Besides, on the premise of ensuring the accuracy of the test result, the safety of the main service and the evaluation service is ensured, and the consequences of service interruption, data leakage and the like caused by malicious submission are avoided.
Description
Technical Field
The invention relates to the field of computer science experiments, in particular to a high-availability and high-safety algorithm automatic online test system.
Background
The automatic algorithm testing system can be used for training students in the process of learning algorithm knowledge and programming, most programming competitions are organized and operated on the automatic algorithm online testing system, and the achievement of participants is automatically obtained through the automatic algorithm online testing system, so that subjective unfairness is avoided. Therefore, the automatic algorithm evaluation system plays a great role in the field of computer science education.
However, with the enlargement of computer science education and programming competition scale and the increase of participated personnel, the traditional online evaluation system cannot adapt to the continuously enlarged user scale, and some algorithms with high availability and high safety are designed for the defects of the traditional online evaluation system. The configuration cost and the operation and maintenance cost of the server are reduced as much as possible.
A common online evaluation system uses a C/S architecture, i.e., a client/server architecture, and a server part is responsible for receiving uploaded codes, compiling codes, and testing codes. Such an architecture is relatively simple and relatively easy to implement, but may take up excessive local area network resources when large in scale and may be down when the simultaneous submissions are excessive. In addition, such an online evaluation system often has a problem of difficult deployment, and often the operation and maintenance personnel need to consider not only the server but also the machine as the client when deploying the evaluation system in a competition, and sometimes even the competition participants need to independently install the client program.
Still another conventional online evaluation system uses a B/S architecture which is relatively convenient, that is, a browser/server, a main service is connected to a scheduling server, the scheduling server is connected to a plurality of evaluation machines, and the configuration of the scheduling server needs to be manually adjusted each time the evaluation server is adjusted. But the deployment is more convenient compared with the online evaluation system of the C/S framework, no additional program is needed to be installed at the client, and other machines only need to have a most basic browser after the program is deployed by the main server. Compared with the former mode, the operation and maintenance cost is reduced. However, such architectures have some problems: when the tasks are more and the running time is not constant, the configured evaluation machine enters a blocking state when the running time of the tasks is longer. And further influences the concurrency of the online evaluation system, namely the number of tasks which can be processed at most at the same time. In some formal competitions, the later submitted result is rather first-out or the submitted evaluation process or the evaluation result is deviated or even wrong, thereby affecting the fairness of the competitions.
In some competitions, due to various reasons such as expenses and environment, a server which is configured sufficiently often does not exist, and a traditional online evaluation system often needs to occupy more system resources, so that the optional range of the evaluation system in some competitions is greatly reduced, and the possible downtime risk cannot be avoided. In some online evaluation systems, the system may remain occupied with high resources under low usage conditions, which may result in a large amount of cost.
In addition, the method is used as a type of computer software, the safety of an online evaluation system is very important, and some malicious users can achieve the purposes of stopping the operation of the evaluation machine, even stealing the data of the evaluation machine and the like by constructing malicious codes. The traditional online evaluation system generally realizes the protection in the aspect through the ways of keyword filtering, dangerous system function call detection and the like. However, these measures are often cumbersome to implement and difficult to thoroughly avoid some of the missing fish.
Disclosure of Invention
The technical problem to be solved by the invention is to overcome the defects of the prior art and provide an algorithm automatic online test system with high availability and high safety.
In order to solve the technical problems, the invention provides the following technical scheme:
the invention relates to a high-availability and high-safety algorithm automatic online test system, which comprises a main server, a test server and a load balancer, wherein the load balancer is used as a middle bridge between the main server and the test server;
the main server includes:
the main service is used for sending test data, generating a test task and receiving a returned test result;
the synchronous service is used for receiving the test data and sending out the synchronous test data;
the test queue receives the test task, returns the test result and sends the test task;
the test server includes:
the synchronization service receives synchronization test data sent by the synchronization service of the main server, sends update data and cache verification;
the safety sandbox is used for confirming information;
and the middle layer service of the tester sends a test result to the test queue under the condition of confirming the health of the tester.
As a preferred technical solution of the present invention, the safety sandbox includes:
the evaluation core receives the algorithm and the test data and then inputs the test data to the basic verifier, the returned test result is output to the middle layer service of the tester, and meanwhile, the data signal is output to the binary file for compiling;
and the basic verifier receives the return execution information obtained by the binary file.
As a preferred technical solution of the present invention, the synchronization service of the test server and the basic verifier are both connected to the binary verifier cache.
As a preferred embodiment of the present invention, there may be a plurality of test servers to which the load balancer is connected.
Compared with the prior art, the invention has the following beneficial effects:
1. high safety: the test server of the invention uses the safe sandbox to test the submitted evaluating codes, all the untrusted codes submitted by the user can run in an environment completely isolated from the outside, the environment has no chance to contact with the sensitive data of the outside, and when the occupied system resources exceed the threshold value or the system function destroying device tries to call danger is stopped immediately, and simultaneously the sandbox is used. The method has the advantages that no adverse effect is caused on the test server, and the main server is not influenced to ensure the safety and stability of the whole evaluation system.
2. High availability: the main server and the test server run in an isolated mode, the main server can still normally receive access and evaluation requests of a user and press the requests into the queue in the process of processing tasks, the system is available for the user in the whole process, the evaluation requests in the test queue are distributed by the load balancer according to the health state of the test server cluster to guarantee one task evaluation time to the maximum extent, the average processing time of the evaluation tasks is greatly reduced, and the availability of the whole system is improved.
3. The economic efficiency is as follows: the load balancer can elastically shrink the scale of the test server cluster according to the current task quantity and the health condition of the test server cluster, the scale of the test server cluster is enlarged to enable the dormant test server to improve the evaluation speed when the task quantity is large, and part of the test servers are released to reduce the occupation of system resources when the task quantity is relatively small, so that the system maintenance cost is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a system framework diagram of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Example 1
As shown in FIG. 1, the invention provides a high-availability and high-security algorithm automated online test system, which comprises a main server, a test server and a load balancer, wherein the load balancer is used as a middle bridge between the main server and the test server;
the main server includes:
the main service is used for sending test data, generating a test task and receiving a returned test result;
the synchronous service is used for receiving the test data and sending out the synchronous test data;
the test queue receives the test task, returns the test result and sends the test task;
the test server includes:
the synchronization service receives synchronization test data sent by the synchronization service of the main server, sends update data and cache verification;
the safety sandbox is used for confirming information;
and the middle layer service of the tester sends a test result to the test queue under the condition of confirming the health of the tester.
Further, the safety sandbox includes:
the evaluation core receives the algorithm and the test data and then inputs the test data to the basic verifier, the returned test result is output to the middle layer service of the tester, and meanwhile, the data signal is output to the binary file for compiling;
and the basic verifier receives the return execution information obtained by the binary file.
The synchronization service and the basic verifier of the server are both connected with the binary verifier cache.
The number of test servers to which the load balancer is connected may be plural.
Specifically, the operation steps of the automatic algorithm online evaluation system are as follows:
1. the website administrator uploads and modifies the test data of the title through the background, and then the synchronization service of each test server synchronizes the test data to the binary verification buffer cache and the test machine middle layer service for comparison with the submitted code running result. 2. After a user submits an evaluation request to a main server, the main server pushes the evaluation request with a question number corresponding to the request and a code submitted by the user into a test queue after checking the validity of the evaluation request, the test queue further sends the request to a load balancer, and then the test queue starts a result of a periodic inquiry test. 3. The load balancer can be connected with a plurality of test servers, can elastically stretch the scale of the test servers according to the health condition of the test servers, so that the resource occupation of the whole system is dynamically reduced under the condition that the number of users of the system is small, and can distribute test tasks to the middle layer service of the test machine according to the state of each test server when an evaluation request is received. 4. The method comprises the steps that a safety sandbox is created after a test request is received by a middle layer service of a testing machine, an evaluation core is expanded in the safety sandbox, received codes are compiled in the core to obtain binary files, then test is conducted on test points of a subject through basic verifiers, then the basic verifiers return accurate test results of memory occupation, operation time and the like of each test point to the evaluation core, and the evaluation core returns a total test result to the middle layer service of a test server to wait for a main server to test a queue to obtain the test result. 5. After the test queue obtains the test result returned by the middle layer service of the test machine, the result is stored in the database of the main server, the task is removed from the test queue, and when one evaluation task is finished, a user can inquire the result of the evaluation task through the main service.
The invention can satisfy the requirement of massive submission in a short time, simultaneously ensures that the system resource occupation is not too large, and compresses the resource occupation of the system to the minimum under the condition of small usage amount. Besides, on the premise of ensuring the accuracy of the test result, the safety of the main service and the evaluation service is ensured, and the consequences of service interruption, data leakage and the like caused by malicious submission are avoided.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (4)
1. An algorithm automatic online test system with high availability and high safety is characterized by comprising a main server, a test server and a load balancer, wherein the load balancer is used as an intermediate bridge between the main server and the test server;
the main server includes:
the main service is used for sending test data, generating a test task and receiving a returned test result;
the synchronous service is used for receiving the test data and sending out the synchronous test data;
the test queue receives the test task, returns the test result and sends the test task;
the test server includes:
the synchronization service receives synchronization test data sent by the synchronization service of the main server, sends update data and cache verification;
the safety sandbox is used for confirming information;
and the middle layer service of the tester sends a test result to the test queue under the condition of confirming the health of the tester.
2. A high availability and high security algorithmic automated online test system according to claim 1, wherein the security sandbox comprises:
the evaluation core receives the algorithm and the test data and then inputs the test data to the basic verifier, the returned test result is output to the middle layer service of the tester, and meanwhile, the data signal is output to the binary file for compiling;
and the basic verifier receives the return execution information obtained by the binary file.
3. A high availability and high security algorithm automated online test system according to claim 2, wherein the synchronization service and the base validator of the test server are connected to the binary validator cache.
4. A high availability and high security algorithmic automated online test system according to claim 1, wherein the load balancer is connected to a plurality of test servers.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010763042.6A CN114065190A (en) | 2020-07-31 | 2020-07-31 | High-availability and high-safety algorithm automatic online test system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010763042.6A CN114065190A (en) | 2020-07-31 | 2020-07-31 | High-availability and high-safety algorithm automatic online test system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114065190A true CN114065190A (en) | 2022-02-18 |
Family
ID=80227992
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010763042.6A Pending CN114065190A (en) | 2020-07-31 | 2020-07-31 | High-availability and high-safety algorithm automatic online test system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114065190A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116260823A (en) * | 2023-05-15 | 2023-06-13 | 南方电网数字电网研究院有限公司 | Controlled data sharing method, device, computer equipment and storage medium |
-
2020
- 2020-07-31 CN CN202010763042.6A patent/CN114065190A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116260823A (en) * | 2023-05-15 | 2023-06-13 | 南方电网数字电网研究院有限公司 | Controlled data sharing method, device, computer equipment and storage medium |
CN116260823B (en) * | 2023-05-15 | 2023-09-15 | 南方电网数字电网研究院有限公司 | Controlled data sharing method, device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109729131B (en) | Application request processing method and device and router | |
CN109586952B (en) | Server capacity expansion method and device | |
CN109739527B (en) | Method, device, server and storage medium for client gray scale release | |
CN111506489A (en) | Test method, system, device, server and storage medium | |
CN110930254A (en) | Data processing method, device, terminal and medium based on block chain | |
CN113448862A (en) | Software version testing method and device and computer equipment | |
CN107220169B (en) | Method and equipment for simulating server to return customized data | |
CN115801407A (en) | Abnormal node shielding method and device, storage medium and target node | |
CN114065190A (en) | High-availability and high-safety algorithm automatic online test system | |
CN107025129B (en) | Data processing method and device | |
CN112202647B (en) | Test method, device and test equipment in block chain network | |
CN108092777A (en) | The monitoring and managing method and device of digital certificate | |
CN111741141A (en) | Method and system for realizing efficient IP proxy pool and data acquisition method | |
CN114331446B (en) | Method, device, equipment and medium for realizing out-of-chain service of block chain | |
CN111460256A (en) | Webpage data crawling method and device, computer equipment and storage medium | |
CN116089005A (en) | Automatic migration method and device for server container instance | |
RU128741U1 (en) | SYSTEM FOR FORMING SOLVING PROBLEMS OF FUNCTIONING COMPUTER SYSTEMS | |
CN114493354A (en) | Task processing method, system, operation control device and readable storage medium | |
CN114944942A (en) | Data reporting method and device based on effective buried points, computer equipment and medium | |
CN112765188A (en) | Configuration information processing method, configuration management system, electronic device, and storage medium | |
CN113515403B (en) | Micro-service state checking method, computer device and storage medium | |
CN109918078A (en) | Code relies on management method, device, computer equipment and storage medium | |
CN117009960B (en) | Data security cleaning method based on artificial intelligence | |
CN109962938B (en) | Data updating and accessing method and device and cluster system | |
CN116107894A (en) | Gray scale test method and device based on artificial intelligence, electronic equipment and medium |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20220218 |