Cite

Introduction

With the development of electronic computers and the advent of the 5G network era, in order to break through the limitations of too low information transmission speed and too few data bits for electronic computers, scientists in the field of computing have gradually tried to develop a faster, more reliable Three-valued computer is one of the new types of computers that require high equipment and less power consumption. Its principle is to use the two mutually perpendicular polarization directions of the optical state and the non-optical state to represent information. At present, the relatively complete architecture and physical machines that can be run are the ternary optical computers and ternary electronic computers developed by the ternary computer team of Shanghai University. The development of ternary optical computer has been more than twenty years so far, and a series of considerable results have been achieved. The ternary optical computer is a photoelectric hybrid computer. It is a computer with electrical control and optical operation”. It has many operator bits, the operator bits can be arbitrarily grouped, and each group of operator bits can be assigned to different users. The computing function of each bit of the operator can be reconfigured at runtime [1,2,3]. The ternary electronic computer is researched on the basis of many achievements of the ternary optical computer. The main idea is to transplant the structure of the ternary optical processor SD16 to the processor constructed by the electronic circuit, and realize the multi-value electronic processor. Arbitrary grouping of processor bits can be realized by using the feature of no correlation between the operator and the number of bits of the operator, and the grouping of processor bits can also be used independently.

In 2010, the ternary optical computer team gradually completed the data splicing technology and data clipping technology [5], monitoring program [7], MSD binary adder[6]. These achievements have brought new progress in numerical aspects of ternary optical computers. Among them, the monitoring program enriches the computer monitoring system's management theory and technology for data bits, and paves the way for users to use ternary optical computers conveniently and efficiently [7].

In 2017, SD16, the prototype system of ternary optical computer, completed the 48-bit TW-MSD parallel addition experiment. This achievement marks that the hardware structure of ternary optical computer has been perfected, and the application of ternary optical computer has been explored since then.

One of the characteristics of the ternary optical computer is that the more data it processes, the higher the computing efficiency. The SD16 monitoring system effectively manages the optical computer processor resources with huge data bits. There is no doubt that how to store the data in the ternary computer monitoring system is also the research content of the ternary optical computer at this stage. For a ternary optical computer, the ideal memory is the optical rotatory properties of some new materials to store the polarization direction of light, but no available raw materials have been found so far; another storage method is to store the light itself, “fiber ring memory” is A usable device, with stable storage effects over 30 min has been observed, for the registers of ternary optical computers. Before the appearance of the ideal optical polarization state memory, the existing binary semiconductor memory can be used to store ternary data through group code conversion to form the memory of the ternary optical computer [8]. Therefore, in the operation process of the ternary optical computer, we need to manage the data and solve the following problems: first, in what form is the data stored in the memory; second, what functions should the data storage module have for each SD16 monitoring program? module usage.

Related work
Computational data model

Figure 1 shows the calculation data model of TOC. The working process of this model is as follows: the user program of the client submits the calculation task to the SZG file receiver/sender (communication server) in the format of SZG file, and TOC task management. The software receives the SZG file, and analyzes the file to obtain the reconstruction information and calculation information of the lower computer, thereby forming a reconstruction frame and a calculation data frame. The TOC large task management software transmits the reconstructed frame information to the lower computer control software, and the lower computer control software parses the reconstructed frame information to form the reconstructed latent image table of the optical processor, which is sent to the reconstruct or to complete the reconstruction. The TOC task management software takes out the calculation data in sequence from the SZG file, and organizes these calculation data into the input data of the composite optical calculator. These sorted data are sent to the composite optical calculator for calculation until all original data calculations are completed, the result beam is sent to the decoder for decoding to obtain binary result data. These result data are organized into calculation result files by the task management software, and the result files are transmitted to the user program of the client through the SZG file receiver. Since TOC will process the data files of different users for calculation, one user corresponds to one SZG file, TOP will reconstruct the calculator and calculate the data file according to the SZG file, so a space should be opened up to store all the data required by TOP, which should be Contains two worksheets: compound operator data table and operation result data table. The two tables corresponding to each user are different. After TOC processes the operation data of a user, the space occupied by the worksheet should be released in time to increase the memory. space utilization.

Figure 1.

Computation-Data Mode

The architecture of ternary optical computer monitoring system

Figure 2 shows the architecture of the ternary optical computer monitoring system, which is mainly divided into the client and the server to complete the work jointly. The client mainly includes user interface, inspection, communication transformation, network communication and communication inverse transformation. The server side mainly includes network communication, data sorting; request scheduling, timer, processor allocation, operator reconstruction, encoder control signal generation, reconstruction register, hardware reconstruction, encoder A, encoder B, Modules such as camera A, camera B, operator, decoding A, decoding B, generating operation results, and generating return results. Some of the modules on the server side are placed on the upper computer and some on the lower computer for the following reasons:

In order to make the optical processor of the ternary optical computer focus on optical computation. The TOC optical processor is suitable for processing big data and massive data, it can handle multiple tasks at the same time, but there are certain limitations. Assuming that the maximum number of tasks it can process at the same time is TaskMax, when the number of operation requests is greater than TaskMax, there will be operation requests waiting on the host computer. In order to improve the efficiency of the whole system, let the lower computer, namely the optical computer, focus on optical computing, and put the modules of network communication, data sorting, request scheduling, processor allocation, timer and generating return results in the upper computer;

In order to reduce the amount of communication between the upper computer and the lower computer, the modules for reconstructing the operator, generating the encoder control signal, decoding A, decoding B and generating the operation result are placed in the lower computer. Other optical hardware modules run on the server-side lower computer. In addition, the request scheduling module and the data sorting module can be exchanged with each other, but the efficiency of the system will be different. If the operation request scheduling is performed first, and then the data sorting is performed on the scheduled operation request, the data sorting at this time will occupy a certain time in the “operating” state of the operation request. If according to the figure, the network communication module will organize the data after receiving the user's operation request. For a certain operation request, although the time for data sorting and scheduling is unchanged in these two cases, the data sorting is completed while it is waiting for scheduling and other operations performed by the optical processor, so that the to a certain extent, it provides the overall efficiency of the system.

Figure 2.

Ternary Optical Computer Monitoring System Architecture

SD16 monitor software

The SD16 monitoring program software comprehensively and clearly describes the overall view of the bottom control software of the ternary optical (electronic) calculator, the functions of the main software modules, the functions of the main functions, the calling relationship between functions, the sharing and transfer of parameters, The integration method of third-party routines, the cutting method of this software for different purposes, etc. are the key technologies. At the same time, it provides software boundary and framework for the compilation of each function. The system used to study the underlying software and debug application routines of the ternary optical computer should be installed: three modules: administrator operation, online user operation and offline user operation. For the whole program software, if you want to fully experience the system of the ternary optical computer, you only need to install the system that does not include the offline module; and, on the premise that the system is completely stable, the administrator operation module may not be installed.

Main program module

The main program is the entrance of the SD16 monitoring program. The user enters the monitoring program, and the main program displays the interface, prompting the user to select the operation to be performed options.

Admin action

As mentioned in the introduction of Chapter 1, a ternary optical computer is a electrically controlled, optically operated” computer. In the ternary optical computer monitoring system, the server receives the operation data sent by the client and generates the operation request chain list through the data sorting module, and uses the encoder control signal module to encode the scheduled operation request, and the encoder A module is responsible for transmitting the operation request. The generated tri-state light is given to camera A. The reconstruction hardware module includes reconstruction registers, high-resistance gates, resistors, etc. It needs to receive the code A to generate the three-state light decoding result and the reconstruction code of each liquid crystal pixel to complete the operator reconstruction. In many cases, we need the program to obtain administrator operation authority to perform some operations that require higher authority. For ternary optical computers, higher authority operations include coordinate mapping (scaling) between operator pixels and camera pixels, computing the output light state judgment rule setting (threshold value) of the device can be completed by the administrator.

Exit the administrator operation and return to the main program page

This module returns to the previous system page for selection.

Calculator pixel and camera pixel scaling

This module is mainly responsible for completing the acquisition of data operation results.

The upper computer in the server side receives and organizes the request data sent by the user through the client into an operation task list, and the lower computer selects an operation task according to the operation request priority of the operation task list, and assigns an operator to complete the data operation. Among them, the data calculated by the operator is not the original data input by the user, but the optical signal encoded by the reconstruction hardware of the lower computer after generating the encoded signal, and the optical signal is transmitted to the operator. After the operator completes the optical data operation, the result is Output to the LCD panel, use the camera to obtain the operation data on the LCD panel, decode the optical data and generate the operation result in the form of ASCII code and return it to the client user interface.

Calculator pixel output light state judgment rule setting

This block is used to assign operators to computing tasks.

The characteristics of the ternary optical computer include that the arithmetic unit can be reconfigured on demand to handle massive data. After the lower computer selects the operation request, the reconstruction hardware completes the reconstruction of the arithmetic unit. According to the SZG file, the operation data types received by the lower machine include simple data types and structured data types. When performing data operations, computing tasks with the same computing rules can be performed at the same time, reducing the time for hardware reconstruction. The more data that one operator processes, the higher the computing efficiency. In addition, to test the result field length of each operator, you can choose to note one by one, or you can choose to test continuously, output it to the LCD panel, and obtain the operator field length through the camera. This operation can be used for computing requests.

Connected User Operation

For a system for users to experience the characteristics of a ternary optical computer, a module that does not include offline user operations can be installed, and if the machine structure is stable enough, the administrator operation module can also not be installed. The on-line operation of the ternary optical computer refers to connecting the client, the user inputs the operation data to the lower computer on the server side through the client platform, and the lower computer then performs complex data operations. The user enters the connected operation interface through the main program, and the host computer prompts the user to select the operation to be performed. The specific operations include:

Quit

Returning to the main program module, the user re-enters the operation to be selected.

The user selects an existing compound operator to perform data operations

One of the characteristics of the ternary optical computer is that the server needs to reconstruct the calculator at any time according to the data calculation problem sent by the client. Therefore, the SD16 monitoring program software needs to develop a worksheet to save the defined compound calculator. A specific function is required to append records to the data in the data table, allowing changes and timely updating of the data in the worksheet. The user operates the existing compound operator according to the data table of the compound operator displayed by the host computer. If the structure of the compound operator in the data table needs to be changed, the server-side program saves the changed operator structure; otherwise, the compound operator is used. Complete the data operation, and save the structure of the called compound operator into the corresponding structure array. After the user completes the selection, return to the previous operation.

The user chooses to create a new compound operator to perform data operations

The computer-connected user operation is a module that helps users experience the characteristics of a ternary optical computer. After inputting the operation data, the user can choose to create a new compound operator to complete the operation of the data. The user inputs the operator number of the user-defined composite operator, and the reconstruction hardware module performs operator reconstruction after receiving the user request to complete the reconstruction of the operator. At this time, the operator number in the composite operator data worksheet is updated. After the update is complete, select Continue Refactoring Component or End Refactoring Component.

Enter raw data

This module also contains the following two operations:

Replacing the compound operator

As mentioned above, the on-machine operation helps the user experience the characteristics of the ternary optical computer and is user-oriented. Therefore, the user can also choose to replace the composite operator to complete the data operation.

Input data

After the user completes the selection of the operator, the data is input, and the input methods available for the user to choose include single-group input data and multi-value input data. The input of a single set of data means that the user inputs the calculated data multiple times without repetition into the structured data array, which is used to store the single structured data that the user needs to calculate; the other is multi-valued data input, the user needs to input continuously. The data value of the operation, the data value corresponds to the compound operator name one-to-one, and the data value is stored in the structure array. After the data input is completed, update the value of the composite operator.

Rebuild Optical Processor

In the ternary optical computer monitoring system, to complete the user operation, it is necessary to allocate processor resources for each operation request, and the processor resources include an encoder, a decoder and an operator. The processor allocation module on the server side allocates optical processor resources to the user according to the calculation amount and priority of the user's calculation request. A good processor allocation algorithm can improve the overall performance of the system. For a ternary optical computer, the processor resource is the allocation of liquid crystal pixels, that is, the liquid crystal pixels must be addressed before the operation. After the processor bit allocation is completed, each processor bit corresponds to the reconstruction instruction of the relevant operation rule, the task management software first generates the reconstruction latent image and then completes the reconstruction of the processor. In the SD16 monitoring program system operation, the system searches for the name of the compound operator given by the user. If it is found, it calls the function to generate the reconstructed latent image array to obtain the reconstructed data, and then calls the reconstruction function to complete the reconstruction operation of the optical processing and returns to the above primary operation. If the system cannot search for the compound operator name entered by the user, the user will re-enter it.

Get the calculation result (Camera B)

After the user inputs the operation data, the server performs the operation of the data, and finally returns the operation result to the client. There are two actions for the user to choose from in this module:

Confirm compound operator

Wait for the user to confirm the compound operator and then perform data operation.

Replacing the compound operator

Displays the composite operator structure table, and the user inputs the value number of the composite operator to be selected.

The most significant difference between an optical computer and an electronic computer is that an optical computer uses the characteristics of light to complete data operations, and the final calculation result is also optical data. Therefore, the operator maps the resulting optical data to the liquid crystal panel after completing the data operation, and then captures the pixel value of the liquid crystal panel through the camera, decodes the pixel value of the liquid crystal panel into an ASCII code value and returns it to the client.

Offline User Actions

Systems used to work with SZG files can only install offline user modules. The offline module can be completely separated from the client side of the SD16 program software. The server side directly receives the data sent by the SZG file generation software platform, performs data operations and operations, and finally returns the operation results to the user.

Related data structures

In order to save the user-defined compound operator, original data and corresponding calculation results, the SD16 monitoring program software needs to use the compound operator as the associated keyword, and the function should have the ability to add additional records to the data table. Basic functions such as data exchange, retrieval, deletion, and copying with arrays can improve the data calling efficiency of each module of SD16 monitoring software.

Operation request

In the monitoring system, the client sends an operation request containing data such as operands and truth tables to the server, and the operation request has two attributes: priority and operation amount. The operation request does not communicate with other operation requests in the whole calculation operation, so the operation request is independent. According to the input interface displayed by the client to the user, the user should input the following data: “E-mail”, “password”, “payment level”, “domain number Y” and some related information. The format of the operation request data is shown in Figure 3, where the numbers in parentheses represent the number of bits of data. In the following description, the priority of the operation request is jointly determined according to the amount of data requested by the user and the payment fee. The more complex the amount of operation data and the higher the payment fee, the higher the priority number of the operation request.

Figure 3.

Reconstructed data frame format

Reconstruct the dataframe

The operator of the ternary optical computer is composed of several simple primitives. After the processor bit allocation is completed, each processor bit corresponds to the reconstruction instruction of the relevant operation rule. The reconstruction format frame is shown in Figure 4: Frame type flag: It is identified by a data bit. The value of this bit is 1 for reconstructed frame and 0 for data frame.

Figure 4.

Operation request data format

Reconstructed frame type valid flag: 1 bit, the value of this bit is 1 means the reconstructed frame is valid, 0 means invalid.

Reserved: 6 bits, which are used as extension bits for subsequent development, and are also composed of frame type valid flag and frame type flag

One byte is convenient for task management software and lower computer control software to analyze. Reserved bits are currently set to all 0s.

Internal task number: corresponding to the variable ID, the number of the SZG file in all tasks.

Number of operation types: It means that the SZG file contains several types of operations.

Operation Type: The corresponding calculation type in the SZG file.

Start Bit Order: The start bit on the optical processor of a calculation type in the SZG file.

Number of processor bits: The total number of processor bits required for each operation.

Parameter area: Indicate several parameters of this type of transformation.

Reconstruction code area: used to store the reconstruction code of each operation in the SZG file. Frame type flag, reconstructed frame type

The valid flag bit and task number are determined by the task management software according to the actual situation of the task calculation. The number of operation types is obtained by parsing the number of calculation marks in the SZG file, and the number of operation types is obtained by parsing the

Calculator generating function

a) Function and calling timing: In the architecture of the ternary optical computer monitoring system, after the lower computer receives the operation request sent by the upper recorder, it now searches the compound operator table for the compound operator that meets the calculation rules of the operation request. Allocate an operator for the calculation request. If it is not found or during the operation of the connected user, the user chooses to create a new operator to experience the characteristics of the ternary optical computer.

b) Step:

Step 1: First determine the operation rules of the operation request (binary logic, three-valued logic, MSD addition, decimal addition);

Step 2: When the operation rule is a binary logic operation or a ternary logic operation, subdivide the operation rule into not, NAND, NOR, OR, AND, XOR operation, and input two or three English words mu as logical symbols;

Step 3: When the user inputs data on the client side, it is in the form of a truth table, and after determining the value in the truth table, determine the maximum number of digits of the data (determine the maximum number of digits that the operator can process);

Step 4: Add the newly created calculator to the composite calculator data table, and increase the number of calculators in the monitoring system by one.

Reconstructed latent image group generating function

This function is used to generate the reconstructed latent image group of the composite operator, and to complete the operator reconstruction, first initialize a structured array to store the reconstructed latent image data. The steps to generate reconstructed latent image data are as follows:

a) Receive operation data: After the server receives the operation data sent by the client, the host computer mounts the operation request on the task list;

b) Select a computing task: the lower computer selects a computing task according to the priority of the computing request, or when the user experiences the ternary optical computer to choose the computing device reconstruction by itself, and analyzes the computing task of the user;

c) Generate reconstruction instructions: generate operator reconstruction instructions through the encoder control signal module to analyze the amount of operation in the operation task and the operation rules;

d) Grouping of latent image values: According to the operation rules (two-valued logic, three-valued logic, etc.), the reconstruction instructions are grouped and stored, and the reconstructed values are mapped to the LCD panel;

e) Hardware reconstruction: The reconstruction register uses the reconstruction code of the liquid crystal pixel to complete the reconstruction of the arithmetic unit.

Problem Description

Any computing task running on an optical computer or an electronic computer is inseparable from the operating system's task scheduling and memory allocation. The ternary optical computer needs to deal with huge amounts of data. Effective management of the operation data is one of the solutions to improve the computing efficiency of the ternary optical computer.

Virtual memory is proposed to solve the problem that the existing memory cannot meet the memory needs of a large process, and it is one of the technologies often used by computer operating systems. Each process has an independent logical address space, and the memory is divided into several “pages” of size. Each page is a continuous address. For a process, there are many logical memory spaces, some of which correspond to physical A piece of memory, and a part of the unloaded memory corresponds to the hard disk.

The continuous single allocation memory management method is used to manage physical memory, and is mainly divided into single continuous storage management and partitioned storage management.

Single Continuous Storage Management

The single continuous storage management method divides the memory into two parts: the system area and the user area; the application program is loaded into the user area, and the application program can use all the space of the user. This method is suitable for a single user and a single operating system. Although it is easy to manage, once all the programs are loaded into the memory, it means that the programs that are not frequently used will also occupy part of the memory.

Partitioned storage management

Partition management is proposed to support multiprogramming systems and time-sharing operating systems, and multiple programs are executed concurrently. The commonly used method is called memory compaction. Partitioned storage management divides memory into a number of equal or unequal sized partitions, one of which is occupied by the operating system and the rest used by applications, each application occupying one or several partitions. Although partitioned storage management can support concurrency, it is difficult to share memory partitions. Partitioned storage management introduces new problems: internal fragmentation and external fragmentation.

Fixed partition

The characteristic of fixed partition is that the memory area F is divided into several consecutive partitions of equal size. Although this kind of general is easy to implement, it will cause waste of memory fragmentation and limit the number of programs.

Dynamic Partitioning

The characteristic of dynamic partition is to create partition dynamically. When the program is loaded, the operating system divides the program into batches or changes the size of the partition according to the initial requirements. The idea of the algorithm of the too partition is to find a suitable free partition for a program. If the free partition is larger than the original need, it will be divided into two parts, one of which is marked as occupied, and the other is marked as free. The order of partition allocation is usually from the low end of the memory to the high end. One thing to pay special attention to about dynamic rage release is to merge adjacent free regions into larger memory regions. Commonly used partition allocation methods mainly include: first-fit method, first-fit algorithm, best-fit algorithm, and worst-fit algorithm.

Algorithm design
Data Classification

In the monitoring architecture, the data is divided into operation data and operation data. The user submits the data operation problem to the TOC in the form of SZG file, because the SZG file data submitted by the user is uncertain. According to the large number of ternary optical processors, in general, the task management software classifies tasks according to the SZG file data format according to a certain strategy, generates different task queues, operates on different task queues, and improves the performance of the ternary optical computer. Overall efficiency, task division strategies are roughly divided into the following categories: calculation type-based strategy, priority-based strategy, payment-based strategy, business behavior-based strategy, and data-volume-based strategy. Strategy: divide computing tasks into large tasks and micro tasks. Operation data is divided into: operation data, operation rules, reconstruction instructions, compound operator table and operation results.

Allocate memory space
Big task

For the entire workflow of the TOC monitoring system, after the server has sorted out the operation requests sent by the client, the partner algorithm allocates free memory blocks for a task, and creates a dynamic linked list to store some operands, Variables such as operation rules and priorities [12].

For the large task of the ternary optical computer: a large task occupies an optical processor, this strategy can completely avoid reorganizing the original data and extra data, and also avoid the invalid state of the TOP part of the partition, improving the system efficiency ; Construct calculators with the same working time or the same number of iterations as a composite operator to manage the data input and result output of this group of calculators in a unified manner, which can simplify the complexity of data scheduling; In other words, the more calculators each compound operator contains, the less the number of compound operators, and the easier it is to manage them in groups; in addition, the number of bits of the ternary optical processor can be allocated according to the compound operators, but considering that the number of bits of the composite operator is much smaller than that of the optical processor, multiple composite operators can be constructed on the optical processor, including constructing different composite operators at different positions of the optical processor In order to improve the overall efficiency, it is stipulated that the optical processor should process a large task uninterrupted; according to the ternary optical processor The computer uses an electronic computer as an auxiliary PC. It can be known that the memory of the PC is limited, and all the data in a SZG file cannot be preprocessed at the same time. The data can only be divided into blocks according to the size of the PC memory, and the PC reads a piece of data at a time. Processing, the operand code generated after processing the data is sent to the TOP encoder for data operation; according to the SZG file format, the calculation of a SZG file data can contain different quantities, when a calculator in the compound operator When there are more calculators than other calculators, some calculators have already played with the calculator, while other calculators are still waiting for the data, which will cause the event to idle and reduce the work efficiency. To refine the specific structure of the composite processor, the idling of the entire composite operator is minimized.

There is a large task T. It is known that a large task SZG file can store 1TB of data. The process of allocating a memory block of order to T by the partner algorithm is as follows: In the partner system, all memory blocks are 2 The system searches for a free memory block larger than T in the free_area array. The upper limit of the number of free_area elements is MAX_ORDER, and a variable current is defined to record the order of the currently found free memory block. If the system finds that the subscript of the array element is MAX_ORDER-1 and cannot be found, the erase search fails, indicating that the allocation requirements of task T cannot be met, and a null pointer is returned, indicating that the memory allocation failed; if the search succeeds, the order of the found Assign it to current, remove the home page descriptor of the first free memory block from the current free list, the pointer page points to the array element, reduce the number of the current element free list by one (free_area [current]. nr_free), set one the variable m records this value. If current is greater than order, it means that the memory block is larger than the requested memory block and needs to be divided twice, and the current-order memory block is divided into two current-1-order memory blocks, using B L and B H respectively records the two memory blocks located at the low address and the high address, using the page descriptor pointer to point to B L, and using page+2current to point to the page descriptor of BH; insert BH into the idle current-1 level In the linked list, set the m value of current-1 order plus one, modify the page descriptor of B H by page+2 current+1, calculate the value of current-1, if it is still greater than order, continue to divide until the remaining memory blocks The order is equal to order, point the page pointer to the home page descriptor of the remaining memory block, and subtract 2 from the entire page frame number to complete the memory block allocation of task T.

Microtasks

The data calculation amount of microtasks will not exceed that of large tasks, so if there are multiple microtasks with similar calculation rules, they can share the same compound operator or the calculator in the corresponding operator, reducing the number of reconstructions of the operator. Completing the calculation of multiple tasks within a time, reducing event idling, and improving system work efficiency; if the calculation rules of micro-tasks are different, it is necessary to reconstruct the calculator, but due to the relatively small amount of tasks, the calculation speed will be higher than that of large tasks. But for a ternary optical computer, the larger the amount of data, the more tasks, the higher the work efficiency, and the more the advantages of the ternary optical computer can be demonstrated. Suppose that the SD16 monitoring program receives two micro-tasks T1 and T2 from the client, and now allocates memory blocks of order1 and order2 for them. Obviously, the amount of data in the SZG file of a microtask must be smaller than that of a large task. As mentioned above, the same operator can be used to complete the data operation of multiple microtasks at the same time. Therefore, for the memory allocation of microtasks, improve system resource utilization by allocating a large block of memory for multiple microtasks. The process of allocating space is similar to that of large tasks, except that the size of the free memory block to be searched in the dynamic linked list should be greater than the sum of order1 and order2, and then it is divided. Update the number of free lists in the free_area array in time.

Working principle

For the TOC monitoring system, the type of user data, the amount of data, and the calculation rules received by the server may be very different each time. If fixed partition allocation is adopted, the memory space allocated to the task will be insufficient or there is still space left(internal fragmentation), resulting in waste of resources; while dynamic partition allocation may result in external fragmentation and waste of resources.

As mentioned above, fixed partitions limit the number of processes to execute, and when the process size does not match the memory space, the utilization of the memory space will be greatly reduced. The dynamic partitioning method has complex algorithms, high system overhead, and external fragmentation. The partner algorithm can compromise the deficiencies of the above two methods.

Create an array in the buddy system to keep track of free memory blocks. Suppose now that 2 pages of memory are to be allocated, the partner system will look in the book to see if there is free memory larger than required. If there is, it will be divided into two parts, and the allocated memory block will be divided into two parts according to the power of 2. Array free list.

Related data structures

The Linux kernel divides physical memory management objects into three levels: nodes, regions, and page frames. Organize these three data structures together; the global array mem_map stores the page descriptor, and the pointer zone_mem_map is created in the zone descriptor to point to the starting page frame page descriptor of the corresponding memory area. Concatenate all node descriptors into a linked list, creating a pointer to the first node descriptor.

Create a free_aera array to track free memory blocks. The array has a maximum of max_order elements. Each element contains the head node of the free list (freee_list) and the length of the free list (nr_free) two attributes; the top of Figure 5 for an array that records the free memory as soon as possible, the following is the memory usage. The data sorting module on the server side of the TOC monitoring system sorts the operation request (Figure 4) sent by the client to generate the request scheduling operation request, and then inserts it into the operation request list according to the priority. The meeting algorithm allocates space for a request based on its size.

Figure 5.

Idle Chain List and Memory Block Distribution Diagram

Memory block recycling

The buddy system refers to two free blocks of equal size, adjacent, that can be synthesized into higher-order memory blocks as buddies. During the merging process, first determine that the memory blocks reclaimed with equal bands are partners with each other. If the partners are in an idle state, the two are merged into a higher-order memory block, and the process is repeated until the merged memory block has reached the highest order. The merger of partners should also be discussed in categories: partners on the left, partners on the right.

• The partner is on the left: b=p2k b = p - {2^k}

The index of the first page of the k-1 memory block formed by the merger is b and it satisfies that b is divisible by 2k+1, so the lowest k+1 bits of the binary form of b are all 0, so b[k]= 0, set b[k] to 1 to get p, so p[k]=1, p=p p^\prime = p

• The partner is on the right: b=p+2k {\rm{b}} = p + {2^k}

The index of the first page of the memory block of order k+1 is merged to form p, and p is divisible by 2k, so the lowest k+1 bits of the binary form of p are all 0, so p[k]=0. Among them, p is an integer, p[k] represents the bit k in the binary form of p, p=b {\rm{p}}^\prime = b

According to b=pk {\rm{b}} = p \oplus k

The calculation of the partner home page index, the merged high-order memory block home page index can be calculated, and then the partners can be merged. p=pb p^\prime = p \wedge b

Data storage method

The research content is based on the architecture of the ternary optical computer monitoring system, in which the operation data is stored in the form of SZG files, and the operation data is stored in the form of a data table. The developed two worksheets include the original data and the corresponding calculation results, a user-defined compound operator. The two tables are designed with a compound operator named associative key.

The compound operator table includes the compound operator name, the compound operator structure, the last used time, the calculators contained in the compound operator, the calculator calculation rules, and the compound operator's same name serial number (convenient for users to define the same name operator)

Original data: In the online user operation, the user can create a compound operator by himself, so it is necessary to define an array to store the operator used for the operation data (the array element is a structured array), and the subscript is the operator bit sequence. Each bit of data input by the user is regarded as a character, and each character is converted into a communication internal code (01, 00, 10) according to the user's operation rules (two-valued logic, three-valued logic, MSD addition);

Operation result: The composite operator returns the optical data after completing the data operation. After decoding the optical data, it outputs the ASCII code data and returns it to the client user interface. The operation data includes: the number of generated liquid crystal pixels, the operation result pointer, the operation to be involved in the operation result to form a sequence table, the field length (the number of bytes occupied by the operation result), and the operation result data.

Data call timing
Operation data

After receiving the operation request sent by the client, the upper record of the client sorts it out, and finally mounts it on the operation request linked list, and then completes the task scheduling according to the priority timing scheduling algorithm, selects an operation request and sends it to the next crisis, the lower computer The operation data is analyzed to generate corresponding reconstruction instructions and encoded signals.

Algorithm

The lower computer performs hardware reconstruction according to the operation rules of the operation request, and allocates processor resources for the operation tasks. The processor resources include an operator, a reconstruction register, and an encoder.

Refactoring instructions

The ternary optical computer will reconstruct the operator according to the user's calculation request. In the online user operation, the user creates a compound operator name to experience the characteristics of the ternary optical computer. After receiving the compound operator name created by the user, the reconstruction register generates reconstruction instructions according to the user's data operation rules, and reconstructs the hardware module. Call the refactoring instruction to complete the refactoring of the operator.

Compound Operator Table

According to the operation request sent by the upper computer, the lower computer searches the compound operator table for the compound operator that meets the operation rules of the operation request; or in the operation of the connected computer user, the user creates the compound operator to complete the calculation of the operation task, and the creation is completed. Then update the data in the compound operator table.

Operation result

SD16 monitoring system will first encode the operation task into optical data, and perform operation on the optical data. After the optical data operation is completed, the camera will be used to collect information. The decoding module generates the operation result in the form of ASCII code, and finally inserts the operation result into the operation result linked list, and retrieves the operation result that has completed the operation and returns it to the client for display to the user. If the operation task has not been completed, call the existing operation result to complete the operation when the next operation is performed.

Summary and Outlook
Summary

The data management of ternary computer monitoring program software should have the following functions: save the operation data and operation data in the monitoring program, save the user-defined compound operator, original data and corresponding operation results in the form of a data table. The data table file is tracked and updated in real time, and data is exchanged with the array, including functions such as retrieval, deletion, copying, and modification, which are provided to each module call of the monitoring program software.

Outlook

As a new type of computer, the ternary optical computer has gradually improved its theoretical system structure and entered the practical stage after nearly 20 years of research and development, and gradually entered people's field of vision. How to effectively manage the computer data that has a large number of data bits in a ternary computer and can be allocated by the processor on demand is also a problem that many scholars are paying attention to at this stage. Effective data storage can improve the computing efficiency of the ternary optical computer. This paper the research content is based on the many research results of the research team. For the SD16 monitoring program software that has been developed, this paper is the first to study the optical computer data management and propose a set of management plans. The data is classified and stored, and then a reasonable storage space is allocated for the data, and the data is updated in time to be called by each module of the monitoring program software, and the space is released in time after the data is used. According to the research tasks at this stage, there are still some imperfections in this paper. In the future use process, the details of the scheme will be gradually improved, and new technologies and strategies will be explored.

eISSN:
2470-8038
Idioma:
Inglés
Calendario de la edición:
4 veces al año
Temas de la revista:
Computer Sciences, other