[go: up one dir, main page]

CN117743651A - Address book loading optimization method and device - Google Patents

Address book loading optimization method and device Download PDF

Info

Publication number
CN117743651A
CN117743651A CN202410187851.5A CN202410187851A CN117743651A CN 117743651 A CN117743651 A CN 117743651A CN 202410187851 A CN202410187851 A CN 202410187851A CN 117743651 A CN117743651 A CN 117743651A
Authority
CN
China
Prior art keywords
address book
information
server
version number
local
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410187851.5A
Other languages
Chinese (zh)
Other versions
CN117743651B (en
Inventor
郭镭波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202410187851.5A priority Critical patent/CN117743651B/en
Publication of CN117743651A publication Critical patent/CN117743651A/en
Application granted granted Critical
Publication of CN117743651B publication Critical patent/CN117743651B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an optimization method and device for address book loading, which relate to the technical field of Internet, and the method is applied to a local client and comprises the following steps: when the method is started for the first time, acquiring full address book information from a server, wherein the address book information is stored in the server in the form of unstructured data of a tree structure, leaf nodes of the tree structure are employee information, and non-leaf nodes are department information; reconstructing structured index information in a local memory based on the full address book information; and providing service for the local address book query request based on the index information. Therefore, the method and the device can reduce the data updating quantity, reduce the updating complexity and the updating error probability when the server side is updated, and simultaneously ensure the efficiency of inquiring the local address book.

Description

Address book loading optimization method and device
Technical Field
The invention relates to the technical field of Internet, in particular to an address book loading optimization method and device.
Background
In the daily work scenario of an enterprise, there are many scenarios in which an address book module must be used. For example, when an online meeting is newly established, colleagues in other departments need to be invited. When the flow is examined and approved, the examined and approved node is required to be selected. In the enterprise internal communication APP, department organization structures, members, and personnel related information need to be checked. The address book module is an indispensable module in daily work.
In the enterprise-level address book, the number of people is huge, the classification is complex, the maintenance difficulty is high, and the traditional address book algorithm cannot meet the requirements. Particularly, when the requirement on the application interaction scene is high in timeliness, the address book needs to be displayed accurately in real time, and the address book needs to be searched and positioned accurately quickly.
At present, when an address book module is needed in the internal communication or other scenes of an enterprise, a client side usually requests a server side in real time to inquire and acquire the address book or specific organization department information of the whole enterprise. When the user clicks cancel or performs address book operation again, a request needs to be initiated to the server again. Therefore, when the number of the address book personnel of the enterprise is large, the address book loading mode can frequently interact with the server, so that the pressure of the server is greatly improved. Meanwhile, the transmission of large amount of data also causes waste of network resources. Moreover, if address book data are utilized by lawbreakers in the transmission process, sensitive information is easy to leak. Finally, when processing some interactive scenes with high aging requirements, the method requests the server in real time, consumes long time and cannot meet the requirements of the interactive scenes.
In addition, in the prior art, the address book is loaded to the local from the server end in full quantity when the address book is loaded for the first time, and then when the server end is updated, the address book is loaded in full quantity again and compared with the local address book, so that the scheme of updating the local address book is adopted. However, the address book data at the server end and the address book data downloaded to the local are structured data storage modes, the modification amount involved in the mode when the address book is required to be updated is large, the full comparison is performed when the address book is required to be updated, and the update time is long and the efficiency is low due to the complex structure and the huge number of people of the enterprise-level address book.
Disclosure of Invention
In view of the above, the present invention provides an address book loading optimization method and device to solve at least one of the above-mentioned problems.
In order to achieve the above purpose, the present invention adopts the following scheme:
according to a first aspect of the present invention, there is provided a method for optimizing address book loading, the method being applied to a local client, the method comprising: the method comprises the steps that full address book information is obtained from a server side when the method is started for the first time, the address book information is stored in the server side in the form of unstructured data of a tree structure, leaf nodes of the tree structure are employee information, and non-leaf nodes are department information; reconstructing structured index information in a local memory based on the full address book information; and providing service for the local address book query request based on the index information.
As an embodiment of the present invention, the above method further includes: before starting local address book inquiry, sending an address book version number acquisition request to the server side; comparing the address book version number returned by the server with a locally stored version number; if the address book version number returned by the server is higher than the version number stored locally, acquiring a data change record of the address book from the server and updating the local address book; if the address book version number returned by the server is equal to the version number stored locally, directly providing service for the local address book query request based on the index information; and if the address book version number returned by the server is smaller than the version number stored locally, sending the local full address book information to the server.
As an embodiment of the present invention, the above method further includes: before starting local address book inquiry, sending a department version number acquisition request of an address book to the server side; comparing the department version number returned by the server with the department version number stored locally; if the department version number returned by the server is higher than the department version number stored locally, acquiring a data change record of the address book from the server and updating the local address book; if the department version number returned by the server is equal to the department version number stored locally, directly providing service for the local address book query request based on the index information; and if the department version number returned by the server is smaller than the locally stored department version number, sending department information and personnel information corresponding to the department version number in the local address book information to the server.
As an embodiment of the present invention, the method for obtaining a data change record of an address book from the server and updating a local address book includes: positioning a changed subtree related to address book information based on the address book data change record; copying the subtree related to the change, and changing the copied subtree based on the data change record; and replacing the changed subtrees with the changed subtrees to finish the local updating of the address book.
As an embodiment of the present invention, the above method further includes: before starting local address book inquiry, sending an address book integrity detection data request to the server side and acquiring first integrity detection data returned by the server side; after the local updating of the address book is completed, calculating to obtain second integrity detection data based on the updated address book; and comparing the first integrity detection data with the second integrity detection data to complete integrity detection.
As an embodiment of the present invention, the address book integrity detection data in the method includes: checksum data, cyclic redundancy check data, digital signature data, or hash value data.
According to a second aspect of the present invention, there is provided an address book loading optimizing apparatus, the apparatus comprising: the information acquisition unit is used for acquiring the total address book information from the server side when the information acquisition unit is started for the first time, wherein the address book information is stored in the server side in the form of unstructured data of a tree structure, leaf nodes of the tree structure are employee information, and non-leaf nodes are department information; the index reconstruction unit is used for reconstructing the structured index information in the local memory based on the total address book information; and the service providing unit is used for providing service for the local address book query request based on the index information.
As an embodiment of the present invention, the above apparatus further includes: the first request sending unit is used for sending an address book version number acquisition request to the server side before starting local address book inquiry; the first comparison unit is used for comparing the address book version number returned by the server with the version number stored locally; the first updating unit is used for acquiring a data change record of the address book from the server and updating the local address book when the address book version number returned by the server is higher than the version number stored locally; if the address book version number returned by the server is equal to the locally stored version number, the service providing unit directly provides service for the local address book query request based on the index information; and the first information sending unit is used for sending the local total address book information to the server when the address book version number returned by the server is smaller than the locally stored version number.
As an embodiment of the present invention, the above apparatus further includes: the second request sending unit is used for sending a department version number acquisition request of the address book to the server side before starting the local address book inquiry; the second comparison unit is used for comparing the department version number returned by the server with the department version number stored locally; the second updating unit is used for acquiring a data change record of the address book from the server and updating the local address book when the department version number returned by the server is higher than the locally stored department version number; if the department version number returned by the server is equal to the department version number stored locally, the service providing unit directly provides service for the local address book query request based on the index information; and the second information sending unit is used for sending the department information and the personnel information corresponding to the department version number in the local address book information to the server when the department version number returned by the server is smaller than the locally stored department version number.
As an embodiment of the present invention, the first update unit or the second update unit obtaining a data change record of an address book from the server and updating a local address book includes: positioning a changed subtree related to address book information based on the address book data change record; copying the subtree related to the change, and changing the copied subtree based on the data change record; and replacing the changed subtrees with the changed subtrees to finish the local updating of the address book.
As an embodiment of the present invention, the above apparatus further includes: an integrity detection data request unit, configured to send an address book integrity detection data request to the server side and obtain first integrity detection data returned by the server side before starting local address book query; an integrity detection data calculation unit for calculating second integrity detection data based on the updated address book after the local update of the address book is completed; and the integrity comparison unit is used for comparing the first integrity detection data with the second integrity detection data to complete integrity detection.
As an embodiment of the present invention, the address book integrity detection data includes: checksum data, cyclic redundancy check data, digital signature data, or hash value data.
According to a third aspect of the present invention there is provided an electronic device comprising a memory, a processor and a computer program stored on said memory and executable on said processor, the processor implementing the steps of the above method when executing said computer program.
According to a fourth aspect of the present invention there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the above method.
According to a fifth aspect of the present invention there is provided a computer program product comprising computer programs/instructions which when executed by a processor implement the steps of the above method.
According to the technical scheme, the address book loading optimizing method and device are provided, the full address book information requested by the client side to the server side for the first time exists in the form of unstructured data of a tree structure, and after the client side obtains the full address book information, the client side can reconstruct a structured index in a local memory based on the unstructured full address book information to establish a mapping relation between staff and an affiliated mechanism. The subsequent inquiry based on the address book can be directly based on the local inquiry. Therefore, the method and the device can reduce the data updating quantity, the updating complexity and the error probability during updating when the server side is updated, and can ensure the efficiency of inquiring the local address book.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
fig. 1 is a flow chart of an optimization method for address book loading according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a tree-like data structure according to an embodiment of the present disclosure;
FIG. 3 is a schematic node diagram of tree data according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a full address book tree structure according to an embodiment of the present disclosure;
FIG. 5 is a flowchart of an address book loading optimization method according to another embodiment of the present application;
FIG. 6 is a schematic diagram of a tree structure of an address book before modification according to an embodiment of the present application;
fig. 7 is a schematic diagram of address book update provided in the embodiment of the present application;
fig. 8 is a schematic diagram of an address book after updating according to an embodiment of the present application;
Fig. 9 is a flowchart of an address book loading optimization method according to another embodiment of the present application;
fig. 10 is a schematic structural diagram of an address book loading optimizing device according to an embodiment of the present application;
fig. 11 is a schematic block diagram of a system configuration of an electronic device provided in an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present invention and their descriptions herein are for the purpose of explaining the present invention, but are not to be construed as limiting the invention.
In the technical scheme, related information and data (including but not limited to user personal information and department information) are authorized by a user or are fully authorized by all parties; the collection, storage, use, processing, transmission, provision, disclosure, application and other processes of the related information data all obey the related laws and regulations and standards of the related country and region, necessary security measures are taken without violating the public order colloquial, and corresponding operation entrance is provided for the user to select authorization or rejection.
Example 1
Fig. 1 is a flow chart of an address book loading optimization method provided in an embodiment of the present application, where the method is applied to a local client, and the method includes the following steps:
Step S101: and acquiring the total address book information from the server side when the terminal is started for the first time, wherein the address book information is stored in the server side in the form of unstructured data of a tree structure, leaf nodes of the tree structure are employee information, and non-leaf nodes are department information.
The first start may be the first start of the local client, or may be when the local client first calls the address book module, when the first start is performed, the local client may send a request for obtaining the full address book information to the server, and after receiving the request, the server returns the full address book information corresponding to the request to the local client after verifying the identity of the client through operations such as authentication.
Regarding the data storage of the address book, it is common practice to use a structured storage manner, which is simple and clear, and for the structured storage, see table 1 below. However, an employee has a designated superordinate, colleagues in the same department, and colleagues in a subordinate department. If structured storage is used to generate such relationships, the efficiency is quite low, and when one of the employee information is added and deleted, especially when the organization architecture is adjusted, the changed information is quite large, and errors are easy to occur.
TABLE 1
In order to solve the problem caused by the conventional data structured storage, the application uses a more efficient data model with a tree structure to represent the enterprise address book at the server side, and stores the enterprise address book in an unstructured data structure form, and the approximate data structure is shown in fig. 2 and 3: each leaf node represents an employee, and each leaf node contains a set of attributes, including basic information, contact information, position, etc. of the employee. Non-leaf nodes store department organization information, and each non-leaf node contains a set of values, such as upper and lower departments, sibling departments, and the like. The leaf node belongs to a certain non-leaf node, and can be specifically related with the non-leaf node representing the department through one attribute value in the leaf node.
Step S102: and reconstructing the structured index information in the local memory based on the total address book information.
Since the purpose of the final address book exists is to provide information query service for the local client, the query service can be applied to various scenes in business, a plurality of business logics can be made based on the address book, for example, when someone else invites a meeting through an enterprise meeting, someone can choose to "accept", "reject" or "forward", "invite" an upper level or a subordinate meeting, and in the scene, there are many business requirements, for example, a boss of a company cannot be invited, or a person with rights can not be invited, and when the business attribute is complex, the tree structure cannot be satisfied. Therefore, the unstructured data in the tree structure can be structured at the local client, so that complex business scenes such as complex association operation and the like can be easily dealt with.
As shown in fig. 4, which is a schematic diagram of a full address book tree structure, the data format does not follow the conventional database table structure, but adopts a more free format, for example, it may be a JSON format data, where unstructured data (JSON format) of each Node (Node) in fig. 4 is exemplified as follows:
top layer structure: the entire data is an object (record) containing information about a certain department or employee.
deptno: represents a key whose value is "department a", indicating the name of the department represented by the record.
info: representing a nested object containing more detailed information. Itself comprising a plurality of key-value pairs, each key-value pair providing a different type of information:
reorder_info: an array, containing two string elements "xxx", may represent rewards or other related information.
birth: the birthday is represented by the value "2023-01-02".
tel: a telephone number is indicated, and its value is "138 xxxxxxx".
direct_sup: the immediately upper level is indicated by "123456".
work_no: the employee's job number is indicated and its value is "000000".
parent_id: represents a key whose value is "123" which indicates the number of the parent department or employee, i.e. the number of the superior department or manager to which this record belongs.
non_id: representing a key whose value is "1", which represents the node number.
After the unstructured data in JSON format is structured, the structured index data in table 1 is obtained, so that the complex service scenario to be processed by the local client can be easily handled. It should be noted that, the enterprise-level address book has many tree nodes, and the application adopts a non-recursive mode to access the address book data of the tree structure. Therefore, the unstructured tree address book data is firstly obtained from the server side and then is converted into the structured index data at the local client side, so that the query and the processing can be more efficiently performed, and the flexibility of the unstructured data in expressing complex relations and the advantages of the structured data in query and storage efficiency are fully utilized.
Step S103: and providing service for the local address book query request based on the index information.
According to the technical scheme, the address book loading optimization method is provided, the full-volume address book information which is requested by the client side to the server side for the first time exists in the form of unstructured data of a tree structure, and after the client side obtains the full-volume address book information, the client side can reconstruct a structured index in a local memory based on the unstructured full-volume information to establish a mapping relation between staff and an affiliated mechanism. The subsequent inquiry based on the address book can be directly based on the local inquiry. Therefore, the occupation of network transmission can be greatly reduced, the searching and searching efficiency can be greatly improved, the storage mode of the address book information can further improve the storage efficiency, and the error probability in the process of changing the address book is reduced.
Example two
Fig. 5 is a flowchart of an address book loading optimization method according to another embodiment of the present application, where the method is applied to a local client, and the method includes the following steps:
step S501: and sending an address book version number acquisition request to a server.
Step S502: comparing the address book version number returned by the server with the version number stored locally, and if the address book version number returned by the server is higher than the version number stored locally, entering step S503; if the address book version number returned by the server is equal to the locally stored version number, step S505 is entered; if the address book version number returned by the server is smaller than the locally stored version number, step S504 is entered.
The server allocates an initial version number to the address book, adds 1 to the initial version number when the address book is updated each time, and records the data of the changed part.
Step S503: and obtaining a data change record of the address book from the server, updating the local address book, and proceeding to step S505.
Because the address book version number returned by the server is higher than the version number stored locally, the address book data representing the server is updated, so that the data change record is acquired from the server, the digital structure of the local address book is updated, and the local structured index data is updated.
Preferably, updating the local communication according to the data change record in this step further includes: positioning a changed subtree related to address book information based on the address book data change record; copying the subtree related to the change, and changing the copied subtree based on the data change record; and replacing the changed subtrees with the changed subtrees to finish the local updating of the address book.
For example, the address book tree structure before changing is shown in fig. 6, at this time, the employee 1 in the department C in fig. 6 needs to be changed to the department D, and the employee 3 in the department D has transacted the job departure, so that the change involves the department C and the department D, and therefore, two subtrees involving the change are located in the department C and the department D, the two subtrees are copied, after the change is completed on the copied subtree, the original subtree is deleted, and replaced by a new subtree, the process is shown in fig. 7, and finally, the updated address book tree structure is obtained as shown in fig. 8.
Preferably, before the local address book query is started, the embodiment may further send an address book integrity detection data request to the server side and acquire first integrity detection data returned by the server side; then after the local updating of the address book is completed, calculating to obtain second integrity detection data based on the updated address book; and comparing the first integrity detection data with the second integrity detection data to complete integrity detection.
The address book integrity detection data comprises: checksum data, cyclic redundancy check data, digital signature data, or hash value data. Further preferably, the embodiment may also automatically select appropriate integrity detection data according to the volume and complexity of the determined address book data, because the above techniques have advantages and disadvantages according to different data objects, such as high reliability of hash value verification, but for data with larger volume, the efficiency may be reduced, and the techniques such as digital signature may be more suitable.
Step S504: and sending the local full address book information to the server.
However, when the version number of the address book returned by the server is smaller than the version number stored locally, although this will generally happen rarely, if it happens, it may indicate that the data of the server has undergone a restore operation, such as having to restore the data due to some running system errors. At this time, address book data of the server end is restored to an earlier version, and the application can provide newer data for the server end through the client end back feeding the server end, and when more local clients exist in the system, the address book data of the server end can be restored to the latest data with higher probability.
Step S505: and providing service for the address book query request based on the local address book.
When the address book version number returned by the server is equal to the version number stored locally, the server is indicated to have no updated address book data, so that the address book query request can be directly served based on the local address book.
According to the technical scheme, the address book loading optimization method is provided, the full-volume address book information which is requested by the client side to the server side for the first time exists in the form of unstructured data of a tree structure, and after the client side obtains the full-volume address book information, the client side can reconstruct a structured index in a local memory based on the unstructured full-volume information to establish a mapping relation between staff and an affiliated mechanism. The subsequent inquiry based on the address book can be directly based on the local inquiry. Therefore, the occupation of network transmission can be greatly reduced, the searching and searching efficiency can be greatly improved, the storage mode of the address book information can further improve the storage efficiency, and the error probability in the process of changing the address book is reduced. In addition, the address book can be quickly and accurately positioned to the node to be changed during updating, the updating speed is higher, the occupied network resources are less, and the cost is lower.
Example III
Fig. 9 is a flowchart of an address book loading optimization method according to another embodiment of the present application, where the method is also applied to a local client, and the method includes the following steps:
step S901: and sending a department version number acquisition request of the address book to the server.
Step S902: comparing the department version number returned by the server with the department version number stored locally, and if the department version number returned by the server is higher than the department version number stored locally, entering step S903; if the department version number returned by the server is equal to the department version number stored locally, step S905 is entered; if the department version number returned by the server is smaller than the department version number stored locally, step S904 is entered.
In this embodiment, the server side allocates an initial version number of a department to each department in the address book, and when the address book is updated each time, locates to the department involved in the update, adds 1 to the initial version number of the department, and records the data of the changed part.
Preferably, updating the local communication according to the data change record in this step further includes: positioning a changed subtree related to address book information based on the address book data change record; copying the subtree related to the change, and changing the copied subtree based on the data change record; the changed subtrees are replaced by the subtrees related to the change, so that the local update of the address book is completed, and the specific reference can be seen from the description of fig. 6 to 8.
Preferably, before the local address book query is started, the embodiment may further send an address book integrity detection data request to the server side and acquire first integrity detection data returned by the server side; then after the local updating of the address book is completed, calculating to obtain second integrity detection data based on the updated address book; and comparing the first integrity detection data with the second integrity detection data to complete integrity detection.
The address book integrity detection data comprises: checksum data, cyclic redundancy check data, digital signature data, or hash value data. Further preferably, the embodiment may also automatically select appropriate integrity detection data according to the volume and complexity of the determined address book data, because the above techniques have advantages and disadvantages according to different data objects, such as high reliability of hash value verification, but for data with larger volume, the efficiency may be reduced, and the techniques such as digital signature may be more suitable.
Step S903: and acquiring a data change record of the address book from the server, updating the local address book, and proceeding to step S905.
Because the department version number returned by the server is higher than the department version number stored locally, the address book data representing the server is updated, so that the data change record is acquired from the server, the digital structure of the local address book is updated, and the local structured index data is updated.
Step S904: and sending department information and personnel information corresponding to the department version number in the local address book information to the server.
When the version number of the address book department returned by the server is smaller than the locally stored department version number, the server can be fed back by the client, so that newer department address book data can be provided for the server, and as the version numbers are respectively distributed for each department, only data related to the departments can be uploaded, full data is not required to be uploaded, and the transmission of data volume and the updating speed of the address book are reduced.
Step S905: and providing service for the address book query request based on the local address book.
According to the technical scheme, the address book loading optimization method is provided, the full-volume address book information which is requested by the client side to the server side for the first time exists in the form of unstructured data of a tree structure, and after the client side obtains the full-volume address book information, the client side can reconstruct a structured index in a local memory based on the unstructured full-volume information to establish a mapping relation between staff and an affiliated mechanism. The subsequent inquiry based on the address book can be directly based on the local inquiry. Therefore, the occupation of network transmission can be greatly reduced, the searching and searching efficiency can be greatly improved, the storage mode of the address book information can further improve the storage efficiency, and the error probability in the process of changing the address book is reduced. In addition, the address book can be quickly and accurately positioned to the node to be changed during updating, the updating speed is higher, the occupied network resources are less, and the cost is lower.
Example IV
Fig. 10 is a schematic structural diagram of an address book loading optimizing device provided in the present application, where the device includes: the information acquisition unit 100, the index reconstruction unit 200, and the service providing unit 300 are sequentially connected therebetween.
The information obtaining unit 100 is configured to obtain, from a server, a total amount of address book information when the information obtaining unit is started for the first time, where the address book information is stored in the server in the form of unstructured data with a tree structure, and leaf nodes of the tree structure are employee information and non-leaf nodes are department information.
The index reconstruction unit 200 is configured to reconstruct the structured index information in the local memory based on the total address book information.
The service providing unit 300 is configured to provide a service for the local address book query request based on the index information.
Preferably, the apparatus further comprises: the request sending unit is used for sending an address book version number acquisition request to the server side before starting local address book inquiry; the comparison unit is used for comparing the address book version number returned by the server with the version number stored locally; the updating unit is used for acquiring a data change record of the address book from the server and updating the local address book when the address book version number returned by the server is higher than the version number stored locally; if the address book version number returned by the server is equal to the locally stored version number, the service providing unit directly provides service for the local address book query request based on the index information; and the information sending unit is used for sending the local total address book information to the server when the address book version number returned by the server is smaller than the locally stored version number.
Preferably, the request sending unit is further configured to send a department version number acquisition request of the address book to the server side before the local address book query is started; correspondingly, the comparison unit is also used for comparing the department version number returned by the server with the department version number stored locally; the updating unit is also used for acquiring a data change record of the address book from the server and updating the local address book when the department version number returned by the server is higher than the department version number stored locally; if the department version number returned by the server is equal to the department version number stored locally, the service providing unit directly provides service for the local address book query request based on the index information; and the information sending unit is also used for sending the department information and the personnel information corresponding to the department version number in the local address book information to the server when the department version number returned by the server is smaller than the locally stored department version number.
Preferably, the updating unit obtains a data change record of the address book from the server and updates the local address book, including: positioning a changed subtree related to address book information based on the address book data change record; copying the subtree related to the change, and changing the copied subtree based on the data change record; and replacing the changed subtrees with the changed subtrees to finish the local updating of the address book.
Preferably, the apparatus further comprises: an integrity detection data request unit, configured to send an address book integrity detection data request to the server side and obtain first integrity detection data returned by the server side before starting local address book query; an integrity detection data calculation unit for calculating second integrity detection data based on the updated address book after the local update of the address book is completed; and the integrity comparison unit is used for comparing the first integrity detection data with the second integrity detection data to complete integrity detection.
Preferably, the address book integrity detection data includes: checksum data, cyclic redundancy check data, digital signature data, or hash value data.
According to the technical scheme, the address book loading optimizing device is provided, the full-volume address book information which is requested by the client side to the server side for the first time exists in the form of unstructured data of a tree structure, and after the client side obtains the full-volume address book information, the client side can reconstruct a structured index in a local memory based on the unstructured full-volume information to establish a mapping relation between staff and an affiliated mechanism. The subsequent inquiry based on the address book can be directly based on the local inquiry. Therefore, the occupation of network transmission can be greatly reduced, the searching and searching efficiency can be greatly improved, the storage mode of the address book information can further improve the storage efficiency, and the error probability in the process of changing the address book is reduced. In addition, the address book can be quickly and accurately positioned to the node to be changed during updating, the updating speed is higher, the occupied network resources are less, and the cost is lower.
The embodiment of the invention also provides electronic equipment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the method when executing the program.
The embodiments of the present invention also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the above method.
Embodiments of the present invention also provide a computer program product comprising a computer program/instruction which, when executed by a processor, performs the steps of the above method.
As shown in fig. 11, the electronic device 1200 may further include: a communication module 110, an input unit 120, an audio processor 130, a display 160, a power supply 170. It is noted that the electronic device 1200 does not necessarily include all of the components shown in fig. 11; in addition, the electronic device 1200 may further include components not shown in fig. 11, to which reference is made to the related art.
As shown in fig. 11, the central processor 100, also sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 100 receives inputs and controls the operation of the various components of the electronic device 1200.
The memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 100 can execute the program stored in the memory 140 to realize information storage or processing, etc.
The input unit 120 provides an input to the central processor 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, or the like. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as ERPOM or the like. Memory 140 may also be some other type of device. Memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application/function storage 142, the application/function storage 142 for storing application programs and function programs or a flow for executing operations of the electronic device 1200 by the central processor 100.
The memory 140 may also include a data store 143, the data store 143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver storage 144 of the memory 140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 110 is a transmitter/receiver 110 that transmits and receives signals via an antenna 111. A communication module (transmitter/receiver) 110 is coupled to the central processor 100 to provide an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and to receive audio input from the microphone 132 to implement usual telecommunication functions. The audio processor 130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 130 is also coupled to the central processor 100 so that sound can be recorded locally through the microphone 132 and so that sound stored locally can be played through the speaker 131.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present invention have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (10)

1. An optimization method for address book loading, which is characterized in that the method is applied to a local client, and comprises the following steps:
the method comprises the steps that full address book information is obtained from a server side when the method is started for the first time, the address book information is stored in the server side in the form of unstructured data of a tree structure, leaf nodes of the tree structure represent staff, attribute values of each leaf node comprise basic information, contact modes and position information of the staff, non-leaf nodes of the tree structure represent departments, values of each non-leaf node comprise upper and lower level department information and brother department information, and the leaf nodes are associated with the non-leaf nodes through one attribute value;
reconstructing structured index information in a local memory based on the full address book information;
and providing address book query service on the local client based on the index information.
2. The method for optimizing address book loading of claim 1, further comprising: before starting local address book inquiry, sending an address book version number acquisition request to the server side;
comparing the address book version number returned by the server with a locally stored version number;
If the address book version number returned by the server is higher than the version number stored locally, acquiring a data change record of the address book from the server and updating the local address book;
if the address book version number returned by the server is equal to the version number stored locally, directly providing service for the local address book query request based on the index information;
and if the address book version number returned by the server is smaller than the version number stored locally, sending the local full address book information to the server.
3. The method for optimizing address book loading of claim 1, further comprising:
before starting local address book inquiry, sending a department version number acquisition request of an address book to the server side;
comparing the department version number returned by the server with the department version number stored locally;
if the department version number returned by the server is higher than the department version number stored locally, acquiring a data change record of the address book from the server and updating the local address book;
if the department version number returned by the server is equal to the department version number stored locally, directly providing service for the local address book query request based on the index information;
And if the department version number returned by the server is smaller than the locally stored department version number, sending department information and personnel information corresponding to the department version number in the local address book information to the server.
4. The method for optimizing address book loading according to claim 2 or 3, wherein the obtaining the data change record of the address book from the server and updating the local address book comprises:
positioning a changed subtree related to address book information based on the address book data change record;
copying the subtree related to the change, and changing the copied subtree based on the data change record;
and replacing the changed subtrees with the changed subtrees to finish the local updating of the address book.
5. The method for optimizing address book loading of claim 4, wherein the method further comprises:
before starting local address book inquiry, sending an address book integrity detection data request to the server side and acquiring first integrity detection data returned by the server side;
after the local updating of the address book is completed, calculating to obtain second integrity detection data based on the updated address book;
And comparing the first integrity detection data with the second integrity detection data to complete integrity detection.
6. The method for optimizing address book loading of claim 5, wherein the address book integrity test data comprises: checksum data, cyclic redundancy check data, digital signature data, or hash value data.
7. An address book loading optimizing device, characterized in that the device comprises:
the information acquisition unit is used for acquiring the total address book information from the server side when the system is started for the first time, the address book information is stored in the server side in the form of unstructured data of a tree structure, leaf nodes of the tree structure represent staff, attribute values of each leaf node comprise basic information, contact information and position information of the staff, non-leaf nodes of the tree structure represent departments, values of each non-leaf node comprise upper and lower level department information and brother department information, and the leaf nodes are associated with the non-leaf nodes through one attribute value;
the index reconstruction unit is used for reconstructing the structured index information in the local memory based on the total address book information;
And the service providing unit is used for providing address book query service on the local client based on the index information.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed by the processor.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method of any of claims 1 to 6.
CN202410187851.5A 2024-02-20 2024-02-20 Address book loading optimization method and device Active CN117743651B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410187851.5A CN117743651B (en) 2024-02-20 2024-02-20 Address book loading optimization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410187851.5A CN117743651B (en) 2024-02-20 2024-02-20 Address book loading optimization method and device

Publications (2)

Publication Number Publication Date
CN117743651A true CN117743651A (en) 2024-03-22
CN117743651B CN117743651B (en) 2024-05-17

Family

ID=90261292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410187851.5A Active CN117743651B (en) 2024-02-20 2024-02-20 Address book loading optimization method and device

Country Status (1)

Country Link
CN (1) CN117743651B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6523021B1 (en) * 2000-07-31 2003-02-18 Microsoft Corporation Business directory search engine
US20100306185A1 (en) * 2009-06-02 2010-12-02 Xobni, Inc. Self Populating Address Book
US20150334230A1 (en) * 2013-05-13 2015-11-19 Jan Volzke Unwanted caller and message sender identification for restricted communication devices
CN109194711A (en) * 2018-07-27 2019-01-11 腾讯科技(深圳)有限公司 A kind of synchronous method of organizational structure, client, server-side and medium
CN109582652A (en) * 2018-11-01 2019-04-05 珠海云数科技有限公司 A kind of storage method of distribution object-oriented data
WO2019127916A1 (en) * 2017-12-29 2019-07-04 北京奇虎科技有限公司 Data read/write method and device implemented on the basis of distributed consensus protocol
CN110414771A (en) * 2019-06-04 2019-11-05 腾讯科技(深圳)有限公司 Update method, device, server and the client of enterprise organization structure data
CN114020748A (en) * 2021-11-05 2022-02-08 光大科技有限公司 Tree-structure address book storage method and device
CN114741444A (en) * 2021-01-07 2022-07-12 腾讯科技(深圳)有限公司 Tissue architecture adjusting method and device, electronic equipment and storage medium
WO2022251009A1 (en) * 2021-05-26 2022-12-01 Microsoft Technology Licensing, Llc Tree-based data structure
CN115510058A (en) * 2022-09-22 2022-12-23 彩讯科技股份有限公司 A search method, device, equipment and storage medium for address book information
CN116610670A (en) * 2023-04-27 2023-08-18 浙江大学 A blockchain-based state data storage method and device
CN117319351A (en) * 2022-06-20 2023-12-29 腾讯科技(深圳)有限公司 Address book management method, device, computer equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6523021B1 (en) * 2000-07-31 2003-02-18 Microsoft Corporation Business directory search engine
US20100306185A1 (en) * 2009-06-02 2010-12-02 Xobni, Inc. Self Populating Address Book
US20150334230A1 (en) * 2013-05-13 2015-11-19 Jan Volzke Unwanted caller and message sender identification for restricted communication devices
WO2019127916A1 (en) * 2017-12-29 2019-07-04 北京奇虎科技有限公司 Data read/write method and device implemented on the basis of distributed consensus protocol
CN109194711A (en) * 2018-07-27 2019-01-11 腾讯科技(深圳)有限公司 A kind of synchronous method of organizational structure, client, server-side and medium
CN109582652A (en) * 2018-11-01 2019-04-05 珠海云数科技有限公司 A kind of storage method of distribution object-oriented data
CN110414771A (en) * 2019-06-04 2019-11-05 腾讯科技(深圳)有限公司 Update method, device, server and the client of enterprise organization structure data
CN114741444A (en) * 2021-01-07 2022-07-12 腾讯科技(深圳)有限公司 Tissue architecture adjusting method and device, electronic equipment and storage medium
WO2022251009A1 (en) * 2021-05-26 2022-12-01 Microsoft Technology Licensing, Llc Tree-based data structure
CN114020748A (en) * 2021-11-05 2022-02-08 光大科技有限公司 Tree-structure address book storage method and device
CN117319351A (en) * 2022-06-20 2023-12-29 腾讯科技(深圳)有限公司 Address book management method, device, computer equipment and storage medium
CN115510058A (en) * 2022-09-22 2022-12-23 彩讯科技股份有限公司 A search method, device, equipment and storage medium for address book information
CN116610670A (en) * 2023-04-27 2023-08-18 浙江大学 A blockchain-based state data storage method and device

Also Published As

Publication number Publication date
CN117743651B (en) 2024-05-17

Similar Documents

Publication Publication Date Title
US9031953B2 (en) Method and system to curate media collections
CN111723161B (en) A data processing method, device and equipment
CN114741335B (en) Cache management method, device, medium and equipment
CN112115209A (en) Method for realizing data expansion
CN112685391A (en) Service data migration method and device, computer equipment and storage medium
CN114238397B (en) User data processing method, device, equipment, storage medium and program product
CN111523030B (en) Newspaper disc information recommendation method and device and computer readable storage medium
CN117743651B (en) Address book loading optimization method and device
CN114091424B (en) Outbound data processing method, outbound platform and computer readable storage medium
CN112965952B (en) Data asset processing method and device
CN111930690B (en) File generation method and device
CN114691944A (en) Data query method, apparatus, electronic device and readable medium
CN113282590A (en) Interface joint debugging method and device based on 5G message
CN113448990A (en) Quasi-real-time multi-dimensional data query method and device for unitized system
CN114282187B (en) Login access control method and device
CN106102027A (en) Note based on MapReduce batch submits method to
CN117743306A (en) Data migration method, device, computer equipment and storage medium
CN117349256A (en) File anticorrosion method, device and system based on distributed platform
CN115455915A (en) Form operation method and device
CN116739397B (en) Dynamic management method for new energy indexes
CN112559610A (en) Method and device for generating account checking file
WO2016131264A1 (en) Method and device for constructing contact information
CN114820890B (en) An intelligent virtual public announcement method and public announcement system
CN117635081B (en) Data processing method, device, equipment and storage medium
CN114519062B (en) Basic data updating method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant