Abstract
University legal education is of great significance to the personal development and social stability of college students. At present, there are certain problems in the traditional teaching system, which has led to inefficient university legal education. In order to improve the legal teaching effect of the university, based on machine learning and neural networks, this paper integrates and optimizes the original hardware and software and operation process, and further highlights the functions of interconnection and sharing, automatic sensing, real-time recording, interactive feedback, dynamic supervision, and intelligent analysis, which greatly facilitates the evaluation of teaching at all levels. In particular, this study uses big data technology to conduct an intelligent analysis of data completeness, multimedia application rate, system execution, and average test scores, and scientifically evaluates the implementation of basic-level education systems and the effectiveness of education, which can effectively solve the problems of quantitative formalization and qualitative subjectivity of current education evaluation from a technical level. In addition, this study designs a control experiment to analyze the system performance. The research results show that the model proposed in this paper has a certain effect.
Introduction
In recent years, my country has continuously promoted the work process of the rule of law in China, and citizens’ awareness of the rule of law has also continued to increase. As high-quality talents as an important part of socialist construction, establishing the correct concept of the rule of law for college students is not only closely related to the work of socialist rule of law, but also related to the realization of the Chinese dream and the future and destiny of the Chinese nation. At present, my country is in the decisive stage of building a well-off society in an all-round way, and social contradictions are emerging one after another, and it is urgent to adjust them through laws. At the same time, the “rule of law” advocated by socialist core values guides our college students to be good at using the rule of law thinking and rule of law concepts to analyze and solve problems. On the one hand, the rule of law education of college students directly affects the formation of college students’ personal concept of the rule of law, which has an important impact on their stepping into society after their college birthdays. On the other hand, it has a close relationship with social stability and sustainable development of the country [1]. Due to the rapid improvement of information technology, digital technology, and mobile communication technology, new media technology has penetrated into all walks of life, and it has had a non-negligible impact on college students’ thinking and behavior. The new media has enriched the way of law education for college students and broadened the channels for the education of law, but the new media has also affected the traditional educational order of colleges and universities, and has reduced the ability of college students to make independent judgments about the rule of law. Therefore, colleges and universities should fully recognize the impact of new media on the rule of law education of college students, integrate the new media with the rule of law education, and effectively improve the legal literacy of college students.
Cultivating the legal quality of college students is an important part of ideological and political education in colleges and universities. Cultivating the legal quality of college students through the education of the concept of the rule of law in ideological and political education in Chinese universities has become the most common training method. After years of development, ideological and political education in Chinese universities has become a complete system. However, due to the influence of erroneous ideological trends and ideological trends, some college students in my country are weak in the concept and awareness of the rule of law and cannot use legal weapons in their lives to protect their own interests. In addition, a small number of students who know the law still violate the law, and some college students commit crimes with extremely bad means. In order to prevent the occurrence of such incidents, it is necessary to increase the propaganda and education of the rule of law, enhance the legal awareness of college students, improve the legal thinking of college students, and cultivate the legal quality of college students [2].
With the rapid development of society, contemporary college students must possess certain concepts of the rule of law in order to occupy a place in an increasingly complex society. However, in reality, the phenomenon of college students’ crimes is not uncommon. It reminds us from the side that college students have not applied the relevant content learned in the “rule of law education” lessons to their daily lives, and the traditional rule of law education system needs to be improved urgently. By studying the influence of the law teaching system based on machine learning on the rule of law education of college students, this article uses a combination of theory and practice to clarify the plan and efficiency of the rule of law education teaching, expand the teaching content and methods, and improve the teaching method. The research results of this study can provide useful reference for the implementation of law education in universities [3].
Related work
In the current education situation, many well-known educational institutions and educational platforms have emerged at home and abroad. They have different understandings of the form of online education and have formed a variety of types of flowers blooming [4]. For example, some provide after-school assignments and auxiliary videos to assist offline education, some provide communication classrooms and after-class evaluations, and some directly establish learning groups using chat tools and forums as media. The emergence of these forms is making the traditional model of education continue to glow with new charm. Khan Academy is a well-known educational platform abroad. It provides students with instructional videos, practical exercises, and a learning planning table that is adjusted according to the students’ own learning speed. Moreover, it advocates respect for differences in the learning process, encourages bold thinking and attaches importance to fostering creativity [5], and is a model of foreign online education. In addition, edX is a college-style online education platform co-founded by Harvard and MIT that unites many well-known universities, where learners can learn high-quality content, write reports and feedback with professors. There is also a language learning platform like Voxy, which mainly focuses on encouraging people to use trivial knowledge to learn and provides a variety of different forms for the learning crowd on the mobile terminal. For example, (1) open online courses [6] mainly provide video materials for learners through well-known organizations and persons outside the United Nations. Moreover, the business type is content type, the service group is mainly higher education people, and it provides a forum for learners after learning. (2) Recovering the classroom [7] independently provide various courses including vocational education, foreign language education, examination education, and interest education. Moreover, its business type is also content-based, and it takes the form of video-on-demand, live broadcast classrooms, and provides electronic versions of learning materials and after-school practice questions. (3) The main service object of the wisdom question bank is K12 education [8], which mainly focuses on live broadcast and exercises, and is used to assist students in the course tasks of the current school year. One-to-one exclusive English teaching service provided by vipkid for 4 to 15-year old. Moreover, its course format is mainly video, and it is equipped with corresponding evaluation feedback and course consultant counseling before and after class. In addition, there are some well-known platforms for adult professional education such as Mu Ke.com, Geek Academy and online school platforms such as Hujiang Net School. They mainly provide content such as course videos and articles and are provided with corresponding forums and quizzes [9].
With the development of the Internet in the past three decades, the Web has also undergone several major changes. In the early 1990 s, Tim invented the original Web browser and created the World Wide Web on the NeXT computer in hypertext language, and the HTML language came out [10]. With the change of the times, HTML has passed its fifth version, and the complementary CSS and Javascript have also experienced several versions of the baptism of iteration. Nowadays, the front-end is becoming more diversified and complicated. The front-end technology is not only to complete the design and rendering of web pages, but also has the ability to undertake complex business logic and even engage in back-end business. The popular front-end framework technologies such as Vue, React, Node.js, etc. in recent years have brought the front-end work to a new height [11]. The following is an introduction to the most basic language development of front-end technology. HTML is a hypertext markup language and the basic programming language for writing web pages. The latest HTML5 standard adds many new features. For example, semantic tags < header>,<title>, etc. are convenient for people to use and identify; audio and video < video>and<audio>tags provide audio and video embedding standards and related controls on web pages; WebSocket protocol can perform full-duplex interaction; canvas and inline SVG can draw various graphics and animations as well as new functions such as geolocation and localstorge storage [12]. CSS Cascading Style Sheets is a language for statically modifying web pages and formatting web page elements. The latest CSS3 adds a new pseudo-element selector, adds animation animation and transition effects, adds a new box type and layout type, and a series of new attributes, and the purpose is to adapt to the development of front-end technology [13]. J Avascript is a literal script language, mainly including DOM, BOM and ECMAScript standards, of which the ES standard has been updated to ES8 version in 2017. In addition to some of the auxiliary content added by the latest ES7 and ES8, the changes change of ES6 [14] has undoubtedly brought earth-shaking changes to the JS language, such as the addition of new variable definition methods let, const, promise, arrow functions and so on. Among them, the most important thing is the introduction of modular programming and the concept of class “class”, which changes the drawback of the loading method of js shared code [15]. Everything is a module. The export and import methods facilitate the management of module dependencies and enhance decoupling. Moreover, the concept of classes makes the front-end language more object-oriented, simplifies the code structure in many ways, and provides more convenience for the expansion of subsequent versions and the introduction of frameworks [16].
Immune genetic algorithm
The immune system is generally composed of cells, tissues, or organs with immune functions, as shown in Fig. 1. Its main role is to produce antibodies through the immune system to resist the invasion of pathogens when the antigen invades the organism [17].

Mechanism of biological immune system.
It generally has the following characteristics.
(1) Diversity: Cells display antibody diversity through differentiation, gene recombination and mutation.
(2) Self-regulation: Based on the self-regulation mechanism, through the promotion and inhibition of antibodies, self-regulation maintains a certain concentration of antibodies.
(3) Memory characteristics: When an organism produces an immune mechanism, the antibody that appeared last time will be partially retained, so that when the next similar antigen appears, it can quickly produce antibodies to resist.
The principle of Immune Genetic Algorithm (IGA) is to simulate the biological immune system to resist the pathogen invasion mechanism. It is a method that simulates the development of immune mechanism on the basis of immune theory. Its advantage is that it can use the diversity of the immune system and maintain the extreme value to ensure the diversity of the population, overcome the “premature” phenomenon in the general function optimization process, and finally ensure the globality of the optimization results. The key steps of this method are: antigen recognition, which is the function optimization problem to be solved, initial population generation, antibody affinity calculation, mutation and crossover operation, and memory unit retention, etc. [18].
Immune genetic algorithm is derived on the basis of genetic algorithm, and there is more or less correlation between them. The similarities are all adopting the population search strategy, emphasizing the exchange of information and transformation between individuals, which must go through the process of “initial population generation ⟶ evaluation criteria analysis ⟶ individual information transformation between populations ⟶ new population generation”. Different places are mainly manifested in the selection and evaluation of individuals in the population and the way in which new populations are generated.
The first thing to do in the immune genetic algorithm is to simulate the immune mechanism of biological generation and perform antigen recognition. Antigen recognition is expressed in the immune genetic algorithm as the objective function to be optimized, and the corresponding solution set is expressed as an antibody. The IGA algorithm initially generates some antibodies in the initial group and evaluates the quality of the solution set through the fitness function. The fitness function, also known as affinity, indicates the closeness between the solution and the objective function. Next, new antibodies are generated in the population through crossover and mutation to renew the population. In addition, in order to improve the diversity of antibody populations, mutation treatment can be adopted in the populations. The calculation process of IGA is shown in Fig. 2 [19].

Flow chart of immune genetic algorithm.
The main steps of the IGA algorithm are:
Step 1: The solution problem is analyzed, the characteristics of the corresponding problem and solution are analyzed, and the appropriate expression of the solution is set;
Step 2: The initial antibody population is generated, N individuals are randomly generated, and m individuals are selected from the memory bank to form the initial antibody population;
Step 3: The fitness of the population is calculated;
Step 4: The parent population is generated;
Step 5: It is judged whether the expected conditions are met. If the condition is satisfied, the algorithm ends, and if the condition is not satisfied, the algorithm proceeds to the next step;
Step 6: Generation of new population: The antibody population of Step 4 is selected, crossed, and mutated to generate a new population, and then the memory individuals are extracted from the memory bank to update the population;
Step 7: The algorithm goes to Step 3 to execute and judge again.
The IGA algorithm has its own important evaluation parameters like other intelligent algorithms. These parameters mainly include the diversity evaluation of population, the similarity evaluation between individuals, and the evaluation of antibody concentration. The following will analyze and discuss these important evaluation functions [20].
(1) Diversity evaluation
In order to effectively maintain and expand the diversity of individual populations after evolution, an effective metric must be designed to measure and evaluate the diversity between individuals. In this paper, the average information entropy H (N) is used to measure the difference between individuals:
In the formula, H
j
(N) is the information entropy of the j-th gene, which is defined as:
In the formula, p
ij
represents the probability that the i (i = 1, 2, 3, ⋯ , S)-th gene conforms to appear at locus j, that is:
(2) Similarity assessment
The similarity A
ij
indicates the similarity between different antibodies, which is defined as:
In the formula, H (2) is expressed as the average information entropy of antibody i and antibody j, which can be obtained by formula N = 2. Taking a step further, the similarity between two antibodies can be extended to the population, that is, the total similarity A (N) of the population is:
The greater the A (N), the smaller the population diversity, and the smaller the A (N), the higher the population diversity.
(3) Antibody concentration
The antibody concentration indicates the proportion of antibody individuals to the population, which is expressed as:
Among them, λ represents the similarity coefficient, and its general value range is [0.9, 1].
The immune genetic algorithm mainly uses the concentration control mechanism in the antibody population and the update of the immune memory unit to maintain the diversity and automatic adjustment function of the population to avoid degradation or precocity during the evolution of the population, thereby effectively ensuring the quality of the disaggregation. Next, the key steps of the IGA algorithm are analyzed and discussed [21].
(1) Antigen recognition
The first step of the IGA algorithm is to effectively identify the antigen. In simple terms, it is necessary to abstract the problem of parameter optimization into an objective function that needs to be solved, and then generate a certain number of random solution sets, and then the variable x i (i = 1, 2, 3, ⋯ , n) that needs to be optimized is encoded with the corresponding real number. The range of the defined x i is [a i , b i ], and the corresponding real code is expressed as x i = a i + γ · (b i - a i ). Among them, γ is a random quantity evenly distributed among [0, 1].
(2) Affinity evaluation
Before optimizing parameters, we must first design an affinity function or fitness function to evaluate the performance of the antibody or the accuracy of the solution. In this chapter, the affinity function used by the immune genetic algorithm is expressed based on the accuracy of the SOC value estimated by the BP neural network, and its calculation formula is as follows [22]:
The calculation formula of antibody concentration function is as follows:
The probability of antibody k being selected under the effect of concentration and affinity is:
(3) Genetic manipulation
There are two processes of genetic manipulation: crossover and mutation. The crossover operation refers to selecting two individuals from the population, and randomly selecting one or more chromosome positions by two different chromosomes to exchange, so as to produce a better individual. The schematic diagram of the crossover operation is shown in Fig. 3 [24].

Schematic diagram of cross operation.
The mutation operation is similar to the process of chromosome mutation in an organism. In order to obtain a better individual, the chromosomes in the individual are randomly mutated, and the probability of mutation can usually be artificially set according to need, so as to produce a better individual. The schematic diagram of the mutation operation is shown in Fig. 4.

Schematic diagram of mutation operation.
Two antibodies are randomly selected from the population as the antibodies to be crossed and part of the antibody string is exchanged, and a cross operation is performed between the two selected antibodies. According to the selection probability p
c
, two antibodies x
k
and x
l
are randomly selected from the population. then. The crossover operation of the two antibodies at position j can be described as follows [25]:
Antibodies are randomly selected from the population, and the selected antibodies are mutated with a fixed probability p
m
. The variation of the j position of the selected antibody x
k
can be described as follows:
(4) Memory unit
The addition of memory units in the immune genetic algorithm can form a dynamic feedback effect in the process of population evolution and reproduction, which is also an important part of distinguishing genetic algorithms. The memory unit is also a situation in which imitation organisms can quickly produce a large number of antibodies when similar antigens appear during the immunization process, thereby reducing the immunization time. In addition, the memory unit can also reduce the number of trainings, accelerate the effective training of the network, and improve the estimation efficiency of the network.
Wavelet analysis is developed on the basis of Fourier transform. Fourier transform is one of the most widely used analysis methods in the field of signal analysis. However, it has a disadvantage that Fourier discards the time information during the transformation, which causes the transformed result to be unable to judge the information occurred at that time. Simply put, the Fourier transform has no resolution in the time domain. Wavelet analysis can rely on translation and scaling to match the input signal through a mother wavelet function, and it also provides time-frequency window characteristics to improve its resolution in the signal.
We set ψ ∈ L2 (R), where L2 (R) is square integrable in real space. ψ (ω) is the Fourier transform of ψ (t). When ψ (ω) satisfies:
ψ (t) is called mother wavelet function or basic function.
When ψ (0) = 0, the mother wavelet function ψ (t) is transformed and scaled to obtain a wavelet basis function, namely:
In the formula, a represents the scaling factor and b represents the translation factor. {ψa,b (t)} is called continuous wavelet. For signal x (t), the following formula can be obtained by wavelet transform:
The expression in the time domain is:
Wavelet analysis transformation is a new technology with time-frequency characteristics based on the time-frequency analysis field. By combining the advantages of neural networks, the advantages of the two can be fully utilized to make up for the shortcomings. After research by relevant scholars in recent years, the current wavelet neural network has been widely used in many fields. Wavelet neural network WNN has many similarities with BP including its basic network structure. The main difference lies in the wavelet basis function as the transfer function of the hidden layer. Its topology is shown in Fig. 5.

Schematic diagram of wavelet neural network topology.
As shown in Fig. 5, the network is also composed of three layers like the BP neural network. The difference is in the activation function in the hidden layer. The wavelet neural network selects the wavelet basis function ψ (t) to replace the activation function of the hidden layer. However, the hidden layer activation function of the BP neural network is often the Sigmoid function.
The wavelet neural network parameters are expressed as: The input vector is x = [x1, x2, ⋯ , x
n
]
T
, the output vector is y = [y1, y2, ⋯ , y
n
]
T
, and the expected value of the output vector is d = [d1, d2, ⋯ , d
n
]
T
. The connection weight of the input layer and the hidden layer is denoted by ω
jk
, the scaling factor and the translation factor are denoted as a
j
and b
j
, respectively, and the connection weight of the hidden layer and the output layer is ω
ij
. If it is assumed that the number of neurons in the hidden layer is N, then i = 1, 2, 3, ⋯ , m and j = 1, 2, 3, ⋯ , N. When the WNN neural model inputs the signal sequence x
i
(i = 1, 2, 3, ⋯ , n), the output of the hidden layer is calculated as:
In the formula, h (j) is the output value of the j-th node of the hidden layer in the WNN network, and h
j
is the wavelet mother function or wavelet basis function. The wavelet generating function used in this paper is the Morlet function, which is defined as:
The function graph is:
The calculation formula of the output layer is:
According to the gradient descent method, the corresponding adjustment process of each parameter is as follows:
In the formula, η
jk
, η
ij
, η
a
, η
b
is the learning rate of ω
jk
, ω
ij
, a
j
, b
j
respectively. For the partial derivatives, the following calculation formula is obtained:
In the formula, E is the error function, which is defined as:
In the formula,
(1) Learning algorithm
The network structure of the wavelet neural network is similar to that of the BP neural network. The difference lies mainly in that the hidden layer activation function in the BP neural network is changed to the wavelet basis function. At the same time, it adds a scaling factor a j and a translation factor b j to the network. The same thing is that both are the signal forward error and back propagation. The network learning process of wavelet neural network WNN is also based on the BP idea, and the weights, translation factors and scaling factors of the network are adjusted according to the direction of gradient descent.
The specific process is that when the output of the WNN network does not match the actual result, there will be an error E, which is a function related to the weight coefficient, the translation factor and the scaling factor. The principle of network parameter adjustment is to make the output error continuously decrease until it reaches a satisfactory value.
(2) Learning algorithm optimization
In order to further improve the learning efficiency and convergence speed of the WNN network and alleviate the problem of the slow evolution of the WNN network, this paper proposes an optimized learning algorithm that enhances the momentum term based on the gradient algorithm. The modified formulas of weights and thresholds of the dynamic gradient descent method with enhanced momentum terms are:
For the university legal education system, considering the actual load of the system and the low concurrency, we can use the “central database” to solve this problem. The specific implementation is to gather all the data in a central database, and it only needs to provide a unified system interface program to access the central database. This method is relatively simple to implement, but there are also many shortcomings. All logic is processed in the central database, which inevitably requires higher performance for the central database. For hardware, it increases hardware costs, and for software, it increases implementation and maintenance costs. Moreover, this solution largely determines the efficiency of the system by the server, which virtually makes the system almost non-scalable, which is not conducive to the subsequent maintenance of the system. However, in the case of low load and low concurrency, this is also a good solution.
For the integration of the army’s ideological education system, Web Services can be used to realize the interaction of business and data between the systems. Taking the theoretical test module as an example, since many systems need to obtain test results from this system, we can design a Web service in this module. In this way, other information systems can call this service to obtain basic information related to test results when needed. For each module, the required information can be provided to the outside world in the form of Web services, and other systems that require related information can be obtained by calling these Web services.
Figure 7 is a diagram of the educational system integration model. The entire system mainly includes the following entities: users (the following figure uses the administrator as an example), user rights, test papers, test paper details, test paper scores, suggestions, courses, comments, etc. As shown in the figure, there is a one-to-many relationship between administrators and courses, test papers, comments, suggestions, administrators and permissions are one-to-one, courses and reviews are many-to-many, test papers and test paper scores are one-to-many, and test papers and test paper details are one-to-one. In Fig. 7, some simple attributes, such as the creation time and modification time of each entity, are omitted.

Morlet function diagram.

Integrated model diagram of university legal education system.
On the basis of constructing the above system, the system performance is evaluated, which is mainly carried out through system simulation. In the system testing stage, it is necessary to test each content in the requirements analysis, whether it meets the functional requirements and non-functional requirements, and whether various pre-post conditions are established. For example: the user’s login is tested to check whether it can log in normally, whether there is an abnormal prompt for login failure, etc.; whether the access and operation of database data are in accordance with the corresponding user permissions are detected; for the cloud, whether the operation of the shared file system is enough to normally handle upload, download, and delete operations of different users is detected. This article mainly conducts a one-day performance test on the system, verifies it through different operations, and randomly performs performance. The following analyzes the core sub-functions such as administrator login, permission allocation, data search, and data display, and analyzes its accuracy. 60 groups of experiments were conducted respectively, each group was conducted 10,000 times, and the final results are shown in Table 1 and Fig. 8.
Statistical table of performance test

Statistical diagram of performance test.
From the statistical results in Table 1 and Fig. 8, we can see that the performance test of this study is basically above 99.99%, which shows that the university legal education system constructed in this paper has a certain effect. On this basis, the evaluation function of the university’s legal education system is tested, the students’ legal learning is scored through the system, and the scores are compared with the students’ examination results, and the results are drawn into statistical graphs. In this paper, 50 students are selected as the research objects, and the results are shown in Table 2 and Fig. 9.
Statistical table of system evaluation function
As shown in Table 2 and Fig. 9, there are some fluctuations in the system score and the student’s test scores, but the deviation is basically within 15%, which shows that the model proposed in this paper has a certain effect.

Statistical diagram of system evaluation function.
In order to solve the problems of the lack of traditional teaching systems or the defects of existing systems that are not practical, focused, or intelligent, this paper studies and designs the university legal education system to integrate and optimize the original hardware and software and operating procedures. Moreover, it further highlights the functions of interconnection and sharing, automatic sensing, real-time recording, interactive feedback, dynamic supervision, intelligent analysis, etc., and strives to achieve the “one-click start, worry-free throughout” effect, which greatly facilitates the evaluation of teaching at all levels. In particular, this study uses big data technology and intelligent analysis of data completeness, multimedia application rate, system execution, and average test scores to scientifically evaluate the implementation and educational effects of the primary education system. Moreover, this research effectively solves the problems of quantitative formalization and qualitative subjectivity of current educational evaluation from the technical level. In addition, this research has realized the change of education examination evaluation from static to dynamic and offline to online, which is a major innovation and breakthrough in the legal education department of universities.
