CN-121979546-A - Online deployment method, system, equipment and medium for experiment files
Abstract
The invention belongs to the technical field of computers, and discloses an online deployment method, system, equipment and medium of an experiment file, wherein the method comprises the steps of locally compressing an experiment folder to form a compressed package file; analyzing and detecting the legitimacy of the experimental file, acquiring the version number of the open source front end library and detecting the compatibility, carrying out adaptation processing on the experimental file, reading all the codes related to the references in the core front end interaction script file uploaded by the user by the server, checking whether the corresponding referenced file exists or not and filtering other files which are not in the references, and deploying the experimental file as a static website hosting resource which is realized independently by the server. The invention can realize the online deployment of PsychoPy experiment files, and has the characteristics of reducing technical threshold, guaranteeing data integrity, ensuring data safety and convenient recovery, realizing the integration of experiments and questionnaires, optimizing recruitment and rewards setting, and improving the expandability and maintainability of the system.
Inventors
- YAO KAI
- WANG XIANGYONG
- LIN JIEHONG
- HE KAIBIN
- LI JUNWANG
- CHEN ZHIQIANG
Assignees
- 北京见数科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260126
Claims (10)
- 1. An online deployment method of an experiment file is characterized by comprising the following steps: Compressing an experiment folder generated by experiment software locally to form a compressed package file, and uploading the compressed package file to an object storage of a server side; extracting a compressed package file in the object storage of the server side, analyzing the compressed package file, detecting the legitimacy of the experiment file, and determining a core front-end interaction script file corresponding to the experiment; Analyzing the reference information of the open source front end library in the core front end interaction script file to acquire the version number of the open source front end library, and detecting the compatibility of the version number of the open source front end library; After the version detection of the open source front end library passes, carrying out adaptation processing on the experiment file to generate a unified template file and rewriting a core front end interaction script file; The server side reads all the codes related to the references in the core front-end interaction script file uploaded by the user, checks whether the files corresponding to the references exist or not, and filters other files not in the references; The server deploys the experimental files subjected to analysis, adaptation and filtering into static website hosting resources which are independently realized, so as to support the tested terminal to access and run the experiment through a browser.
- 2. The online deployment method of experiment files according to claim 1, wherein in the uploading process of the compressed package file, the front end is used to perform a verification operation on the compressed package, wherein the verification operation includes: Checking whether the type of the compressed package file is in ZIP format; checking whether the size of the compressed package file is smaller than or equal to the maximum uploading limit corresponding to the current account; And when the front end check fails, terminating the uploading process and returning corresponding prompt information.
- 3. The method for online deployment of experiment files according to claim 1, wherein the steps of extracting the compressed package file in the server-side object storage, analyzing the compressed package file, detecting the validity of the experiment file, and determining the core front-end interaction script file corresponding to the experiment include: acquiring a compressed package file in an object storage of a server side, detecting a directory structure in the compressed package file, and analyzing the compressed package file according to a directory result; Detecting whether a default first page file of a website exists in the analyzed catalog, if not, judging that the experimental file does not exist, generating abnormal information for prompting, if so, analyzing file content, and determining a core front-end interaction script file name corresponding to an experiment according to page title information; and when the core front-end interaction script file is not detected, judging that the experiment file does not exist, and generating corresponding abnormal information.
- 4. The online deployment method of the experiment file according to claim 1, wherein the compatibility detection of the version number of the open source front end library comprises: and judging whether the version number of the open source front end library belongs to a preset supported version set, if so, continuing to execute the subsequent processing flow, if not, terminating the processing flow, and generating abnormal information for prompting that the experimental file version is temporarily not supported.
- 5. The method for online deployment of experiment files according to claim 1, wherein the adapting the experiment files to generate a unified template file and rewriting a core front-end interaction script file comprises: Generating a unified page structure template file, and introducing a plug-in script for experiment operation and a style file of an open source front end library corresponding to an experiment version into the page structure template file; replacing a reference path of an open source front end library in a core front end interaction script file, and enabling the reference path to point to an open source front end library file of a preset corresponding version of a server end; Positioning the definition position of the experiment exit function in the core front-end interaction script file, and inserting logic codes for experiment completion verification and full-screen state control after the definition position; Inserting experiment data end callback logic at an experiment end calling position, and triggering acquisition and uploading of experiment data when an experiment is completed; and inserting logic codes for initializing full-screen monitoring at the tail of the core front-end interaction script file to finish the rewriting of the core front-end interaction script file, so that the experiment file has unified control and data interaction capability on the premise of not changing the original experiment logic.
- 6. The online deployment method of experiment files according to claim 5, wherein the plug-in scripts for experiment operation comprise plug-in scripts for expanding experiment software experiment operation capability and plug-in scripts for processing form data; the path of the style file comprises version identifiers of open source front end libraries and open source front end library resources for distinguishing different versions.
- 7. The online deployment method of the experiment file according to claim 1, wherein the server deploys the experiment file after parsing, adapting and filtering to be a static website hosting resource which is implemented autonomously, so as to support the tested terminal to access and run the experiment through a browser, comprising: after analysis, adaptation and filtering of the experiment file are completed, the server side creates a unique directory for each experiment instance, and maps the experiment uniform resource locator to a specific experiment instance directory so as to realize route management of the access request; The method comprises the steps of constructing a static website hosting module for processing a browser-side experiment page and resource requests, wherein the functions of the static website hosting module comprise hypertext transfer protocol request monitoring and routing processing, static resource reading and response returning, resource caching and performance optimization; when the tested terminal accesses the experiment uniform resource locator in the browser, the static website hosting module returns the default first page file and the dependent resource of the website to the browser, and the browser analyzes the page structure and loads the core front-end interaction script and the style file in sequence.
- 8. An online deployment system for an experiment document, comprising: the experiment file uploading module is used for locally compressing an experiment folder generated by experiment software to form a compressed package file, and uploading the compressed package file to an object storage of a server side; the compression package analysis and legitimacy detection module is used for extracting a compression package file in the object storage of the server side, analyzing the compression package file and detecting the legitimacy of the experiment file, and determining a core front-end interaction script file corresponding to the experiment; the version and compatibility detection module is used for analyzing the reference information of the open source front end library in the core front end interaction script file to acquire the version number of the open source front end library and carrying out compatibility detection on the version number of the open source front end library; the template file generation and adaptation module is used for carrying out adaptation processing on the experimental file after the version detection of the open source front end library is passed so as to generate a unified template file and rewrite a core front end interaction script file; the file filtering processing module is used for reading all the codes related to the references in the core front-end interaction script file uploaded by the user by the server, checking whether the files corresponding to the references exist or not, and filtering other files not in the references; the experimental file deployment and static website hosting module is used for deploying the experimental file subjected to analysis, adaptation and filtering treatment as a static website hosting resource which is independently realized by a server end so as to support the tested terminal to access and run the experiment through a browser.
- 9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
- 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
Description
Online deployment method, system, equipment and medium for experiment files Technical Field The invention relates to the technical field of computers, in particular to an online deployment method, an online deployment system, online deployment equipment and online deployment media for experimental files. Background In the study of psychology and cognitive neuroscience, a test is usually presented with stimulus by a computer program and behavior data or physiological data are collected, so as to complete a behavior experiment, a psychophysical experiment and a neuroimaging related experiment. PsychoPy is a published, open-source psychological experiment development software in the prior art, which can construct experimental procedures through graphical interfaces or script modes and support operation under various operating system environments. For related technical content, see PsychoPy official documents and publications thereof. The existing PsychoPy software supports exporting an experiment program into an experiment file based on HTML and JavaScript, so that the experiment can be run in a browser environment. The experimenter can deploy the experiment file to a server and provide an experiment access entrance for a tested person in a network mode. The method expands the operation environment of the experiment to a certain extent, so that the experiment is not limited to a local computer. In the prior art scheme, an experimenter usually needs to complete the following technical steps of 1) generating an experiment file by PsychoPy software and exporting the experiment file into an HTML form, 2) configuring a server environment by itself, uploading and deploying the experiment file to a server, 3) providing an experiment access address for a tested person in a network link mode, and 4) loading the experiment file in the tested terminal by a browser and executing an experiment flow. Although the technical scheme realizes browser operation of the experimental program, the following problems and disadvantages still exist in practical application: 1. the technical capability requirement on the experimenters is high, and the existing scheme generally requires the experimenters to have HTML, javaScript and technical knowledge related to server deployment, so that the deployment and operation of the experimental files can be completed. For experimenters lacking relevant technical background, a higher technical threshold exists for server environment configuration and experimental deployment processes. 2. In the prior art, the experimental files are usually managed and stored by an experimenter, uploading, version management and long-term storage of the experimental files lack uniform technical means, and stability and consistency of an experimental process are difficult to ensure. 3. The prior art does not provide a tested recruitment mechanism matched with experimental deployment, under the condition of self-deploying an experimental file, an experimenter still needs to complete tested recruitment through offline or other independent channels, and the experimental deployment and the tested acquisition lack of effective technical engagement, so that the overall experimental implementation efficiency is low. Therefore, how to provide an online deployment method for experimental files is a problem to be solved at present. Disclosure of Invention The embodiment of the invention provides an online deployment method of an experiment file, which aims to solve the problems of the prior art. According to a first aspect of an embodiment of the present invention, an online deployment method of an experiment file is provided. In one embodiment, the online deployment method of the experiment file comprises the following steps: Compressing an experiment folder generated by experiment software locally to form a compressed package file, and uploading the compressed package file to an object storage of a server side; extracting a compressed package file in the object storage of the server side, analyzing the compressed package file, detecting the legitimacy of the experiment file, and determining a core front-end interaction script file corresponding to the experiment; Analyzing the reference information of the open source front end library in the core front end interaction script file to acquire the version number of the open source front end library, and detecting the compatibility of the version number of the open source front end library; After the version detection of the open source front end library passes, carrying out adaptation processing on the experiment file to generate a unified template file and rewriting a core front end interaction script file; The server side reads all the codes related to the references in the core front-end interaction script file uploaded by the user, checks whether the files corresponding to the references exist or not, and filters other files not in the references; The server deploys the