






技术领域technical field
本发明涉及数据处理技术领域,尤其涉及一种数据处理方法、装置、电子设备及存储介质。The present invention relates to the technical field of data processing, and in particular, to a data processing method, device, electronic device and storage medium.
背景技术Background technique
数据协作文档工具作为新一代的数据处理工具在近些年得到了飞速的发展,关联作为数据协作文档的一个核心功能已经被广泛运用到各种业务场景中。对于数据协作文档中存在关联关系的两个文档,被关联的A文档中的数据发送变化时,与文档A存在关联关系的B文档中的数据也会相应变化。例如出入库管理场景中,出库表中的订单数据会与产品表中的数据保持同步。As a new generation of data processing tools, data collaboration document tools have developed rapidly in recent years. As a core function of data collaboration documents, association has been widely used in various business scenarios. For two documents that have an association relationship in the data collaboration document, when the data in the associated document A is changed, the data in the document B that is associated with the document A will also change accordingly. For example, in the inbound and outbound management scenario, the order data in the outbound table will be synchronized with the data in the product table.
现有技术中,针对关联的设计都是关联数据和被关联的数据保持同步,即被关联的数据(如,产品表中的数据)发生改变时,相应的关联数据(如出库记录中对应的关联数据)也会发生改变,这会在一些场景中导致数据错乱的情况。例如,修改了产品表中的成本价格,会导致历史出库记录的成本价格跟着发生变动,导致整个企业的经营数据发生错误。可见,现有技术中被关联的文档数据发生变化时,相应关联的文档都会同步发生变化,容易导致数据管理混乱。In the prior art, the design for association is that the associated data and the associated data are kept synchronized, that is, when the associated data (such as the data in the product table) changes, the corresponding associated data (such as the corresponding data in the outbound record) is changed. linked data) will also change, which can lead to data clutter in some scenarios. For example, modifying the cost price in the product table will cause the cost price of the historical outbound records to change accordingly, resulting in errors in the operating data of the entire enterprise. It can be seen that when the associated document data in the prior art changes, the corresponding associated documents will change synchronously, which easily leads to confusion in data management.
发明内容SUMMARY OF THE INVENTION
本发明提供一种数据处理方法、装置、电子设备及存储介质,用以解决现有技术中被关联的文档数据发生变化时,相应关联的文档都会同步发生变化,容易导致数据管理混乱的缺陷。The present invention provides a data processing method, device, electronic device and storage medium, which are used to solve the problem that when the associated document data changes in the prior art, the corresponding associated documents will change synchronously, which easily leads to chaotic data management.
本发明提供一种数据处理方法,包括:The present invention provides a data processing method, comprising:
确定第一文档以及与所述第一文档具有关联关系的第二文档;determining a first document and a second document associated with the first document;
在所述第二文档中的第二记录的内容发生变化的情况下,在所述第一文档中的与所述第二记录具有关联关系的第一记录的内容维持不变;其中,所述第二记录为所述第二文档中的至少部分数据。In the case that the content of the second record in the second document changes, the content of the first record in the first document that has an associated relationship with the second record remains unchanged; wherein the The second record is at least part of the data in the second document.
可选地,该方法还包括:Optionally, the method further includes:
在所述第二文档中的第四记录的内容发生变化的情况下,在所述第一文档中的与所述第四记录具有关联关系的第三记录的内容同步发生变化;其中,所述第四记录为所述第二文档中的至少其他部分数据。In the case that the content of the fourth record in the second document changes, the content of the third record in the first document that has an associated relationship with the fourth record changes synchronously; wherein the The fourth record is at least other part of the data in the second document.
可选地,所述确定第一文档以及与所述第一文档具有关联关系的第二文档,包括:Optionally, the determining of the first document and the second document having an associated relationship with the first document includes:
对所述第一文档中的第一记录的关联关系进行解析,得到第二记录的定位信息;Analyzing the association relationship of the first record in the first document to obtain the positioning information of the second record;
根据所述第二记录的定位信息确定所述第二文档,并在所述第二文档中确定与所述第一记录具有关联关系的第二记录。The second document is determined according to the positioning information of the second record, and a second record having an associated relationship with the first record is determined in the second document.
可选地,所述在所述第二文档中的第二记录的内容发生变化的情况下,在所述第一文档中的与所述第二记录具有关联关系的第一记录的内容维持不变,包括:Optionally, in the case that the content of the second record in the second document changes, the content of the first record in the first document that has an associated relationship with the second record remains unchanged. changes, including:
复制所述第二记录的内容,得到第五记录;Copy the content of the second record to obtain a fifth record;
将所述第一记录与所述第二记录的关联关系更改为所述第一记录与所述第五记录的关联关系;changing the association relationship between the first record and the second record to the association relationship between the first record and the fifth record;
将所述第五记录设置为不可见,和/或,将所述第一记录设置为不可编辑。The fifth record is set to be invisible, and/or the first record is set to be non-editable.
可选地,所述将所述第一记录与所述第二记录的关联关系更改为所述第一记录与所述第五记录的关联关系,包括:Optionally, the changing the association relationship between the first record and the second record to the association relationship between the first record and the fifth record includes:
解除所述第一记录与所述第二记录的关联关系;disassociating the first record with the second record;
建立所述第一记录与所述第五记录的关联关系。An association relationship between the first record and the fifth record is established.
可选地,所述在所述第二文档中的第二记录的内容发生变化的情况下,在所述第一文档中的与所述第二记录具有关联关系的第一记录的内容维持不变,包括:Optionally, in the case that the content of the second record in the second document changes, the content of the first record in the first document that has an associated relationship with the second record remains unchanged. changes, including:
根据所述第二记录的内容,以及所述第一记录的计算链,获取所述第一记录对应的内容;According to the content of the second record and the calculation chain of the first record, obtain the content corresponding to the first record;
将所述第一记录对应的内容替换所述第一记录的计算链;replacing the computing chain of the first record with the content corresponding to the first record;
将所述第一记录设置为不可编辑。The first record is set as non-editable.
可选地,所述将所述第一记录设置为不可编辑之后,方法还包括:Optionally, after setting the first record to be uneditable, the method further includes:
接收对第六记录的查询指令;其中,所述第六记录是所述第一记录所在的所述第一文档中的一项记录;receiving a query instruction for a sixth record; wherein, the sixth record is a record in the first document where the first record is located;
确定所述第六记录的存储方式;determining the storage mode of the sixth record;
在所述第六记录的存储方式为数值存储的情况下,根据所述第六记录相应存储的数值,得到查询结果并返回;In the case where the storage mode of the sixth record is numerical value storage, the query result is obtained and returned according to the corresponding stored value of the sixth record;
在所述第六记录的存储方式为计算链存储的情况下,根据所述第六记录的计算链,以及所述第六记录的计算链的关联值,得到查询结果并返回。In the case where the storage mode of the sixth record is the calculation chain storage, the query result is obtained and returned according to the calculation chain of the sixth record and the associated value of the calculation chain of the sixth record.
可选地,所述确定所述第六记录的存储方式,包括:Optionally, the determining of the storage mode of the sixth record includes:
根据所述第六记录的标识符,结合标识符与存储方式的预设对应关系,确定所述第六记录的存储方式。The storage mode of the sixth record is determined according to the identifier of the sixth record and in combination with the preset correspondence between the identifier and the storage mode.
本发明还提供一种数据处理装置,包括:The present invention also provides a data processing device, comprising:
确定模块,用于确定第一文档以及与所述第一文档具有关联关系的第二文档;a determining module, configured to determine a first document and a second document having an associated relationship with the first document;
存档模块,用于在所述第二文档中的第二记录的内容发生变化的情况下,在所述第一文档中的与所述第二记录具有关联关系的第一记录的内容维持不变;其中,所述第二记录为所述第二文档中的至少部分数据。an archiving module, configured to maintain the content of the first record in the first document that has an associated relationship with the second record in the case that the content of the second record in the second file changes ; wherein, the second record is at least part of the data in the second document.
本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述数据处理方法的步骤。The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and running on the processor, the processor implements any of the data processing methods described above when the processor executes the program A step of.
本发明还提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述数据处理方法的步骤。The present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of any of the above data processing methods.
本发明提供的一种数据处理方法、装置、电子设备及存储介质,根据第一文档与第二文档的关联关系对第二文档进行了定位,根据第二文档中的第二记录的内容锁定了第一文档中第一记录的内容。在记录层面(粒度)上对数据协作文档中无需同步变化的数据进行了灵活、精准地管理,避免了数据管理混乱。A data processing method, device, electronic device and storage medium provided by the present invention locate the second document according to the association relationship between the first document and the second document, and lock the second document according to the content of the second record in the second document. The content of the first record in the first document. At the record level (granularity), the data in the data collaboration document that does not need to be changed synchronously is managed flexibly and accurately, avoiding the confusion of data management.
附图说明Description of drawings
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are the For some embodiments of the invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1为出入库管理场景下的出库表示意图;Fig. 1 is a schematic diagram of the outbound table under the inbound and outbound management scenario;
图2为出入库管理场景下的产品表示意图;Figure 2 is a schematic diagram of the product table under the scenario of inbound and outbound management;
图3是本发明提供的一种数据处理方法的流程示意图;3 is a schematic flowchart of a data processing method provided by the present invention;
图4是本发明的一个优选实施例中的数据处理方法的流程示意图;4 is a schematic flowchart of a data processing method in a preferred embodiment of the present invention;
图5是本发明的另一个优选实施例中的数据处理方法的流程示意图;5 is a schematic flowchart of a data processing method in another preferred embodiment of the present invention;
图6是本发明提供的一种数据处理装置的结构示意图;6 is a schematic structural diagram of a data processing device provided by the present invention;
图7是本发明提供的电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明提供便捷的数据处理方法,用户通过简单的操作或预先设置即可实现对数据协作文档中单项记录的灵活、精准管理。The invention provides a convenient data processing method, and a user can realize flexible and precise management of a single record in a data collaboration document through simple operations or preset settings.
下面结合图1-图7描述本发明的一种数据处理方法、装置、电子设备及存储介质。The following describes a data processing method, apparatus, electronic device and storage medium of the present invention with reference to FIGS. 1-7 .
图3是本发明提供的一种数据处理方法的流程示意图,如图3所示,该方法包括:FIG. 3 is a schematic flowchart of a data processing method provided by the present invention. As shown in FIG. 3 , the method includes:
S31、确定第一文档以及与第一文档具有关联关系的第二文档;S31, determining the first document and the second document having an associated relationship with the first document;
S32、在第二文档中的第二记录的内容发生变化的情况下,在第一文档中的与第二记录具有关联关系的第一记录的内容维持不变;其中,第二记录为第二文档中的至少部分数据。S32. In the case where the content of the second record in the second file changes, the content of the first record in the first file that has an associated relationship with the second record remains unchanged; wherein the second record is the second record At least part of the data in the document.
举例说明如下,图1为出入库管理场景下的出库表,出库表中的记录A记录了:订单号、产品、产品名称、单价、数量、状态、总价。图2为出入库管理场景下的产品表,产品表中的记录B记录了:产品名称、供货商、成本、单价、库存、规格、(存储)仓库。出库表中的记录A关联了产品表中的记录B,引用了产品名称字段、单价字段,即,记录A中的产品名称、单价不会随着根据记录B中产品名称、单价的改变而同步更新。当出库表中记录A的订单完成后,记录A中的产品名称、单价仍然也不会根据记录B的改变而更新。An example is as follows. Figure 1 shows the outbound table in the inbound and outbound management scenario. Record A in the outbound table records: order number, product, product name, unit price, quantity, status, and total price. Figure 2 shows the product table in the warehouse management scenario. Record B in the product table records: product name, supplier, cost, unit price, inventory, specification, (storage) warehouse. Record A in the outbound table is associated with record B in the product table, and references the product name field and unit price field, that is, the product name and unit price in record A will not change with the change of the product name and unit price in record B. Synchronization Update. When the order of record A in the outbound table is completed, the product name and unit price in record A will not be updated according to the change of record B.
具体地,设备在获取到对第一文档中第一记录的存档指令后,确定与第一文档具有关联关系的第二文档,便于根据第二文档中的第二记录对第一文档中的第一记录进行归档处理,并将第一记录的值维持不变。其中,关联关系指第一文档引用第二文档中至少部分数据。第一记录指第一文档的一行数据条目,以图1为例,第一记录可以为“100001,商品1,商品1,200,1,未发货,200”;第二记录指第二文档的一行数据条目,以图2为例,第二记录可以为“商品1,供货商1,100,200,50,斤,仓库1”。上述设备是本方法的执行主体,设备可以是移动电子设备如手机、PDA(个人数字助理),还可以是计算机等。存档指令可以是通过交互界面接收到的用户输入的指令,如用户通过键盘、鼠标、触控屏等输入的存档指令;存档指令还可以是根据预先设置的程序获取到的存档指令,例如根据预先设置的程序对已完成的订单/超过预设期时长的订单进行存档。第一记录可以是数据表中的一个单元格中的存储内容,也可以是数据表中的一行或一列,用户根据需求设置即可。Specifically, after obtaining the archiving instruction for the first record in the first document, the device determines the second document that has an associated relationship with the first document, so that the first document in the first document can be easily archived according to the second record in the second document. One record is archived and the value of the first record is maintained. The association relationship means that the first document refers to at least part of the data in the second document. The first record refers to a row of data entries in the first document. Taking Figure 1 as an example, the first record can be "100001,
第二文档的第二记录和第一文档的第一记录之间的内容维持不变与否,可根据预先设置确定。也可以根据用户的选择确定,示例性的,在用户选择内容维持不变的情况下,执行即使第二文档的第二记录的内容发生变化,第一文档中的与第二记录具有关联关系的第一记录的内容仍维持不变。在用户选择内容变化同步的情况下,执行第二文档的第二记录的内容发生变化,第二文档中的与第二记录具有关联关系的第一记录的内容也同步发生变化。同步与否,可以根据用户的需要,实时/适当调整。Whether the content between the second record of the second document and the first record of the first document remains unchanged may be determined according to a preset setting. It can also be determined according to the user's selection. Exemplarily, under the condition that the content selected by the user remains unchanged, even if the content of the second record of the second document changes, the content of the first document that has an associated relationship with the second record is executed. The content of the first record remains unchanged. When the user selects content change synchronization, the content of the second record in the second document is changed, and the content of the first record in the second document that is associated with the second record also changes synchronously. Whether to synchronize or not can be adjusted in real time/appropriately according to the needs of users.
第一文档为一篇文档,第二文档可以为一篇文档,也可以为多篇文档。The first document is one document, and the second document may be one document or multiple documents.
第一记录可以包含多条具体的记录内容,在多条记录内容中,可以是部分或全部内容与第二文档中的第二记录存在关联(即,第一记录的部分或全部内容根据第二记录更新)。计算链是数据协作文档的底层内核公式,计算链不直接存储内容,需要通过公式计算得到对应的计算结果。第一记录与第二记录的关联可以以计算链的方式体现,即第一记录中的内容根据计算链的计算结果确定,而计算链进行计算时所需用到的数据引用了第二记录中的数据。The first record may contain multiple specific record contents, and among the multiple record contents, part or all of the contents may be associated with the second record in the second document (that is, part or all of the first record is based on the second record). record update). The calculation chain is the underlying kernel formula of the data collaboration document. The calculation chain does not directly store the content, and the corresponding calculation result needs to be calculated by the formula. The association between the first record and the second record can be embodied in the form of a calculation chain, that is, the content in the first record is determined according to the calculation result of the calculation chain, and the data required for the calculation by the calculation chain refers to the data in the second record. The data.
设备在接收到对第一文档中第一记录的存档指令后,对与第一记录存在关联关系的第二记录进行定位,确定出相应的第二文档及第二文档中的第二记录,进而根据第二记录锁定第一记录的内容。第一记录的内容进行了锁定,即便后续第二记录的内容实时更新,第一记录的内容也不会发生改动,从而避免了数据管理混乱。另外,根据第二记录锁定第一记录的内容的方式可以是:将第一记录更改为数值存储;还可以是保持计算链存储,但是将第一记录的计算链关联到不可变更的副本记录上;还可以是将第二记录设置为不可变更,并为第二记录另外创建一个用于实时更新的副本等方式。具体的锁定方式可以按需求设置,此处不作限制。After receiving the archiving instruction for the first record in the first document, the device locates the second record that is associated with the first record, determines the corresponding second document and the second record in the second document, and then Lock the content of the first record according to the second record. The content of the first record is locked, and even if the content of the second record is updated in real time, the content of the first record will not be changed, thereby avoiding confusion in data management. In addition, the method of locking the content of the first record according to the second record may be: changing the first record to numerical storage; or maintaining the calculation chain storage, but associating the calculation chain of the first record to the immutable copy record ; It can also set the second record as immutable, and create another copy for the second record for real-time update, etc. The specific locking method can be set as required, which is not limited here.
另外,需要说明的是,本发明中第一文档、第二文档中均为包含多项记录的文档,上述步骤中第一记录仅是第一文档中的部分记录,第二记录也仅是第二文档中的部分记录。在执行上述步骤后,第一文档中第一记录的内容不再随着第二文档中第二记录的内容同步更新。同时,可以理解的是,第一文档中还可以存在除第一记录之外的其他部分记录,该部分记录的内容仍然可以随着其他文档中的记录内容同步更新。对于第一文档中的每一项记录,还可以根据预设的程序指令或用户输入的指令,调整该记录是否根据其他文档中的记录进行同步更新。例如,在当前时间点未超过预设值时(或者未接收到用户输入的指令),将第一文档中的一项记录根据第二文档中的记录同步更新;将第一文档中的一项记录根据第二文档中的记录同步更新,并且在当前时间点超过预设值时(或者接收到用户输入的指令),则将第一文档中该记录的内容维持不变。本实施例中根据第一文档与第二文档的关联关系对第二文档进行了定位,根据第二文档中的第二记录锁定了第一文档中第一记录的内容。在记录层面(粒度)上对数据协作文档中无需同步变化的数据进行了灵活、精准地管理,避免了数据管理混乱。In addition, it should be noted that in the present invention, the first document and the second document are documents containing multiple records, the first record in the above steps is only a part of the records in the first document, and the second record is only the first record. Part of the record in the second document. After the above steps are performed, the content of the first record in the first file is no longer updated synchronously with the content of the second record in the second file. At the same time, it can be understood that there may be other partial records other than the first record in the first document, and the contents of the partial records can still be updated synchronously with the record contents in other documents. For each record in the first file, it can also be adjusted according to a preset program instruction or an instruction input by the user whether the record is updated synchronously according to the records in other files. For example, when the current time point does not exceed the preset value (or an instruction input by the user is not received), synchronously update an item in the first document according to the record in the second document; update an item in the first document The record is updated synchronously according to the record in the second file, and when the current time point exceeds the preset value (or an instruction input by the user is received), the content of the record in the first file remains unchanged. In this embodiment, the second document is located according to the association relationship between the first document and the second document, and the content of the first record in the first document is locked according to the second record in the second document. At the record level (granularity), the data in the data collaboration document that does not need to be changed synchronously is managed flexibly and accurately, avoiding the confusion of data management.
基于上述任一实施例,在一个实施例中,方法还包括:Based on any of the foregoing embodiments, in one embodiment, the method further includes:
在第二文档中的第四记录的内容发生变化的情况下,在第一文档中的与第四记录具有关联关系的第三记录的内容同步发生变化;其中,第四记录为第二文档中的至少其他部分数据。In the case where the content of the fourth record in the second document changes, the content of the third record in the first document that has an associated relationship with the fourth record changes synchronously; wherein the fourth record is in the second document at least other parts of the data.
具体地,第一文档、第二文档中均包含多项记录,第三记录是第一文档中与第一记录不同的记录,第四记录是第二文档中的与第二记录不同的记录(即,至少其他部分数据),并且第三记录与第四记录存在关联关系。此时,在第二文档中第四记录的内容发送变化的情况下,第三记录的内容随着第四记录的内容同步发生变化。也就是说,对于存在关联关系的第一文档和第二文档,其中不仅包括不随着关联内容相应变化的记录,同时,还存在着根据被关联内容相应变化的记录。Specifically, both the first document and the second document contain multiple records, the third record is a record in the first document that is different from the first record, and the fourth record is a record in the second document that is different from the second record ( That is, at least other part of the data), and the third record has an associated relationship with the fourth record. At this time, when the content of the fourth record in the second file is changed in transmission, the content of the third record changes synchronously with the content of the fourth record. That is to say, for the first document and the second document with an associated relationship, not only records that do not change with the associated content are included, but also records that change according to the associated content.
另外,对于第一文档中的每一项记录,还可以根据预设的程序指令或用户输入的指令,调整该记录是否根据其他文档中的记录进行同步更新。例如,在当前时间点未超过预设值时(或者未接收到用户输入的指令),将第一文档中的一项记录根据第二文档中的记录同步更新;在当前时间点超过预设值时(或者接收到用户输入的指令),则将第一文档中该记录的内容维持不变。In addition, for each record in the first document, it can also be adjusted according to a preset program instruction or an instruction input by the user whether the record is updated synchronously according to the records in other documents. For example, when the current time point does not exceed the preset value (or an instruction input by the user is not received), update a record in the first document synchronously according to the record in the second document; when the current time point exceeds the preset value (or an instruction input by the user is received), the content of the record in the first document remains unchanged.
本实施例中除了根据第二文档中的第二记录锁定了第一文档中第一记录的内容之外,还根据第二文档中的第四记录同步更新第一文档中的第三记录的内容,使得用户能够在单项记录层面(粒度)上,根据需求灵活地设置是否根据关联内容更新协作数据文档中的数据记录,避免了数据管理混乱。In this embodiment, in addition to locking the content of the first record in the first document according to the second record in the second document, the content of the third record in the first document is also updated synchronously according to the fourth record in the second document , so that users can flexibly set whether to update the data records in the collaborative data document according to the associated content at the single record level (granularity) according to their needs, so as to avoid confusion in data management.
基于上述任一实施例,在一个实施例中,确定第一文档以及与第一文档具有关联关系的第二文档,包括:Based on any of the foregoing embodiments, in one embodiment, determining the first document and the second document having an associated relationship with the first document includes:
对第一文档中的第一记录的关联关系进行解析,得到第二记录的定位信息;Analyzing the association relationship of the first record in the first document to obtain the positioning information of the second record;
根据第二记录的定位信息确定第二文档,并在第二文档中确定与第一记录具有关联关系的第二记录。The second document is determined according to the positioning information of the second record, and a second record having an associated relationship with the first record is determined in the second document.
具体地,第一记录与第二记录的关联关系,可以以计算链的方式体现,第一记录的内容根据计算链的关联数据进行计算(或直接引用)得到,并且计算链中记录有关联数据(对应上述第二记录)的定位信息,定位信息用于获取相应的关联数据,定位信息可以包括关联的数据协作文档标识(例如,表ID)、数据协作文档中具体的记录标识(例如,记录ID,也就是每一项记录的唯一区分标识)等。可以理解的是,如果是以一行或一列作为一项记录,则记录标识可以是相应行的标识或相应列的标识;如果是以单元格作为一项记录,则记录标识可以是相应行的标识和相应列的标识。通过对第一文档的中第一记录的计算链进行解析,得到第二数据的定位信息(例如表ID,记录ID),然后根据第二记录的定位信息(例如定位信息中的表ID)确定关联的第二文档,并根据第二记录的定位信息(例如定位信息中的记录ID)即可进一步确定第二记录,以便获取第二记录的当前内容。Specifically, the association relationship between the first record and the second record can be embodied in the form of a calculation chain. The content of the first record is obtained by calculation (or direct reference) according to the associated data of the calculation chain, and the associated data is recorded in the calculation chain. (corresponding to the above-mentioned second record) positioning information, the positioning information is used to obtain the corresponding associated data, and the positioning information may include an associated data collaboration document identifier (for example, a table ID), a specific record identifier in the data collaboration document (for example, a record ID) ID, that is, the unique identification of each record) and so on. It can be understood that if a row or a column is used as a record, the record identifier can be the identifier of the corresponding row or the identifier of the corresponding column; if the cell is used as a record, the record identifier can be the identifier of the corresponding row. and the corresponding column ID. By analyzing the calculation chain of the first record in the first document, the positioning information of the second data (such as table ID, record ID) is obtained, and then determined according to the positioning information of the second record (such as the table ID in the positioning information) The associated second document can be further determined according to the location information of the second record (for example, the record ID in the location information), so as to obtain the current content of the second record.
本实施例中通过对第一记录的关联关系进行解析,得到第二记录的定位信息,进而对第二记录进行了准确的定位。In this embodiment, by analyzing the association relationship of the first record, the positioning information of the second record is obtained, and then the second record is accurately located.
基于上述任一实施例,在一个实施例中,在第二文档中的第二记录的内容发生变化的情况下,在第一文档中的与第二记录具有关联关系的第一记录的内容维持不变,包括:Based on any of the foregoing embodiments, in one embodiment, in the case where the content of the second record in the second document changes, the content of the first record in the first document that has an associated relationship with the second record remains unchanged, including:
复制第二记录的内容,得到第五记录;Copy the content of the second record to obtain the fifth record;
将第一记录与第二记录的关联关系更改为第一记录与第五记录的关联关系;Change the association relationship between the first record and the second record to the association relationship between the first record and the fifth record;
将第五记录设置为不可见,和/或,将第一记录设置为不可编辑。Set the fifth record to be invisible, and/or set the first record to be non-editable.
具体地,第二记录的内容是实时更新的,对第二记录的内容进行复制,得到作为第二记录的副本的第五记录,第五记录的存储位置可以与第二记录处于同一数据协作文档中(即,存储在第二文档中)。Specifically, the content of the second record is updated in real time, and the content of the second record is copied to obtain a fifth record that is a duplicate of the second record, and the storage location of the fifth record can be in the same data collaboration document as the second record in (ie, stored in the second document).
然后,将第一记录与第二记录的关联关系更改为第一记录与第五记录的关联关系。具体实现方式可以将第一记录的计算链中指向第二记录的定位信息更改为指向第五记录的定位信息。Then, the relationship between the first record and the second record is changed to the relationship between the first record and the fifth record. In a specific implementation manner, the positioning information pointing to the second record in the calculation chain of the first record can be changed to the positioning information pointing to the fifth record.
进一步,为了防止误操作导致第一记录发生更改,可以将第五记录设置为不可见,避免针对第五记录的误操作,相应避免与第三记录关联的第一记录发生更改。可以理解的是,本实施例中第五记录是复制第二记录存储的记录,第一记录是以计算链方式存储的记录,更改关联关系后,第一记录的内容根据第五记录的内容同步变化。另外,还可以将第一记录设置为不可编辑,防止直接对第一记录进行更改的误操作。Further, in order to prevent the first record from being changed due to misoperation, the fifth record can be set to be invisible, to avoid misoperation on the fifth record, and correspondingly to avoid the modification of the first record associated with the third record. It can be understood that in this embodiment, the fifth record is a record stored by copying the second record, and the first record is a record stored in a computing chain. After the association relationship is changed, the content of the first record is synchronized according to the content of the fifth record. Variety. In addition, the first record can also be set as non-editable to prevent misoperation of directly modifying the first record.
本实施例中根据第二记录的内容建立副本得到第五记录,然后将第一记录关联到非实时更新的第五记录上,从而对第一记录的值进行了锁定,通过将第五记录设置为不可见,和/或,将第一记录设置为不可编辑,避免了误操作导致第五记录发生更改的情况。并且本实施例中第一记录仍存在关联关系,用户仍可以通过关联关系了解各记录的之间的联系,便于查询。In this embodiment, a copy is established according to the content of the second record to obtain the fifth record, and then the first record is associated with the fifth record that is not updated in real time, thereby locking the value of the first record. It is not visible, and/or, the first record is set to be uneditable, so as to avoid the situation that the fifth record is changed due to misoperation. In addition, in this embodiment, the first record still has an association relationship, and the user can still know the relationship between the records through the association relationship, which is convenient for query.
基于上述任一实施例,在一个实施例中,在第二文档中的第二记录的内容发生变化的情况下,在第一文档中的与第二记录具有关联关系的第一记录的内容维持不变,包括:Based on any of the foregoing embodiments, in one embodiment, in the case where the content of the second record in the second document changes, the content of the first record in the first document that has an associated relationship with the second record remains unchanged, including:
复制第二记录的内容,得到第七记录;其中,第七记录用于实时更新;Copy the content of the second record to obtain the seventh record; wherein, the seventh record is used for real-time update;
将第八记录与第二记录的关联关系更改为第八记录与第七记录的关联关系;其中,第八记录是除第一记录之外,且与第二记录存在关联关系的记录;Change the association relationship between the eighth record and the second record to the association relationship between the eighth record and the seventh record; wherein, the eighth record is a record that is in addition to the first record and has an associated relationship with the second record;
将第二记录设置为不可编辑,和/或,将第一记录设置为不可编辑。Set the second record as non-editable, and/or set the first record as non-editable.
本实施例中根据第二记录的内容建立副本得到第七记录,通过将第八记录与第二记录的关联关系更改为第八记录与第七记录的关联关系,使得原本第二记录对应的内容仍可以等效地实现实时更新。通过将第一记录关联的第二记录设置为不可编辑,使得调整后的第二记录不再实时更新,从而间接锁定了第一记录的内容。通过将第一记录设置为不可编辑,避免了误操作导致第一记录发生更改的情况。In this embodiment, a copy is established according to the content of the second record to obtain the seventh record. By changing the association relationship between the eighth record and the second record to the association relationship between the eighth record and the seventh record, the original content corresponding to the second record is changed. Real-time updates can still be implemented equivalently. By setting the second record associated with the first record to be non-editable, the adjusted second record is no longer updated in real time, thereby indirectly locking the content of the first record. By setting the first record to be uneditable, the situation that the first record is changed due to misoperation is avoided.
基于上述任一实施例,在一个实施例中,将第一记录与第二记录的关联关系更改为第一记录与第五记录的关联关系,包括:Based on any of the foregoing embodiments, in one embodiment, changing the association relationship between the first record and the second record to the association relationship between the first record and the fifth record includes:
解除第一记录与第二记录的关联关系;Release the association between the first record and the second record;
建立第一记录与第五记录的关联关系。Establish an association relationship between the first record and the fifth record.
具体地,解除第一记录与第二记录的关联关系,也就是将第一记录的计算链中指向第二记录的定位信息删除;建立第一记录与第三记录的关联关系,即,将第一记录的计算链中指向第二记录的定位信息改为指向到第五记录的定位信息。Specifically, release the association between the first record and the second record, that is, delete the positioning information pointing to the second record in the calculation chain of the first record; establish the association between the first record and the third record, that is, delete the first record and the third record. In the calculation chain of a record, the positioning information pointing to the second record is changed to point to the positioning information of the fifth record.
本实施例中通过解除第一记录与第二记录的关联关系,并建立第一记录与第五记录的关联关系,使得第一记录的内容根据第五记录中锁定的内容确定,从而对第一记录的值进行了锁定,避免了对第一记录所在数据协作文档中第一记录内容的更改。In this embodiment, the association relationship between the first record and the second record is released, and the association relationship between the first record and the fifth record is established, so that the content of the first record is determined according to the locked content in the fifth record, so that the first record and the fifth record are locked. The value of the record is locked to avoid changing the content of the first record in the data collaboration document where the first record is located.
基于上述任一实施例,在一个实施例中,根据第二记录锁定第一记录的值,包括:Based on any of the foregoing embodiments, in one embodiment, locking the value of the first record according to the second record includes:
根据第二记录的内容,以及第一记录的计算链,获取第一记录对应的内容;According to the content of the second record and the calculation chain of the first record, obtain the content corresponding to the first record;
将第一记录对应的内容替换第一记录的计算链;Replace the calculation chain of the first record with the content corresponding to the first record;
将第一记录设置为不可编辑。Set the first record as non-editable.
具体地,第二记录是实时更新的记录,第一记录的内容根据计算链的计算结果确定,而计算链的计算需要用到第二记录中的内容,因此,根据第二记录的内容以及第一记录的计算链进行计算,即可得到第一记录对应的内容;然后,将第一记录对应的内容替换第一记录的计算链,也就是说第一记录不再以计算链的方式存储,而是直接以数值的方式进行存储,这样,第一记录不再与其他记录关联,从而实现了第一记录的锁定。另外,还可以将第一记录设置为不可编辑,避免误操作对第一记录进行更改。Specifically, the second record is a record updated in real time, the content of the first record is determined according to the calculation result of the calculation chain, and the calculation of the calculation chain needs to use the content in the second record, therefore, according to the content of the second record and the first record After calculating the calculation chain of a record, the content corresponding to the first record can be obtained; then, the content corresponding to the first record is replaced with the calculation chain of the first record, that is to say, the first record is no longer stored in the form of a calculation chain, Instead, it is directly stored in the form of numerical values, so that the first record is no longer associated with other records, thereby realizing the locking of the first record. In addition, the first record can also be set as non-editable, so as to avoid misoperation to modify the first record.
本实施例中根据第二记录的内容以及第一记录的计算链确定了第一记录对应的内容,将第一记录对应的内容替换计算链使得第一记录不再与其他记录关联,从而实现了第一记录的锁定;还通过将第一记录设置为不可编辑,避免误操作对第一记录进行更改。In this embodiment, the content corresponding to the first record is determined according to the content of the second record and the calculation chain of the first record, and the content corresponding to the first record is replaced by the calculation chain so that the first record is no longer associated with other records, thereby realizing Locking of the first record; and by setting the first record as uneditable, it is possible to avoid changing the first record by misoperation.
基于上述任一实施例,在一个实施例中,将第一记录设置为不可编辑之后,方法还包括:Based on any of the foregoing embodiments, in one embodiment, after setting the first record to be uneditable, the method further includes:
接收对第六记录的查询指令;其中,第六记录是第一记录所在的第一文档中的一项记录;receiving a query instruction for the sixth record; wherein, the sixth record is a record in the first document where the first record is located;
确定第六记录的存储方式;determine the storage method of the sixth record;
在第六记录的存储方式为数值存储的情况下,根据第六记录相应存储的数值,得到查询结果并返回;In the case where the storage mode of the sixth record is numerical value storage, the query result is obtained and returned according to the correspondingly stored value of the sixth record;
在第六记录的存储方式为计算链存储的情况下,根据第六记录的计算链,以及第六记录的计算链的关联值,得到查询结果并返回。In the case where the storage mode of the sixth record is the calculation chain storage, the query result is obtained and returned according to the calculation chain of the sixth record and the associated value of the calculation chain of the sixth record.
具体地,按照数据处理方法对第一记录进行存档后,第一记录所在的数据协作文档中同时存在以数值方式存储的记录,以及以计算链方式关联存储的记录。由于数据协作文档中数据存储方式的不同,在数据查询时需要相应执行不同的查询步骤。Specifically, after the first record is archived according to the data processing method, the data collaboration document where the first record is located contains both a record stored in a numerical manner and a record stored in an associated manner in a calculation chain. Due to the different data storage methods in the data collaboration document, different query steps need to be performed correspondingly during data query.
第六记录是第一记录所在的数据协作文档中的一项记录,可以理解的是,第六记录可以与第一记录是同一项记录,也可以是不同的记录。在接收到对第六记录的查询指令后,先确定第六记录的存储方式,存储方式包括数值存储和计算链存储(可理解为计算公式)。The sixth record is a record in the data collaboration document where the first record is located. It can be understood that the sixth record may be the same record as the first record, or may be a different record. After receiving the query instruction for the sixth record, first determine the storage mode of the sixth record, and the storage mode includes numerical storage and calculation chain storage (which can be understood as a calculation formula).
当第六记录是以数值的方式存储时,直接根据相应存储的数值还原记录,作为查询结果并返回。可以理解的是存储的数值需要进行还原,得到具有实际含义的记录,例如第四记录进行存储时存储的仅为商品编号,这时需要根据商品编号确定具体的商品名称,将具体的商品名称作为记录的一部分,并返还查询结果。When the sixth record is stored as a numerical value, the record is directly restored according to the corresponding stored value, and returned as a query result. It can be understood that the stored value needs to be restored to obtain a record with actual meaning. For example, when the fourth record is stored, only the product number is stored. At this time, the specific product name needs to be determined according to the product number, and the specific product name is used as part of the record and return the query result.
当第六记录的存储方式为计算链存储时,根据第六记录的计算链,以及第六记录的计算链的关联值,得到查询结果并返回。具体地,可以根据第六记录的计算链确定其关联记录的定位信息,然后根据定位信息获取相应的关联值,并将关联值用于计算链中进行计算,得到计算结果,然后,进一步将计算结果还原为具有实际含义的记录,作为查询结果返还。When the storage mode of the sixth record is the calculation chain storage, the query result is obtained and returned according to the calculation chain of the sixth record and the associated value of the calculation chain of the sixth record. Specifically, the positioning information of the associated record can be determined according to the calculation chain of the sixth record, and then the corresponding associated value is obtained according to the positioning information, and the associated value is used in the calculation chain for calculation to obtain the calculation result, and then the calculation The result reverts to a meaningful record, returned as the query result.
本实施例确定了第六记录的存储方式,并根据第六记录的存储方式执行相应的获取查询结果的步骤,精确便捷地获取到了查询结果。In this embodiment, the storage mode of the sixth record is determined, and the corresponding steps of obtaining the query result are performed according to the storage mode of the sixth record, so that the query result can be obtained accurately and conveniently.
基于上述任一实施例,在一个实施例中,确定第六记录的存储方式,包括:Based on any of the foregoing embodiments, in one embodiment, determining the storage mode of the sixth record includes:
根据第六记录的标识符,结合标识符与存储方式的预设对应关系,确定第六记录的存储方式。The storage mode of the sixth record is determined according to the identifier of the sixth record and in combination with the preset correspondence between the identifier and the storage mode.
具体地,在进行记录存储时,可以在数据记录的存储结构中设置“标识符”字段,用于标识记录的存储方式,以便于数据记录的精确存储、查询。例如,对于数值存储的记录,记录的存储结构可以设置为:“标识符+数据+数据类型”。又例如,对于计算链存储的记录,记录的存储结构可以设置为:“标识符+计算链+关联记录的定位信息”。“标识符”可以设置为固定长度,且与存储方式具有预设对应关系,例如,设置标志符“001”对应为数值存储,设置标志符“010”对应为计算链存储。根据第六记录的标识符,结合标识符与存储方式的预设对应关系,即可确定第六记录的存储方式。Specifically, when performing record storage, an "identifier" field may be set in the storage structure of the data record to identify the storage mode of the record, so as to facilitate accurate storage and query of the data record. For example, for a record of value storage, the storage structure of the record can be set to: "identifier + data + data type". For another example, for a record stored in a computing chain, the storage structure of the record may be set to: "identifier+computation chain+location information of the associated record". The "identifier" can be set to a fixed length and has a preset corresponding relationship with the storage method. For example, setting the identifier "001" corresponds to numerical storage, and setting the identifier "010" corresponds to computing chain storage. According to the identifier of the sixth record, in combination with the preset correspondence between the identifier and the storage mode, the storage mode of the sixth record can be determined.
本实施例中根据第六记录的标识符,结合标识符与存储方式的预设对应关系,准确地确定了第六记录的存储方式,避免了数据管理混乱。In this embodiment, according to the identifier of the sixth record, combined with the preset correspondence between the identifier and the storage mode, the storage mode of the sixth record is accurately determined, thereby avoiding confusion in data management.
下面通过一个优选的实施例对本发明提供的一种数据处理方法进行说明:A data processing method provided by the present invention is described below through a preferred embodiment:
假设当有两张表:表1(仍参照图1),表2(仍参照图2)。Suppose when there are two tables: Table 1 (refer to Figure 1), Table 2 (refer to Figure 2).
其中,表1(出库表)中的记录A关联了表2(产品表)中的记录B,并引用了表2中的产品名称/单价字段:Among them, record A in table 1 (outbound table) is associated with record B in table 2 (product table), and refers to the product name/unit price field in table 2:
图4是本发明的一个优选实施例中的数据处理方法的流程示意图,如图4所示,本实施例中在获取到对表1中记录A的存档指令后,根据如下步骤锁定记录A:4 is a schematic flowchart of a data processing method in a preferred embodiment of the present invention. As shown in FIG. 4 , in this embodiment, after obtaining the archive instruction for record A in Table 1, record A is locked according to the following steps:
第一步:解析记录A;Step 1: Parse record A;
此步骤需要首先检测记录A是否存在关联记录,若不存在关联记录,则直接执行第四步。In this step, it is necessary to first detect whether there is an associated record in record A, and if there is no associated record, directly execute the fourth step.
若存在关联,需要获取记录A的关联关系,获取其所关联记录的表ID和记录ID(即上述关联记录的定位信息),然后用解析出来的表ID和记录ID进行第二步。If there is an association, it is necessary to obtain the association relationship of record A, obtain the table ID and record ID of the associated record (that is, the positioning information of the above-mentioned associated record), and then use the parsed table ID and record ID to perform the second step.
第二步:生成备份关联记录;Step 2: Generate backup associated records;
从第一步解析出来的表ID和记录ID,定位到被关联的表2中的记录B。From the table ID and record ID parsed in the first step, locate the record B in the associated table 2.
以记录B的当前值为副本,在产品表内复制一条记录C,记录C和记录B的当前值数据保持一致;Take the current value of record B as a copy, copy a record C in the product table, and keep the current value data of record C and record B consistent;
将记录C的记录ID和表ID作为第三步的参数。Take the record ID and table ID of record C as the parameters of the third step.
第三步:修改记录A的关联关系(即图4中的引用关系);The third step: modify the association relationship of record A (that is, the reference relationship in Figure 4);
解除表1中记录A和表2中记录B的关联关系;Release the association between record A in table 1 and record B in table 2;
将表1中的记录A和表2中的记录C建立关联关系,并将记录A的记录ID和记录C的记录ID作为第四步的参数。Establish an associated relationship between record A in table 1 and record C in table 2, and use the record ID of record A and the record ID of record C as the parameters of the fourth step.
第四步:设置权限;Step 4: Set permissions;
将记录C的可见权限设为对所有用户不可见;Set the visibility permission of record C to be invisible to all users;
将记录A的编辑权限设为所有用户不可编辑;Set the editing permission of record A to be uneditable by all users;
结束。Finish.
通过上述的方法,成功将记录A实现归档,并且没有对表1作改动,用户仍可以通过表1了解各记录的关联关系。当用户在表2中修改记录B的数据,例如产品名称/单价时,记录A内的信息不会同步修改,但其他记录仍会保持同步。Through the above method, the record A is successfully archived, and no changes are made to Table 1, and the user can still know the association relationship of each record through Table 1. When the user modifies the data of record B in Table 2, such as product name/unit price, the information in record A will not be modified synchronously, but other records will remain synchronized.
下面通过另一个优选的实施例对本发明提供的一种数据处理方法进行说明:A data processing method provided by the present invention is described below through another preferred embodiment:
假设当有两张表:表1(仍参照图1),表2(仍参照图2)。Suppose when there are two tables: Table 1 (refer to Figure 1), Table 2 (refer to Figure 2).
其中,表1中的记录A关联了表2中的记录B,并关联了表2中的产品名称/单价字段:Among them, record A in table 1 is associated with record B in table 2, and is associated with the product name/unit price field in table 2:
图5是本发明的另一个优选实施例中的数据处理方法的流程示意图,如图5所示,本实施例中在获取到对表1中记录A的存档指令后,根据如下步骤锁定记录A:FIG. 5 is a schematic flowchart of a data processing method in another preferred embodiment of the present invention. As shown in FIG. 5 , in this embodiment, after obtaining the archive instruction for record A in Table 1, the record A is locked according to the following steps :
第一步:修改记录A中的关联字段(即,关联了其他记录的字段)的存储方式;Step 1: Modify the storage method of the associated fields in record A (that is, fields associated with other records);
将记录A中的关联字段对应的值计算出来;Calculate the value corresponding to the associated field in record A;
将记录A中的关联字段由原先的存储计算链改为存储为数值。Change the associated field in record A from the original storage calculation chain to stored as a value.
第二步:设置权限。Step 2: Set permissions.
设置记录A的可编辑权限为,所有用户不可编辑。Set the editable permission of record A to not be editable by all users.
本实施例中在用户归档记录A时,将记录A的关联字段存储方式由存储计算链改为存储数值并记录其对应数据类型。当用户查询、读取数据时,通过常量识别区分数值存储与计算链存储,根据对应的数值或计算结果还原对应的记录。In this embodiment, when the user archives the record A, the storage method of the associated field of the record A is changed from the storage calculation chain to the storage value and the corresponding data type is recorded. When a user queries or reads data, the value storage and the calculation chain storage are distinguished by constant identification, and the corresponding record is restored according to the corresponding value or calculation result.
通过上述的方法,成功将记录A实现归档,当用户在表1中修改记录B的数据,例如产品名称/单价时,记录A内的信息不会同步修改。本实施例中将记录A归档为数值,降低了数据存储占用的空间,且保证了记录A不会随着其他记录更改。Through the above method, record A is successfully archived. When the user modifies the data of record B in Table 1, such as product name/unit price, the information in record A will not be modified synchronously. In this embodiment, the record A is archived as a numerical value, which reduces the space occupied by the data storage and ensures that the record A will not be changed with other records.
下面对本发明提供的一种数据处理装置进行描述,下文描述的数据处理装置与上文描述的数据处理方法可相互对应参照。A data processing apparatus provided by the present invention is described below, and the data processing apparatus described below and the data processing method described above can be referred to each other correspondingly.
图6是本发明提供的一种数据处理装置的结构示意图,如图6所示,该装置包括:确定模块61以及存档模块62。FIG. 6 is a schematic structural diagram of a data processing apparatus provided by the present invention. As shown in FIG. 6 , the apparatus includes: a
确定模块61,用于确定与待存档的第一记录存在关联关系的第二记录;其中,第二记录为实时更新的记录;A
存档模块62,用于根据第二记录,锁定第一记录的值。The
本实施例中根据第一文档与第二文档的关联关系对第二文档进行了定位,根据第二文档中的第二记录锁定了第一文档中第一记录的内容。在记录层面(粒度)上对数据协作文档中无需同步变化的数据进行了灵活、精准地管理,避免了数据管理混乱。In this embodiment, the second document is located according to the association relationship between the first document and the second document, and the content of the first record in the first document is locked according to the second record in the second document. At the record level (granularity), the data in the data collaboration document that does not need to be changed synchronously is managed flexibly and accurately, avoiding the confusion of data management.
基于上述任一实施例,在一个实施例中,装置还包括:Based on any of the foregoing embodiments, in one embodiment, the apparatus further includes:
更新模块,用于在第二文档中的第四记录的内容发生变化的情况下,在第一文档中的与第四记录具有关联关系的第三记录的内容同步发生变化;其中,第四记录为第二文档中的至少其他部分数据。an update module, configured to synchronize the content of the third record with the fourth record in the first document when the content of the fourth record in the second file changes; wherein, the fourth record is at least other part of the data in the second document.
本实施例中除了根据第二文档中的第二记录锁定了第一文档中第一记录的内容之外,还根据第二文档中的第四记录同步更新第一文档中的第三记录的内容,使得用户能够在单项记录层面(粒度)上,根据需求灵活地设置是否根据关联内容更新协作数据文档中的数据记录,避免了数据管理混乱。In this embodiment, in addition to locking the content of the first record in the first document according to the second record in the second document, the content of the third record in the first document is also updated synchronously according to the fourth record in the second document , so that users can flexibly set whether to update the data records in the collaborative data document according to the associated content at the single record level (granularity) according to their needs, so as to avoid confusion in data management.
基于上述任一实施例,在一个实施例中,确定模块61,包括:Based on any of the foregoing embodiments, in one embodiment, the determining
第一确定单元,用于对第一文档中的第一记录的关联关系进行解析,得到第二记录的定位信息;a first determining unit, configured to analyze the association relationship of the first record in the first document to obtain the positioning information of the second record;
第二确定单元,用于根据第二记录的定位信息确定第二文档,并在第二文档中确定与第一记录具有关联关系的第二记录。The second determining unit is configured to determine the second document according to the positioning information of the second record, and determine the second record in the second document that has an associated relationship with the first record.
本实施例中通过对第一记录的关联关系进行解析,得到第二记录的定位信息,进而对第二记录进行了准确的定位。In this embodiment, by analyzing the association relationship of the first record, the positioning information of the second record is obtained, and then the second record is accurately located.
基于上述任一实施例,在一个实施例中,存档模块62,包括:Based on any of the above embodiments, in one embodiment, the
第一存档单元,用于复制第二记录的内容,得到第五记录;The first archiving unit is used to copy the content of the second record to obtain the fifth record;
第二存档单元,用于将第一记录与第二记录的关联关系更改为第一记录与第五记录的关联关系;a second archiving unit, configured to change the association relationship between the first record and the second record to the association relationship between the first record and the fifth record;
第三存档单元,用于将第五记录设置为不可见,和/或,将第一记录设置为不可编辑。A third archiving unit for setting the fifth record as invisible, and/or setting the first record as uneditable.
本实施例中根据第二记录的内容建立副本得到第五记录,然后将第一记录关联到非实时更新的第五记录上,从而对第一记录的值进行了锁定,通过将第五记录设置为不可见,和/或,将第一记录设置为不可编辑,避免了误操作导致第五记录发生更改的情况。并且本实施例中第一记录仍存在关联关系,用户仍可以通过关联关系了解各记录的之间的联系,便于查询。In this embodiment, a copy is established according to the content of the second record to obtain the fifth record, and then the first record is associated with the fifth record that is not updated in real time, thereby locking the value of the first record. It is not visible, and/or, the first record is set to be uneditable, so as to avoid the situation that the fifth record is changed due to misoperation. In addition, in this embodiment, the first record still has an association relationship, and the user can still know the relationship between the records through the association relationship, which is convenient for query.
基于上述任一实施例,在一个实施例中,存档模块62,包括:Based on any of the above embodiments, in one embodiment, the
第四存档单元,用于复制第二记录的内容,得到第七记录;其中,第七记录用于实时更新;The fourth archiving unit is used to copy the content of the second record to obtain the seventh record; wherein, the seventh record is used for real-time updating;
第五存档单元,用于将第八记录与第二记录的关联关系更改为第八记录与第七记录的关联关系;其中,第八记录是除第一记录之外,且与第二记录存在关联关系的记录;The fifth archiving unit is used to change the association relationship between the eighth record and the second record to the association relationship between the eighth record and the seventh record; wherein, the eighth record is in addition to the first record and exists with the second record records of associations;
第六存档单元,用于将第二记录设置为不可编辑,和/或,将第一记录设置为不可编辑。The sixth archiving unit is used for setting the second record as uneditable, and/or setting the first record as uneditable.
本实施例中根据第二记录的内容建立副本得到第七记录,通过将第八记录与第二记录的关联关系更改为第八记录与第七记录的关联关系,使得原本第二记录对应的内容仍可以等效地实现实时更新。通过将第一记录关联的第二记录设置为不可编辑,使得调整后的第二记录不再实时更新,从而间接锁定了第一记录的内容。通过将第一记录设置为不可编辑,避免了误操作导致第一记录发生更改的情况。In this embodiment, a copy is established according to the content of the second record to obtain the seventh record. By changing the association relationship between the eighth record and the second record to the association relationship between the eighth record and the seventh record, the original content corresponding to the second record is changed. Real-time updates can still be implemented equivalently. By setting the second record associated with the first record to be non-editable, the adjusted second record is no longer updated in real time, thereby indirectly locking the content of the first record. By setting the first record to be uneditable, the situation that the first record is changed due to misoperation is avoided.
基于上述任一实施例,在一个实施例中,第二存档单元,包括:Based on any of the foregoing embodiments, in one embodiment, the second archiving unit includes:
解除子单元,用于解除第一记录与第二记录的关联关系;A release subunit for releasing the association relationship between the first record and the second record;
建立子单元,用于建立第一记录与第五记录的关联关系。A subunit is established for establishing an association relationship between the first record and the fifth record.
本实施例中通过解除第一记录与第二记录的关联关系,并建立第一记录与第五记录的关联关系,使得第一记录的内容根据第五记录中锁定的内容确定,从而对第一记录的值进行了锁定,避免了对第一记录所在数据协作文档中第一记录内容的更改。In this embodiment, the association relationship between the first record and the second record is released, and the association relationship between the first record and the fifth record is established, so that the content of the first record is determined according to the locked content in the fifth record, so that the first record and the fifth record are locked. The value of the record is locked to avoid changing the content of the first record in the data collaboration document where the first record is located.
基于上述任一实施例,在一个实施例中,存档模块62,包括:Based on any of the above embodiments, in one embodiment, the
第四存档单元,用于根据第二记录的内容,以及第一记录的计算链,获取第一记录对应的内容;a fourth archiving unit, configured to obtain the content corresponding to the first record according to the content of the second record and the calculation chain of the first record;
第五存档单元,用于将第一记录对应的内容替换第一记录的计算链;a fifth archive unit, used for replacing the content corresponding to the first record with the calculation chain of the first record;
第六存档单元,用于将第一记录设置为不可编辑。The sixth archive unit is used to set the first record as uneditable.
本实施例中根据第二记录的内容以及第一记录的计算链确定了第一记录对应的内容,将第一记录对应的内容替换计算链使得第一记录不再与其他记录关联,从而实现了第一记录的锁定;还通过将第一记录设置为不可编辑,避免误操作对第一记录进行更改。In this embodiment, the content corresponding to the first record is determined according to the content of the second record and the calculation chain of the first record, and the content corresponding to the first record is replaced by the calculation chain so that the first record is no longer associated with other records, thereby realizing Locking of the first record; and by setting the first record as uneditable, it is possible to avoid changing the first record by misoperation.
基于上述任一实施例,在一个实施例中,装置,还包括:查询模块:查询模块包括:Based on any of the foregoing embodiments, in one embodiment, the apparatus further includes: a query module: the query module includes:
第一查询单元,用于接收对第六记录的查询指令;其中,第四记录是第一记录所在的数据表中的一项记录;a first query unit, configured to receive a query instruction for the sixth record; wherein, the fourth record is a record in the data table where the first record is located;
第二查询单元,用于确定第六记录的存储方式;a second query unit, configured to determine the storage mode of the sixth record;
第三查询单元,用于在第六记录的存储方式为数值存储的情况下,根据第六记录相应存储的数值,得到查询结果并返回;The third query unit is used to obtain and return the query result according to the corresponding stored value of the sixth record when the storage mode of the sixth record is numerical value storage;
第四查询单元,用于在第六记录的存储方式为计算链存储的情况下,根据第六记录的计算链,以及第六记录的计算链的关联值,得到查询结果并返回。The fourth query unit is configured to obtain and return a query result according to the calculation chain of the sixth record and the associated value of the calculation chain of the sixth record when the storage method of the sixth record is the calculation chain storage.
本实施例确定了第六记录的存储方式,并根据第六记录的存储方式执行相应的获取查询结果的步骤,精确便捷地获取到了查询结果。In this embodiment, the storage mode of the sixth record is determined, and the corresponding steps of obtaining the query result are performed according to the storage mode of the sixth record, so that the query result can be obtained accurately and conveniently.
基于上述任一实施例,在一个实施例中,第二查询单元,进一步用于:Based on any of the foregoing embodiments, in one embodiment, the second query unit is further configured to:
根据第六记录的标识符,结合标识符与存储方式的预设对应关系,确定第六记录的存储方式。The storage mode of the sixth record is determined according to the identifier of the sixth record and in combination with the preset correspondence between the identifier and the storage mode.
本实施例中根据第六记录的标识符,结合标识符与存储方式的预设对应关系,准确地确定了第六记录的存储方式,避免了数据管理混乱。In this embodiment, according to the identifier of the sixth record, combined with the preset correspondence between the identifier and the storage mode, the storage mode of the sixth record is accurately determined, thereby avoiding confusion in data management.
图7示例了一种电子设备的实体结构示意图,如图7所示,该电子设备可以包括:处理器(processor)710、通信接口(Communications Interface)720、存储器(memory)730和通信总线740,其中,处理器710,通信接口720,存储器730通过通信总线740完成相互间的通信。处理器710可以调用存储器730中的逻辑指令,以执行上述各提供的数据处理方法的全部或部分步骤,该方法包括:确定第一文档以及与第一文档具有关联关系的第二文档;在第二文档中的第二记录的内容发生变化的情况下,在第一文档中的与第二记录具有关联关系的第一记录的内容维持不变;其中,第二记录为第二文档中的至少部分数据。FIG. 7 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 7 , the electronic device may include: a processor (processor) 710, a communication interface (Communications Interface) 720, a memory (memory) 730 and a
此外,上述的存储器730中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the
另一方面,本发明还提供一种计算机程序产品,计算机程序产品包括存储在计算机可读存储介质上的计算机程序,计算机程序包括程序指令,当程序指令被计算机执行时,计算机能够执行上述各提供的数据处理方法的全部或部分步骤,该方法包括:确定第一文档以及与第一文档具有关联关系的第二文档;在第二文档中的第二记录的内容发生变化的情况下,在第一文档中的与第二记录具有关联关系的第一记录的内容维持不变;其中,第二记录为第二文档中的至少部分数据。On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the above-mentioned various provided All or part of the steps of the data processing method according to The content of the first record in a document that has an associated relationship with the second record remains unchanged; wherein, the second record is at least part of the data in the second document.
又一方面,本发明还提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各提供的数据处理方法的全部或部分步骤,该方法包括:确定第一文档以及与第一文档具有关联关系的第二文档;在第二文档中的第二记录的内容发生变化的情况下,在第一文档中的与第二记录具有关联关系的第一记录的内容维持不变;其中,第二记录为第二文档中的至少部分数据。In another aspect, the present invention also provides a computer-readable storage medium on which a computer program is stored, and the computer program is implemented by a processor to execute all or part of the steps of the data processing methods provided above, the method comprising: : determine the first document and the second document that is associated with the first document; in the case where the content of the second record in the second document changes, the first document that is associated with the second record in the first document The content of one record remains unchanged; wherein, the second record is at least part of the data in the second document.
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place , or distributed to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be The technical solutions described in the foregoing embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210347792.4ACN114896242A (en) | 2022-04-01 | 2022-04-01 | Data processing method and device, electronic equipment and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210347792.4ACN114896242A (en) | 2022-04-01 | 2022-04-01 | Data processing method and device, electronic equipment and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN114896242Atrue CN114896242A (en) | 2022-08-12 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210347792.4APendingCN114896242A (en) | 2022-04-01 | 2022-04-01 | Data processing method and device, electronic equipment and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN114896242A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1527226A (en)* | 2003-02-13 | 2004-09-08 | Chaining of file element with corresponding field, inquiry and/or process in data base | |
| CN102236653A (en)* | 2010-04-26 | 2011-11-09 | 北京开普互联科技有限公司 | Method for realizing interaction between layout file and relational database |
| CN103262105A (en)* | 2010-12-10 | 2013-08-21 | 皇家飞利浦电子股份有限公司 | Clinical documentation debugging decision support |
| US20150309973A1 (en)* | 2014-04-28 | 2015-10-29 | Elwha LLC, | Methods, systems, and devices for machines and machine states that facilitate modification of documents based on various corpora and/or modification data |
| CN107526746A (en)* | 2016-06-22 | 2017-12-29 | 伊姆西公司 | The method and apparatus of management document index |
| CN109615492A (en)* | 2017-09-29 | 2019-04-12 | 北京华融启明风险管理技术股份有限公司 | A kind of bookkeeping voucher generation method and system |
| CN113239049A (en)* | 2021-06-15 | 2021-08-10 | 北京字跳网络技术有限公司 | Information processing method and device, terminal and storage medium |
| CN113704257A (en)* | 2021-08-06 | 2021-11-26 | 网易(杭州)网络有限公司 | Data table updating method and device |
| CN113868260A (en)* | 2021-10-09 | 2021-12-31 | 北京字跳网络技术有限公司 | Data processing method, apparatus and electronic equipment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1527226A (en)* | 2003-02-13 | 2004-09-08 | Chaining of file element with corresponding field, inquiry and/or process in data base | |
| CN102236653A (en)* | 2010-04-26 | 2011-11-09 | 北京开普互联科技有限公司 | Method for realizing interaction between layout file and relational database |
| CN103262105A (en)* | 2010-12-10 | 2013-08-21 | 皇家飞利浦电子股份有限公司 | Clinical documentation debugging decision support |
| US20150309973A1 (en)* | 2014-04-28 | 2015-10-29 | Elwha LLC, | Methods, systems, and devices for machines and machine states that facilitate modification of documents based on various corpora and/or modification data |
| CN107526746A (en)* | 2016-06-22 | 2017-12-29 | 伊姆西公司 | The method and apparatus of management document index |
| CN109615492A (en)* | 2017-09-29 | 2019-04-12 | 北京华融启明风险管理技术股份有限公司 | A kind of bookkeeping voucher generation method and system |
| CN113239049A (en)* | 2021-06-15 | 2021-08-10 | 北京字跳网络技术有限公司 | Information processing method and device, terminal and storage medium |
| CN113704257A (en)* | 2021-08-06 | 2021-11-26 | 网易(杭州)网络有限公司 | Data table updating method and device |
| CN113868260A (en)* | 2021-10-09 | 2021-12-31 | 北京字跳网络技术有限公司 | Data processing method, apparatus and electronic equipment |
| Publication | Publication Date | Title |
|---|---|---|
| EP3707615B1 (en) | Violation resolution in client synchronization | |
| US10437795B2 (en) | Upgrading systems with changing constraints | |
| US7509327B2 (en) | Business data migration using metadata | |
| TWI571754B (en) | Method for performing file synchronization control, and associated apparatus | |
| CN114896242A (en) | Data processing method and device, electronic equipment and storage medium |
| 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 |