TWI423052B - System and method for scanning of the database - Google Patents
System and method for scanning of the database Download PDFInfo
- Publication number
- TWI423052B TWI423052B TW97125429A TW97125429A TWI423052B TW I423052 B TWI423052 B TW I423052B TW 97125429 A TW97125429 A TW 97125429A TW 97125429 A TW97125429 A TW 97125429A TW I423052 B TWI423052 B TW I423052B
- Authority
- TW
- Taiwan
- Prior art keywords
- database
- attribute
- data
- attribute value
- application system
- Prior art date
Links
Description
本發明涉及一種資料庫主動掃描系統及方法。The invention relates to a database active scanning system and method.
在辦公自動化高速發展的今天,資料庫系統可以說是被應用最多的一種軟體了。我們在工作與生活中所應用的系統中幾乎90%以上的系統都可以被稱之為資料庫系統。這些系統不管是Web類型的還是桌面應用程式,它們都有個共同的特點:涉及資料庫技術。Today, with the rapid development of office automation, the database system can be said to be the most widely used software. Almost 90% of the systems we use in our work and life can be called database systems. Whether these systems are web-based or desktop applications, they all share a common feature: database technology.
目前,Web系統和應用系統中對資料庫訪問的方法都是被動及全局訪問的,即一旦有資料變更,資料庫被動的接收到消息,然後對整個資料庫進行全局的掃描找到被修改的資料,最後再將改變的資料呈現在用戶端上,這樣一來,即使用戶端修改了很簡單的一條資料,資料庫都要對所有的資料進行掃描,這些資料中絕大多數是沒有必要進行掃描的資料。每次資料庫訪問的時候,很大一部分資源及時間都浪費在對沒有發生改變的資料的掃描上,而且過於頻繁的訪問資料庫對資料庫會造成很大的壓力,有可能導致資料庫的崩潰及資料的丟失。At present, the methods for accessing the database in the Web system and the application system are both passive and global access, that is, once the data is changed, the database passively receives the message, and then globally scans the entire database to find the modified data. Finally, the changed data is presented on the user side. In this way, even if the user modifies a very simple piece of data, the database must scan all the data, and most of the data are unnecessary to be scanned. data of. Every time a database is accessed, a large part of the resources and time are wasted on the scanning of the data that has not changed, and too frequent access to the database will put a lot of pressure on the database, which may lead to the database. Crash and loss of data.
鑒於以上內容,有必要提供一種有效的資料庫主動掃描的系統及方法。In view of the above, it is necessary to provide an effective database active scanning system and method.
所述資料庫主動掃描的電腦系統,所述電腦系統包括:獲取模組,用於獲取資料庫中所有資料表的ID,並將 所獲取的ID存儲於一種資料結構中;設置模組,用於設置所述資料結構中每個ID的屬性值,每個ID包括兩種屬性值:第一屬性值和第二屬性值,且所述ID的屬性初始值為第二屬性值,該設置模組,還用於將所述資料結構中被修改的資料表的ID的屬性由第二屬性值改為第一屬性值;接收模組,用於當應用系統修改資料庫時,接收所述應用系統所發送的資料庫中被修改的資料表的ID;控制模組,用於控制所述應用系統獲取所述資料結構中所有屬性為第一屬性值的ID,還用於根據屬性為第一屬性值的ID,控制所述應用系統獲取資料庫中所述ID所對應的資料表中的資料;及所述設置模組,還用於當所述應用系統獲取了所述資料結構中所有屬性為第一屬性值的ID後,將所述資料結構中所述屬性為第一屬性值的ID的屬性重新設置為第二屬性值。The computer system actively scanning the database, the computer system includes: an acquisition module, configured to acquire IDs of all data tables in the database, and The obtained ID is stored in a data structure; a setting module is configured to set an attribute value of each ID in the data structure, and each ID includes two attribute values: a first attribute value and a second attribute value, and The initial value of the attribute of the ID is a second attribute value, and the setting module is further configured to change the attribute of the ID of the modified data table in the data structure from the second attribute value to the first attribute value; a group, configured to: when an application system modifies a database, receive an ID of a modified data table in a database sent by the application system; and a control module, configured to control the application system to acquire all attributes in the data structure The ID of the first attribute value is further used to control the application system to obtain the data in the data table corresponding to the ID in the database according to the ID of the first attribute value; and the setting module is further After the application system acquires the IDs of all the attributes in the data structure as the first attribute value, the attributes in the data structure whose attributes are the IDs of the first attribute values are reset to the second attribute values. .
所述資料庫主動掃描方法,該方法包括如下步驟:獲取資料庫中所有資料表的ID,並將所獲取的ID存儲於一種資料結構中;設置所述資料結構中每個ID的屬性值,每個ID包括兩種屬性值:第一屬性值和第二屬性值,且所述ID的屬性初始值為第二屬性值;接收應用系統所發送的資料庫中被修改的資料表的ID;將所述資料結構中被修改的資料表的ID的屬性由第二屬性值改為第一屬性值;所述應用系統獲取所述資料結構中所有屬性為第一屬性值的ID;將所述資料結構中所述屬性為第一屬性值的ID的屬性重新設置為第二屬性值;及所述應用系統根據屬性 為第一屬性值的ID獲取資料庫中所述ID所對應的資料表中的資料。The database active scanning method, the method comprising the steps of: obtaining an ID of all data tables in the database, and storing the obtained ID in a data structure; setting an attribute value of each ID in the data structure, Each ID includes two attribute values: a first attribute value and a second attribute value, and the attribute initial value of the ID is a second attribute value; receiving an ID of the modified data table in the database sent by the application system; Changing an attribute of the ID of the modified data table in the data structure from a second attribute value to a first attribute value; the application system acquires an ID of all attributes in the data structure as a first attribute value; The attribute in the data structure is reset to the attribute of the ID of the first attribute value to the second attribute value; and the application system is based on the attribute Obtaining, in the ID of the first attribute value, the data in the data table corresponding to the ID in the database.
相較於習知技術,所述資料庫主動掃描系統及方法,使得資料庫能夠主動觀測及掃描,減少了對資料庫的無效訪問,減輕資料訪問對資料庫產生的負擔,提高資料庫訪問的效率。Compared with the prior art, the database actively scans the system and the method, so that the database can actively observe and scan, which reduces the invalid access to the database, reduces the burden of data access on the database, and improves the access of the database. effectiveness.
如圖1所示,是本發明資料庫主動掃描的電腦系統較佳實施例的硬體架構圖。該電腦系統1上運行了多個應用系統2,所述應用系統2連接一個資料庫3,該資料庫3可以在電腦內,也可以置於電腦之外。該資料庫3用於存儲所述應用系統2的所有資料。所述應用系統2還提供了一個用戶介面,用於供用戶查看資料庫中資料及資料更新情況。所述資料庫3中有多個資料表4,每個資料表4中有多條資料,每個資料表4對應一個ID。本實施例中,以一個應用系統2為例進行說明本發明。該應用系統2在對資料庫3提出修改資料的命令時,同時發送資料庫3被修改的通知給電腦系統1。As shown in FIG. 1, it is a hardware architecture diagram of a preferred embodiment of a computer system for actively scanning a database of the present invention. The computer system 1 runs a plurality of application systems 2, and the application system 2 is connected to a database 3, which may be in the computer or outside the computer. The database 3 is used to store all the materials of the application system 2. The application system 2 also provides a user interface for the user to view the data and data updates in the database. The database 3 has a plurality of data tables 4, each of which has a plurality of data, and each of the data tables 4 corresponds to an ID. In the present embodiment, the present invention will be described by taking an application system 2 as an example. The application system 2 simultaneously sends a notification that the database 3 is modified to the computer system 1 when a command to modify the data is presented to the database 3.
如圖2所示,是本發明資料庫主動掃描的電腦系統較佳實施例的功能模組圖。該電腦系統包括:獲取模組10、設置模組12、接收模組14、控制模組16及顯示模組18。As shown in FIG. 2, it is a functional module diagram of a preferred embodiment of a computer system for actively scanning the database of the present invention. The computer system includes an acquisition module 10, a setting module 12, a receiving module 14, a control module 16, and a display module 18.
獲取模組10用於獲取資料庫3中的所有資料表4的ID及獲取所述應用系統2所發送的資料庫3被修改的通知,並將所獲取的ID存儲於一種資料結構中,該資料結 構可以為二維陣列、鏈表等。The obtaining module 10 is configured to acquire the IDs of all the data tables 4 in the database 3 and obtain the notification that the database 3 sent by the application system 2 is modified, and store the acquired IDs in a data structure. Data knot The structure can be a two-dimensional array, a linked list, or the like.
設置模組12用於將所述資料結構中的每個ID設置兩個屬性值:change和original。屬性值change表示該ID所對應的資料表4中的資料已經被修改,屬性值original表示該ID所對應的資料表4中的資料沒有被修改。所有資料表4的ID的屬性初始值設置為original。該設置模組12還用於將所述資料結構中對應的被修改的資料表4的ID的屬性由original改為change。The setting module 12 is configured to set two attribute values for each ID in the data structure: change and original. The attribute value change indicates that the data in the data table 4 corresponding to the ID has been modified, and the attribute value original indicates that the data in the data table 4 corresponding to the ID has not been modified. The attribute initial value of the ID of all the data sheets 4 is set to original. The setting module 12 is further configured to change the attribute of the ID of the corresponding modified data table 4 in the data structure from original to change.
接收模組14用於接收應用系統2所發送的資料庫3中被修改的資料表4的ID。The receiving module 14 is configured to receive the ID of the modified data table 4 in the database 3 sent by the application system 2.
控制模組16用於控制所述應用系統2獲取所述資料結構中所有屬性為change的ID。該控制模組16還用於控制所述應用系統2訪問資料庫3中的資料表,該資料表的ID為所獲取的屬性為change的ID,所述應用系統2訪問所述資料表,並獲取該資料表中的所有資料。The control module 16 is configured to control the application system 2 to obtain an ID whose all attributes in the data structure are change. The control module 16 is further configured to control the application system 2 to access the data table in the database 3, the ID of the data table is the obtained ID whose attribute is change, and the application system 2 accesses the data table, and Get all the information in this fact sheet.
所述設置模組12還用於當應用系統2獲取了資料結構中所有屬性為change的ID後,將所述資料結構中屬性為change的ID重新設置為original,便於下次訪問資料結構時辨別修改的資料表的ID。The setting module 12 is further configured to: after the application system 2 obtains all the IDs whose attributes are changed in the data structure, the ID of the attribute in the data structure is changed to original, which is convenient for distinguishing when accessing the data structure next time. The ID of the modified data sheet.
顯示模組18用於於應用系統2的介面上更新顯示所述應用系統2所獲取的資料。The display module 18 is configured to update and display the data acquired by the application system 2 on the interface of the application system 2.
如圖3所示,是本發明資料庫主動掃描方法較佳實施例的作業流程圖。As shown in FIG. 3, it is a flowchart of the operation of the preferred embodiment of the active scanning method of the database of the present invention.
步驟S30,獲取模組10獲取資料庫3中的所有資料表 4的ID,並將所獲取的ID存儲於一種資料結構中,該資料結構可以為二維陣列、鏈表等。Step S30, the obtaining module 10 obtains all the data tables in the database 3. The ID of 4, and the obtained ID is stored in a data structure, which may be a two-dimensional array, a linked list, or the like.
步驟S32,設置模組12將所述資料結構中的每個ID設置兩個屬性值:change和original。屬性值change表示該ID所對應的資料表4中的資料已經被修改,屬性值original表示該ID所對應的資料表4中的資料沒有被修改。所有資料表4的ID的屬性初始值設置為original。In step S32, the setting module 12 sets each attribute ID in the data structure with two attribute values: change and original. The attribute value change indicates that the data in the data table 4 corresponding to the ID has been modified, and the attribute value original indicates that the data in the data table 4 corresponding to the ID has not been modified. The attribute initial value of the ID of all the data sheets 4 is set to original.
步驟S34,當應用系統2發出修改資料庫3中資料的命令時,也同時向電腦系統1發出資料庫3被修改的通知,所述獲取模組10獲取資料庫3被修改的通知。In step S34, when the application system 2 issues a command to modify the data in the database 3, the notification of the modification of the database 3 is also sent to the computer system 1, and the acquisition module 10 acquires the notification that the database 3 is modified.
步驟S36,接收模組14接收應用系統2所發送的資料庫3中被修改的資料表4的ID。In step S36, the receiving module 14 receives the ID of the modified data table 4 in the database 3 sent by the application system 2.
步驟S38,所述設置模組12將所述資料結構中對應的被修改的資料表4的ID的屬性由original改為change。In step S38, the setting module 12 changes the attribute of the ID of the corresponding modified data table 4 in the data structure from original to change.
步驟S40,控制模組16控制所述應用系統2獲取所述資料結構中所有屬性為change的資料表的ID。In step S40, the control module 16 controls the application system 2 to acquire the ID of the data table whose attributes are change in the data structure.
步驟S42,所述設置模組12在應用系統2獲取了資料結構中所有屬性為change的ID後,將所述資料結構中屬性為change的ID的屬性重新設置為original,便於下次訪問資料結構時辨別修改的資料表的ID。In step S42, after the application system 2 acquires all IDs whose attributes are change in the data structure, the setting module 12 resets the attribute of the ID whose attribute is change in the data structure to original, which is convenient for accessing the data structure next time. Identify the ID of the modified data sheet.
步驟S44,所述應用系統2訪問資料庫3中的資料表,該資料表的ID為所獲取的屬性為change的ID,所述應用系統2訪問所述資料表,並獲取該資料表中的所有資料。Step S44, the application system 2 accesses the data table in the database 3, the ID of the data table is the obtained ID whose attribute is change, and the application system 2 accesses the data table and obtains the data table. All information.
步驟S46,顯示模組18於應用系統2的介面上更新顯 示所獲取的資料。Step S46, the display module 18 is updated on the interface of the application system 2. Show the information obtained.
以上所述僅為本發明之較佳實施例而已,且已達廣泛之使用功效,凡其他未脫離本發明所揭示之精神下所完成之均等變化或修飾,均應包含在下述之申請專利範圍內。The above is only the preferred embodiment of the present invention, and has been used in a wide range of applications. Any other equivalent changes or modifications which are not departing from the spirit of the present invention should be included in the following claims. Inside.
電腦系統‧‧‧1Computer system ‧‧1
應用系統‧‧‧2Application System‧‧‧2
資料庫‧‧‧3Database ‧ ‧
資料表‧‧‧4Information sheet ‧‧4
獲取模組‧‧‧10Get the module ‧‧10
設置模組‧‧‧12Setting up the module ‧‧12
接收模組‧‧‧14Receiving module ‧‧14
控制模組‧‧‧16Control module ‧‧16
顯示模組‧‧‧18Display module ‧‧18
獲取資料庫中所有資料表的ID,並存儲於一種資料結構中‧‧‧S30Get the ID of all the data sheets in the database and store them in a data structure. ‧‧S30
給資料結構中的ID設置屬性‧‧‧S32Set the attribute to the ID in the data structure ‧‧‧S32
獲取資料庫中資料被修改的通知‧‧‧S34Obtain notification that the information in the database has been modified ‧‧S34
接收資料庫中被修改的資料表的ID‧‧‧S36ID of the revised data sheet in the receiving database.‧‧S36
將所修改的資料表的ID在資料結構中對應的ID的屬性由original變為change‧‧‧S38Change the ID of the modified data table to the attribute of the corresponding ID in the data structure from original to change‧‧‧S38
應用系統獲取資料結構中所有屬性為change的資料表的ID‧‧‧S40The application system obtains the ID of each data sheet whose attribute is change in the data structure.‧‧S40
將資料結構中所有屬性為change的ID變為original‧‧‧S42Change the ID of all attributes in the data structure to change to original‧‧‧S42
應用系統根據所獲取的屬性為change的ID,從資料庫中獲取對應的ID的資料表中的資料‧‧‧S44The application system obtains the data in the data table of the corresponding ID from the database according to the obtained attribute as the ID of the change ‧‧‧S44
於應用系統的用戶介面上顯示所獲取的資料表中的資料‧‧‧S46Display the information in the obtained data sheet on the user interface of the application system ‧‧‧S46
圖1係本發明資料庫主動掃描的電腦系統較佳實施例之硬體架構圖。1 is a hardware architecture diagram of a preferred embodiment of a computer system for actively scanning a database of the present invention.
圖2係圖1中電腦系統1較佳實施例之功能模組圖。2 is a functional block diagram of a preferred embodiment of the computer system 1 of FIG. 1.
圖3係本發明資料庫主動掃描方法較佳實施例之作業流程圖。3 is a flow chart showing the operation of a preferred embodiment of the active scanning method of the database of the present invention.
獲取資料庫中所有資料表的ID,並存儲於一種資料結構中‧‧‧S30Get the ID of all the data sheets in the database and store them in a data structure. ‧‧S30
給資料結構中的ID設置屬性‧‧‧S32Set the attribute to the ID in the data structure ‧‧‧S32
獲取資料庫中資料被修改的通知‧‧‧S34Obtain notification that the information in the database has been modified ‧‧S34
接收資料庫中被修改的資料表的ID‧‧‧S36ID of the revised data sheet in the receiving database.‧‧S36
將所修改的資料表的ID在資料結構中對應的ID的屬性由original變為change‧‧‧S38Change the ID of the modified data table to the attribute of the corresponding ID in the data structure from original to change‧‧‧S38
應用系統獲取資料結構中所有屬性為change的資料表的ID‧‧‧S40The application system obtains the ID of each data sheet whose attribute is change in the data structure.‧‧S40
將資料結構中所有屬性為change的ID變為original‧‧‧S42Change the ID of all attributes in the data structure to change to original‧‧‧S42
應用系統根據所獲取的屬性為change的ID,從資料庫中獲取對應的ID的資料表中的資料‧‧‧S44The application system obtains the data in the data table of the corresponding ID from the database according to the obtained attribute as the ID of the change ‧‧‧S44
於應用系統的用戶介面上顯示所獲取的資料表中的資料‧‧‧S46Display the information in the obtained data sheet on the user interface of the application system ‧‧‧S46
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW97125429A TWI423052B (en) | 2008-07-04 | 2008-07-04 | System and method for scanning of the database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW97125429A TWI423052B (en) | 2008-07-04 | 2008-07-04 | System and method for scanning of the database |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201003432A TW201003432A (en) | 2010-01-16 |
TWI423052B true TWI423052B (en) | 2014-01-11 |
Family
ID=44825561
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW97125429A TWI423052B (en) | 2008-07-04 | 2008-07-04 | System and method for scanning of the database |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI423052B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050041860A1 (en) * | 2003-08-20 | 2005-02-24 | Jager Jodocus Franciscus | Metadata extraction from designated document areas |
TW200643746A (en) * | 2005-06-13 | 2006-12-16 | Yen-Chieh Mao | Method, system and computer readable recording media for electronic document management |
-
2008
- 2008-07-04 TW TW97125429A patent/TWI423052B/en not_active IP Right Cessation
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050041860A1 (en) * | 2003-08-20 | 2005-02-24 | Jager Jodocus Franciscus | Metadata extraction from designated document areas |
TW200643746A (en) * | 2005-06-13 | 2006-12-16 | Yen-Chieh Mao | Method, system and computer readable recording media for electronic document management |
Non-Patent Citations (1)
Title |
---|
黃子儀碩士論文,結合XML與SOAP發展電子病歷傳輸介面之研究,中華民國九十二年六月 * |
Also Published As
Publication number | Publication date |
---|---|
TW201003432A (en) | 2010-01-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6817990B2 (en) | System for automated processes | |
US7653872B2 (en) | Document processor, document processing method and storage medium storing document processing program | |
US10956667B2 (en) | Operational transformations proxy for thin clients | |
EP3247088B1 (en) | M2m data processing methods and devices | |
US10248641B2 (en) | Method, apparatus, and computer program product for managing retrieval of content for display by a browser | |
JP2010521721A (en) | Web data usage platform | |
US20080028046A1 (en) | Program distributing apparatus and program distributing system | |
JP4858945B2 (en) | System access method and network system | |
EP2842034B1 (en) | Providing client and service compatibility through cloud-hosted adapters | |
CN113220659B (en) | Data migration method, system, electronic device and storage medium | |
CN105787091A (en) | Content publishing system and method supporting multiple terminals | |
US8723870B1 (en) | Selection of object types with data transferability | |
JP2006259918A (en) | Progress management support device, method and program | |
JP2017517804A5 (en) | ||
TWI423052B (en) | System and method for scanning of the database | |
US11172034B2 (en) | System and method for location aware content management system | |
CN102340552A (en) | Information processing apparatus, information processing method, and program | |
JP2018092219A (en) | Information processing apparatus, control method, program, device and information processing system | |
CN101609448A (en) | Database active scan system and method | |
JP2015176494A (en) | Information processing system and information processing method | |
JP2018156601A (en) | Information processing device, information processing system and program | |
JP2018077598A (en) | Electronic device, program and information processing system | |
JP5297848B2 (en) | Program dynamic update system, management server, embedded device and program | |
JP6858603B2 (en) | Injury / illness name change information output program, injury / illness name change information output system, and injury / illness name change information output method | |
US20200251194A1 (en) | Fast healthcare interoperability resources model for user interface generation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |