Pay attention to designing system updates and patches.

Source: Internet
Author: User

Pay attention to designing system updates and patches.
We usually develop a system that must be upgraded frequently. Upgrading means modifying the code or data structure. Of course, you should try to modify the data structure as little as possible in the next system.
So how should we provide updates for users to upgrade when others are not currently using the latest version?

Version Number
First, there is no doubt that each download of a version should have a corresponding version number for differentiation. In this way, if the current user version is different from the latest version, it indicates that the user should be updated.

Patch updates
Second, how to provide updates. Method 1: only modified files are provided, and the modified files should be packaged according to the system directory. For example, I modified the index in the admin folder in the system directory. the PHP file cannot be directly stored in the patch. php, but to create a new admin folder, the modified index. after saving the PHP file, package the admin directory. Method 2: Package the system as a whole no matter how many files are modified. The patch package should contain detailed update instructions and update methods.

How to update a user
Third, how to make the user update. Both methods allow the user to download the patch and overwrite the original file. Of course, the user should be prompted to back up the original file based on insurance considerations. You can separately download the update package or provide online updates.

Data Structure update
Fourth, update the data structure. This is not the same as updating the Code. It is a little special. Because data may already exist in the database, you must not delete the original database and generate a new database. So what should we do? You can only operate on a specific table by modifying statements, such as adding or deleting fields, adding or deleting a table.

Cross-version update
Fifth, how to upgrade a large version span. Some users may use an old version, which is separated from the latest version. How can they upgrade the version? The most insurance is the installation of a patch and a patch. If one-time installation is required, different installation packages must be created based on different versions, because only one file may be changed from version 1 to version 2, and only one file may be changed from version 2 to version 3, however, two files have been changed from version 1 to version 3, so it is necessary to create different installation packages based on different versions.

In short, the most important thing to update a patch is to be able to accurately identify the difference between the current version and the latest version, and then download the corresponding patch. Exercise caution when modifying the data structure. In general, you can add a new table or field, but avoid deleting it as much as possible.

System Problems

Memory Error in Windows

In Windows, users may encounter the following error message: "0X ???????? Instruction reference 0x00000000 memory, the memory cannot be written ", and then the application is disabled. If you ask some "experts", the answer is often "Windows is so unstable" and so on. In fact, this error is not necessarily caused by Windows instability. This article briefly analyzes the common causes of such errors.

1. failed to check memory allocation by Application

When a program needs a piece of memory to store data, it needs to call the "function" provided by the operating system to apply. If the memory is allocated successfully, the function will return the newly opened memory zone address to the application, and the application can use this memory address. This is "dynamic memory allocation", and the memory address is also the "Pointer" in programming ".

The memory is not always used, and sometimes the memory allocation fails. When the allocation fails, the system function returns a value of 0. The returned value "0" does not indicate a newly enabled pointer. Instead, it notifies the application of an error. As an application, check whether the returned value is 0 after each memory application. If yes, it means that a fault has occurred and some measures should be taken to save the problem, this enhances the robustness of the program ".

If the application does not check this error, it will regard this value as an available pointer to it according to "thinking inertia" and continue to use this memory in subsequent operations. The real 0-address memory zone stores the most important "Interrupt Descriptor Table" in computer systems and is definitely not allowed to be used by applications. In an operating system without a protection mechanism (such as DOS), writing data to this address will immediately crash, while in a robust operating system, such as Windows, this operation will be immediately captured by the system's protection mechanism. The result is that the operating system forces the application that fails to be closed to prevent the error from expanding. At this time, the above "write memory" error will occur, and the referenced memory address is "0x00000000 ".

There are many causes of memory allocation failure, such as insufficient memory and mismatched system function versions. Therefore, this allocation failure is often seen after the operating system has been in use for a long time, installed a variety of applications (including inadvertently "installed" virus programs ), after a large number of system parameters and system files are changed.

2. Applications reference abnormal memory pointers due to their own bugs

In applications that use dynamic allocation, sometimes the program tries to read and write a piece of memory that should be available, but somehow, the expected available pointer has expired. It may be that the system requires allocation "forgot", or that the program has logged out the memory at some time and "did not pay attention. The logged-out memory is reclaimed by the system and its access rights do not belong to this application. Therefore, read/write operations also trigger the system's protection mechanism, the only end of a program that attempts to "break the law" is that it is terminated and all resources are recycled. Laws in the computer world are much more effective and harsh than humans!

Such cases all belong to the bugs of the program. You can often reproduce errors in a specific operation order. Invalid pointers are not always 0, so the memory address in the error prompt is not set to "0x00000000", but other random numbers.

The following suggestions may be helpful if the system frequently mentions error prompts:

1. check whether a trojan or virus exists in the system. Such programs tend to modify the system irresponsibly to control the system, resulting in operating system exceptions. In general, information security awareness should be strengthened, and the executable procedures with unknown sources should never be curious.

2. Update the operating system so that the operating system installer can copy the correct version of the system file and correct system parameters. Sometimes the operating system itself also has bugs. You must install the officially released upgrade program.

3. try out the new version of the application

Occasionally, it is a program conflict, similar to the occasional blue screen, it does not matter.
It is often dangerous, and the consequences are very serious. It is often a waste of half a day, and the system has to be reinstalled!
Common causes and solutions for the memory failure to read written
1 memory stick is broken and replaced
2 ...... remaining full text>

Precautions for Monitoring System Design

Is a large-scale monitoring system: 1. The distribution of the optical terminal should be reasonable (not too far from the camera) not more than 300 meters, convenient construction!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.